kfbxlayer.h

Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_LAYER_H_
00005 #define _FBXSDK_LAYER_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2007 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material
00013  (collectively the "Data") in these files contain unpublished information
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by
00015  Canada and United States of America federal copyright law and by international
00016  treaties.
00017 
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE,
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE.
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE.
00028 
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE.
00039 
00040 **************************************************************************************/
00041 
00042 #include <kaydaradef.h>
00043 #ifndef KFBX_DLL 
00044     #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046 
00047 #include <kaydara.h>
00048 
00049 #include <klib/kstring.h>
00050 #include <klib/karrayul.h>
00051 #include <klib/kdebug.h>
00052 
00053 #ifndef MB_FBXSDK
00054 #include <kbaselib_nsuse.h>
00055 #endif
00056 
00057 #include <kfbxmath/kfbxvector2.h>
00058 #include <kfbxmath/kfbxvector4.h>
00059 #include <kfbxplugins/kfbxcolor.h>
00060 #include <kfbxplugins/kfbxtypes.h>
00061 
00062 #include <fbxfilesdk_nsbegin.h>
00063 
00064 class KFbxTexture;
00065 class KFbxSurfaceMaterial;
00066 class KFbxSdkManager;
00067 
00068 class KFbxGeometryBase;
00069 class KFbxLayer;
00070 class KFbxLayerContainer;
00071 class KFbxMesh;
00072 class KFbxReader3DS;
00073 class KFbxGeometryConverter;
00074 class KFbxReaderFbx;
00075 class KFbxReaderFbx6;
00076 class KFbxReaderObj;
00077 //class KFbxReaderCollada;
00078 
00084 class KFBX_DLL KFbxLayerElement
00085 {
00086 
00087 public:
00088 
00116     typedef enum 
00117     {
00118         eUNDEFINED,
00119         eNORMAL,
00120         eMATERIAL,
00121         eDIFFUSE_TEXTURES,
00122         ePOLYGON_GROUP,
00123         eUV,
00124         eVERTEX_COLOR,
00125         eSMOOTHING,
00126         eUSER_DATA,
00127         eVISIBILITY,
00128         eEMISSIVE_TEXTURES,
00129         eEMISSIVE_FACTOR_TEXTURES,
00130         eAMBIENT_TEXTURES,
00131         eAMBIENT_FACTOR_TEXTURES,
00132         eDIFFUSE_FACTOR_TEXTURES,
00133         eSPECULAR_TEXTURES,
00134         eNORMALMAP_TEXTURES,
00135         eSPECULAR_FACTOR_TEXTURES,
00136         eSHININESS_TEXTURES,
00137         eBUMP_TEXTURES,
00138         eTRANSPARENT_TEXTURES,
00139         eTRANSPARENCY_FACTOR_TEXTURES,
00140         eREFLECTION_TEXTURES,
00141         eREFLECTION_FACTOR_TEXTURES,
00142         eLAST_ELEMENT_TYPE
00143     } ELayerElementType;
00144 
00155     typedef enum 
00156     {
00157         eNONE,
00158         eBY_CONTROL_POINT,
00159         eBY_POLYGON_VERTEX,
00160         eBY_POLYGON,
00161         eBY_EDGE,
00162         eALL_SAME
00163     } EMappingMode;
00164 
00178     typedef enum 
00179     {
00180         eDIRECT,
00181         eINDEX,
00182         eINDEX_TO_DIRECT
00183     } EReferenceMode;
00184 
00185     
00189     void SetMappingMode(EMappingMode pMappingMode) { mMappingMode = pMappingMode; }
00190 
00194     void SetReferenceMode(EReferenceMode pReferenceMode) { mReferenceMode = pReferenceMode; }
00195 
00199     EMappingMode GetMappingMode() { return mMappingMode; }
00200 
00204     EReferenceMode GetReferenceMode() { return mReferenceMode; }
00205 
00209     void SetName(const char* pName) { mName = KString(pName); }
00210 
00214     const char* GetName() const { return ((KFbxLayerElement*)this)->mName.GetBuffer(); }
00215 
00216 
00218 //
00219 //  WARNING!
00220 //
00221 //  Anything beyond these lines may not be documented accurately and is 
00222 //  subject to change without notice.
00223 //
00225 
00226 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00227 
00228 
00229 
00230 protected:
00231     KFbxLayerElement() : mMappingMode(eNONE), mReferenceMode(eDIRECT), mName("") {}
00232     EMappingMode mMappingMode;
00233     EReferenceMode mReferenceMode;
00234     KString mName;
00235     friend class KFbxSdkManager;
00236 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00237 };
00238 
00239 
00243 template <class Type> class KFbxLayerElementTemplate : public KFbxLayerElement
00244 {
00245 
00246 public:
00251     KArrayTemplate<Type>& GetDirectArray() 
00252     { 
00253         K_ASSERT(mReferenceMode == KFbxLayerElement::eDIRECT || mReferenceMode == KFbxLayerElement::eINDEX_TO_DIRECT);
00254         return mDirectArray; 
00255     }
00256 
00261     KArrayTemplate<int>& GetIndexArray() 
00262     { 
00263         K_ASSERT(mReferenceMode == KFbxLayerElement::eINDEX || mReferenceMode == KFbxLayerElement::eINDEX_TO_DIRECT);
00264         return mIndexArray; 
00265     }
00266 
00269     void Clear()
00270     {
00271         mDirectArray.Clear();
00272         mIndexArray.Clear();
00273     }
00274 
00276 //
00277 //  WARNING!
00278 //
00279 //  Anything beyond these lines may not be documented accurately and is 
00280 //  subject to change without notice.
00281 //
00283 
00284 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00285 protected:
00286     KFbxLayerElementTemplate(){}
00287     KArrayTemplate<Type> mDirectArray;
00288     KArrayTemplate<int> mIndexArray;
00289     //friend class KFbxReaderCollada;
00290     //friend class KFbxGeometryBase;
00291     //friend class KFbxLayer;
00292     //friend class KFbxMesh;
00293     //friend class KFbxReader3DS;
00294     //friend class KFbxGeometryConverter;
00295     //friend class KFbxReaderFbx;
00296     //friend class KFbxReaderFbx6;
00297     //friend class KFbxReaderObj;
00298     friend class KFbxSdkManager;
00299 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00300 };
00301 
00305 typedef class KFBX_DLL KFbxLayerElementTemplate<KFbxVector4>   KFbxLayerElementNormal;
00306 
00310 typedef class KFBX_DLL KFbxLayerElementTemplate<KFbxSurfaceMaterial*> KFbxLayerElementMaterial;
00311 
00315 typedef class KFBX_DLL KFbxLayerElementTemplate<int>          KFbxLayerElementPolygonGroup;
00316 
00320 typedef class KFBX_DLL KFbxLayerElementTemplate<KFbxVector2>   KFbxLayerElementUV;
00321 
00325 typedef class KFBX_DLL KFbxLayerElementTemplate<KFbxColor>     KFbxLayerElementVertexColor;
00326 
00329 const int kNoMapping = -1;
00330 
00336 class KFbxLayerElementUserData;
00337 
00338 template <class T> inline KArrayTemplate<T>& KFbxGetDirectArray( KFbxLayerElementUserData *pLayerElement,int pIndex, bool* pStatus = NULL);
00339 template <class T> inline KArrayTemplate<T>& KFbxGetDirectArray( KFbxLayerElementUserData *pLayerElement,const char* pName, bool* pStatus = NULL );
00340 
00341 class KFBX_DLL KFbxLayerElementUserData : public KFbxLayerElementTemplate<void*>
00342 {
00343 public:
00344 
00345     /* Flag to indicate no direct array mapping for an index array element
00346      */
00347 
00348 
00349 
00350 
00351     ~KFbxLayerElementUserData()
00352     {
00353         Clear();
00354     }
00355 
00356     
00357     KArrayTemplate<void*>* GetDirectArrayVoid( int pIndex, bool* pStatus = NULL)
00358     {
00359         if( pIndex >= 0 || pIndex < mDirectArray.GetCount() )
00360             return (KArrayTemplate<void*> *)mDirectArray[pIndex];
00361         else
00362         {
00363             if( pStatus )
00364                 *pStatus = false;
00365 
00366             K_ASSERT_MSG_NOW("Index out of bounds");
00367             return (KArrayTemplate<void*>*)NULL;
00368         }
00369     }
00370 
00373     KArrayTemplate<void *>* GetDirectArrayVoid ( const char* pName, bool* pStatus = NULL )
00374     {
00375         KString lName( pName );
00376         for( int i = 0; i < mDataNames.GetCount(); ++i )
00377         {
00378             if( *mDataNames[i] == lName )
00379                 return GetDirectArrayVoid(i, pStatus);
00380         }
00381 
00382         return (KArrayTemplate<void *>*)NULL;
00383     }
00384 
00389     KFbxDataType GetDataType( int pIndex ) const
00390     {
00391         if( pIndex < 0 || pIndex >= mDataTypes.GetCount() )
00392             return DTNone;
00393 
00394         return mDataTypes[pIndex];
00395     }
00396 
00401     KFbxDataType GetDataType( const char* pName ) const
00402     {
00403         KString lName( pName );
00404 
00405         for( int i = 0; i < mDataNames.GetCount(); ++i )
00406         {
00407             if( *mDataNames[i] == lName )
00408                 return mDataTypes[i];
00409         }
00410 
00411         return DTNone;
00412     }
00413 
00418     const char* GetDataName( int pIndex ) const
00419     {
00420         if( pIndex >= 0 && pIndex < mDataNames.GetCount() )
00421             return mDataNames[pIndex]->GetBuffer();
00422 
00423         return NULL;
00424     }
00425 
00429     void ResizeAllDirectArrays( int pSize )
00430     {
00431         for( int i = 0; i < mDirectArray.GetCount(); ++i )
00432         {
00433             switch( mDataTypes[i].GetType() )
00434             {
00435                 case eBOOL1:    KFbxGetDirectArray<bool>(this,i).Resize( pSize );           break;
00436                 case eINTEGER1: KFbxGetDirectArray<int>(this,i).Resize( pSize );                break;
00437                 case eFLOAT1:   KFbxGetDirectArray<float>(this,i).Resize( pSize );          break;
00438                 case eDOUBLE1:  KFbxGetDirectArray<double>(this,i).Resize( pSize );         break;
00439                 //case eDOUBLE3:    GetDirectArray< fbxDouble3 >(i).Resize( pSize );    break;
00440                 //case eDOUBLE4:    GetDirectArray< fbxDouble4 >(i).Resize( pSize );    break;
00441                 //case eDOUBLE44:   GetDirectArray< fbxDouble44>(i).Resize( pSize );    break;  
00442                 default:
00443                     K_ASSERT_MSG_NOW("unknown type" ); break;
00444             }
00445         }
00446     }
00447 
00451     void RemoveFromAllDirectArrays( int pIndex )
00452     {
00453         for( int i = 0; i < mDirectArray.GetCount(); ++i )
00454         {
00455             switch( mDataTypes[i].GetType() )
00456             {
00457                 case eBOOL1:    KFbxGetDirectArray<bool>(this,i).RemoveAt( pIndex );                break;
00458                 case eINTEGER1: KFbxGetDirectArray<int>(this,i).RemoveAt( pIndex );             break;
00459                 case eFLOAT1:   KFbxGetDirectArray<float>(this,i).RemoveAt( pIndex );           break;
00460                 case eDOUBLE1:  KFbxGetDirectArray<double>(this,i).RemoveAt( pIndex );          break;
00461                 //case eDOUBLE3:    GetDirectArray< fbxDouble3 >(i).RemoveAt( pIndex ); break;
00462                 //case eDOUBLE4:    GetDirectArray< fbxDouble4 >(i).RemoveAt( pIndex ); break;
00463                 //case eDOUBLE44:   GetDirectArray< fbxDouble44>(i).RemoveAt( pIndex ); break;  
00464                 default:
00465                     K_ASSERT_MSG_NOW("unknown type" ); break;
00466             }
00467         }
00468     }
00469 
00474     int GetArrayCount( int pIndex ) const 
00475     {
00476         if( pIndex >= 0 && pIndex < mDirectArray.GetCount() )
00477         {
00478             switch( mDataTypes[pIndex].GetType() )
00479             {
00480                 case eBOOL1:    return ((const KArrayTemplate<bool>*)mDirectArray[pIndex])->GetCount();
00481                 case eINTEGER1: return ((const KArrayTemplate<int>*)mDirectArray[pIndex])->GetCount();
00482                 case eFLOAT1:   return ((const KArrayTemplate<float>*)mDirectArray[pIndex])->GetCount();
00483                 case eDOUBLE1:  return ((const KArrayTemplate<double>*)mDirectArray[pIndex])->GetCount();
00484                 //case eDOUBLE3:    return GetDirectArray< fbxDouble3 >(pIndex).GetCount();
00485                 //case eDOUBLE4:    return GetDirectArray< fbxDouble4 >(pIndex).GetCount();
00486                 //case eDOUBLE44:   return GetDirectArray< fbxDouble44>(pIndex).GetCount();
00487                 default:
00488                     K_ASSERT_MSG_NOW("Unknown type" ); break;
00489             }
00490         }
00491 
00492         return -1;
00493     }
00494 
00498     int GetId() const { return mId; }
00499 
00503     int GetDirectArrayCount() const { return mDirectArray.GetCount(); }
00504 
00506     KFbxLayerElementUserData& operator=( KFbxLayerElementUserData const& pOther )
00507     {
00508       int i;
00509         Clear();
00510 
00511         // Build descriptives.
00512         //
00513         for( i = 0; i < pOther.mDataNames.GetCount(); ++i )
00514             mDataNames.Add( new KString( *pOther.mDataNames[i] ) );
00515 
00516         for( i = 0; i < pOther.mDataTypes.GetCount(); ++i )
00517             mDataTypes.Add( pOther.mDataTypes[i] );
00518 
00519 
00520         Init();
00521 
00522         for( i = 0; i < pOther.GetDirectArrayCount(); ++i )
00523         {
00524             switch( mDataTypes[i].GetType() )
00525             {
00526                 case eBOOL1:    ((KArrayTemplate<bool>*)mDirectArray[i])->operator=( (*(const KArrayTemplate<bool>*)pOther.mDirectArray[i]) ); break;
00527                 case eINTEGER1: ((KArrayTemplate<int>*)mDirectArray[i])->operator=( (*(const KArrayTemplate<int>*)pOther.mDirectArray[i]) ); break;
00528                 case eFLOAT1:   ((KArrayTemplate<float>*)mDirectArray[i])->operator=( (*(const KArrayTemplate<float>*)pOther.mDirectArray[i]) ); break;
00529                 case eDOUBLE1:  ((KArrayTemplate<double>*)mDirectArray[i])->operator=( (*(const KArrayTemplate<double>*)pOther.mDirectArray[i]) ); break;
00530                 //case eDOUBLE3:    GetDirectArray< fbxDouble3 >(pIndex).SetAt(j, pOther.GetDirectArray<bool>(i)[j] );
00531                 //case eDOUBLE4:    GetDirectArray< fbxDouble4 >(pIndex).SetAt(j, pOther.GetDirectArray<bool>(i)[j] );
00532                 //case eDOUBLE44:   GetDirectArray< fbxDouble44>(pIndex).SetAt(j, pOther.GetDirectArray<bool>(i)[j] );
00533                 default:
00534                     K_ASSERT_MSG_NOW("Unknown type" ); break;
00535             }
00536         }
00537 
00538         mId = pOther.mId;
00539 
00540         mIndexArray = pOther.mIndexArray;
00541 
00542         return *this;
00543     }
00544 
00547     void Clear()
00548     {
00549       int i;
00550 
00551         for( i = 0; i < mDirectArray.GetCount(); ++i )
00552         {
00553             if( mDirectArray[i] )
00554             {
00555                 delete mDirectArray[i];
00556                 mDirectArray[i] = NULL;
00557             }
00558         }
00559         // cleared in template::clear
00560 
00561         for( i = 0; i < mDataNames.GetCount(); ++i )
00562         {
00563             if( mDataNames[i] )
00564             {
00565                 delete mDataNames[i];
00566                 mDataNames[i] = NULL;
00567             }
00568         }
00569         mDataNames.Clear();
00570 
00571         mDataTypes.Clear();
00572 
00573         KFbxLayerElementTemplate<void*>::Clear();
00574     }
00575 
00576 protected:
00577     
00583     KFbxLayerElementUserData( int pId, KArrayTemplate<KFbxDataType>& pDataTypes, KArrayTemplate<const char*>& pDataNames )
00584         :
00585         mId( pId ),
00586         mDataTypes( pDataTypes )
00587     {
00588         K_ASSERT( pDataTypes.GetCount() == pDataNames.GetCount() );
00589         Init();
00590 
00591         for( int i = 0; i < pDataNames.GetCount(); ++i )
00592         {
00593             mDataNames.Add( new KString( pDataNames[i] ) );
00594         }
00595     }
00596     /* Copy constructor. A deep copy is made.
00597     */
00598     KFbxLayerElementUserData( KFbxLayerElementUserData const& pOther )
00599     {
00600         *this = pOther;
00601     }
00602     //friend class KFbxReaderFbx6;
00603     friend class KFbxSdkManager;
00604 private:
00605 
00606     void Init()
00607     {
00608       int i;
00609         mDirectArray.Resize( mDataTypes.GetCount() );
00610 
00611         // initialize arrays
00612         for( i = 0; i < mDataTypes.GetCount(); ++i )
00613         {
00614             switch( mDataTypes[i].GetType() )
00615             {
00616                 case eBOOL1:    mDirectArray[i] = new KArrayTemplate<bool>();           break;
00617                 case eINTEGER1: mDirectArray[i] = new KArrayTemplate<int>();                break;
00618                 case eFLOAT1:   mDirectArray[i] = new KArrayTemplate<float>();          break;
00619                 case eDOUBLE1:  mDirectArray[i] = new KArrayTemplate<double>();         break;
00620                 //case eDOUBLE3:    mDirectArray[i] = new KArrayTemplate< fbxDouble3 >();   break;  
00621                 //case eDOUBLE4:    mDirectArray[i] = new KArrayTemplate< fbxDouble4 >();   break;
00622                 //case eDOUBLE44:   mDirectArray[i] = new KArrayTemplate< fbxDouble44 >();  break;  
00623                 default:
00624                     K_ASSERT_MSG_NOW("Trying to assign an unknown type" ); break;
00625             }
00626         }
00627     }
00628 
00629     int mId;
00630     KArrayTemplate<KFbxDataType> mDataTypes;
00631     KArrayTemplate<KString*> mDataNames;
00632 };
00633 
00640 template <class T>
00641 inline KArrayTemplate<T>& KFbxGetDirectArray( KFbxLayerElementUserData *pLayerElement,int pIndex, bool* pStatus)
00642 {
00643     return *(KArrayTemplate<T>*)pLayerElement->GetDirectArrayVoid(pIndex,pStatus);
00644 }
00645 
00648 template <class T>
00649 inline KArrayTemplate<T>& KFbxGetDirectArray( KFbxLayerElementUserData *pLayerElement,const char* pName, bool* pStatus )
00650 {
00651     return *(KArrayTemplate<T>*)pLayerElement->GetDirectArrayVoid(pName,pStatus);
00652 }
00653 
00654 
00655 
00659 class KFBX_DLL KFbxLayerElementSmoothing : public KFbxLayerElementTemplate<bool>
00660 {
00661 public:
00662 
00663     void SetReferenceMode( KFbxLayerElement::EReferenceMode pMode )
00664     {
00665         if( pMode != KFbxLayerElement::eDIRECT )
00666         {
00667             K_ASSERT_MSG_NOW( "Smoothing layer elements must be direct mapped" );
00668             return;
00669         }
00670     }
00671 protected:
00672     KFbxLayerElementSmoothing()
00673     {
00674         mReferenceMode = KFbxLayerElement::eDIRECT;
00675     }
00676     friend class KFbxSdkManager;
00677 
00678 };
00679 
00682 typedef class KFBX_DLL KFbxLayerElementTemplate<bool> KFbxLayerElementVisibility;
00683 
00684 typedef class KFBX_DLL KFbxLayerElementTemplate<KFbxTexture*>  KFbxLayerElementTextureBase;
00685 
00689 class KFBX_DLL KFbxLayerElementTexture : public KFbxLayerElementTextureBase
00690 {
00691 
00692 public:
00693 
00701     typedef enum 
00702     {
00703         eTRANSLUCENT,
00704         eADD,
00705         eMODULATE,
00706         eMODULATE2,
00707         eMAXBLEND
00708     } EBlendMode;
00709 
00713     void       SetBlendMode(EBlendMode pBlendMode) { mBlendMode = pBlendMode; }
00714 
00719     void       SetAlpha(double pAlpha)             
00720     { 
00721         mAlpha = pAlpha > 1.0 ? 1.0 : pAlpha;
00722         mAlpha = pAlpha < 0.0 ? 0.0 : pAlpha;
00723     }
00724 
00728     EBlendMode GetBlendMode()                      { return mBlendMode; } 
00729 
00733     double     GetAlpha()                          { return mAlpha; }
00734 
00736 //
00737 //  WARNING!
00738 //
00739 //  Anything beyond these lines may not be documented accurately and is 
00740 //  subject to change without notice.
00741 //
00743 
00744 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00745     void SetType(KFbxDataType* pType) { mType = pType; }
00746 protected:
00751     KFbxLayerElementTexture() : mBlendMode(eTRANSLUCENT)
00752     {
00753         mReferenceMode = eINDEX_TO_DIRECT;
00754         mAlpha         = 1.0;
00755     }
00756     friend class KFbxSdkManager;
00757 
00758 private:
00759     KFbxDataType* mType;
00760     EBlendMode mBlendMode;
00761     double     mAlpha;
00762 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00763 };
00764 
00765 
00793 class KFBX_DLL KFbxLayer
00794 {
00795 
00796 public:
00797 
00802 
00807     KFbxLayerElementNormal* GetNormals();   
00808 
00813     KFbxLayerElementNormal const* GetNormals() const;   
00814 
00818     KFbxLayerElementMaterial* GetMaterials();
00819 
00823     KFbxLayerElementMaterial const* GetMaterials() const;
00824 
00828     KFbxLayerElementPolygonGroup* GetPolygonGroups();
00829 
00833     KFbxLayerElementPolygonGroup const* GetPolygonGroups() const;
00834 
00835 
00839     KFbxLayerElementUV* GetEmissiveUV();
00840 
00844     KFbxLayerElementUV const* GetEmissiveUV() const;
00845 
00849     KFbxLayerElementUV* GetEmissiveFactorUV();
00850 
00854     KFbxLayerElementUV const* GetEmissiveFactorUV() const;
00855 
00859     KFbxLayerElementUV* GetAmbientUV();
00860 
00864     KFbxLayerElementUV const* GetAmbientUV() const;
00865 
00869     KFbxLayerElementUV* GetAmbientFactorUV();
00870 
00874     KFbxLayerElementUV const* GetAmbientFactorUV() const;
00875     
00879     KFbxLayerElementUV* GetDiffuseUV();
00880 
00884     KFbxLayerElementUV const* GetDiffuseUV() const;
00885 
00889     KFbxLayerElementUV* GetDiffuseFactorUV();
00890 
00894     KFbxLayerElementUV const* GetDiffuseFactorUV() const;
00895 
00899     KFbxLayerElementUV* GetSpecularUV();
00900 
00904     KFbxLayerElementUV const* GetSpecularUV() const;
00905 
00909     KFbxLayerElementUV* GetSpecularFactorUV();
00910 
00914     KFbxLayerElementUV const* GetSpecularFactorUV() const;
00915 
00919     KFbxLayerElementUV* GetShininessUV();
00920 
00924     KFbxLayerElementUV const* GetShininessUV() const;
00925 
00929     KFbxLayerElementUV* GetNormalMapUV();
00930 
00934     KFbxLayerElementUV const* GetNormalMapUV() const;
00935 
00939     KFbxLayerElementUV* GetBumpUV();
00940 
00944     KFbxLayerElementUV const* GetBumpUV() const;
00945 
00949     KFbxLayerElementUV* GetTransparentUV();
00950 
00954     KFbxLayerElementUV const* GetTransparentUV() const;
00955 
00959     KFbxLayerElementUV* GetTransparencyFactorUV();
00960 
00964     KFbxLayerElementUV const* GetTransparencyFactorUV() const;
00965 
00969     KFbxLayerElementUV* GetReflectionUV();
00970 
00974     KFbxLayerElementUV const* GetReflectionUV() const;
00975 
00979     KFbxLayerElementUV* GetReflectionFactorUV();
00980 
00984     KFbxLayerElementUV const* GetReflectionFactorUV() const;
00985 
00991     KFbxLayerElementUV* GetUVs(KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES);
00992 
00998     KFbxLayerElementUV const* GetUVs(KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES) const;
00999 
01000 
01003     int GetUVSetCount() const;
01004     
01007     KArrayTemplate<KFbxLayerElement::ELayerElementType> GetUVSetChannels() const;
01008 
01013     KFbxLayerElementVertexColor* GetVertexColors();
01014 
01019     KFbxLayerElementVertexColor const* GetVertexColors() const;
01020 
01025     KFbxLayerElementSmoothing* GetSmoothing();
01026 
01031     KFbxLayerElementSmoothing const* GetSmoothing() const;
01032 
01036     KFbxLayerElementUserData* GetUserData();
01037 
01041     KFbxLayerElementUserData const* GetUserData() const;
01042 
01046     KFbxLayerElementVisibility* GetVisibility();
01047 
01051     KFbxLayerElementVisibility const* GetVisibility() const;
01052 
01056     KFbxLayerElementTexture* GetEmissiveTextures();
01057 
01061     KFbxLayerElementTexture const* GetEmissiveTextures() const;
01062 
01066     KFbxLayerElementTexture* GetEmissiveFactorTextures();
01067 
01071     KFbxLayerElementTexture const* GetEmissiveFactorTextures() const;
01072 
01076     KFbxLayerElementTexture* GetAmbientTextures();
01077 
01081     KFbxLayerElementTexture const* GetAmbientTextures() const;
01082 
01086     KFbxLayerElementTexture* GetAmbientFactorTextures();
01087 
01091     KFbxLayerElementTexture const* GetAmbientFactorTextures() const;
01092     
01096     KFbxLayerElementTexture* GetDiffuseTextures();
01097 
01101     KFbxLayerElementTexture const* GetDiffuseTextures() const;
01102 
01106     KFbxLayerElementTexture* GetDiffuseFactorTextures();
01107 
01111     KFbxLayerElementTexture const* GetDiffuseFactorTextures() const;
01112 
01116     KFbxLayerElementTexture* GetSpecularTextures();
01117 
01121     KFbxLayerElementTexture const* GetSpecularTextures() const;
01122 
01126     KFbxLayerElementTexture* GetSpecularFactorTextures();
01127 
01131     KFbxLayerElementTexture const* GetSpecularFactorTextures() const;
01132 
01136     KFbxLayerElementTexture* GetShininessTextures();
01137 
01141     KFbxLayerElementTexture const* GetShininessTextures() const;
01142 
01146     KFbxLayerElementTexture* GetNormalMapTextures();
01147 
01151     KFbxLayerElementTexture const* GetNormalMapTextures() const;
01152 
01156     KFbxLayerElementTexture* GetBumpTextures();
01157 
01161     KFbxLayerElementTexture const* GetBumpTextures() const;
01162 
01166     KFbxLayerElementTexture* GetTransparentTextures();
01167 
01171     KFbxLayerElementTexture const* GetTransparentTextures() const;
01172 
01176     KFbxLayerElementTexture* GetTransparencyFactorTextures();
01177 
01181     KFbxLayerElementTexture const* GetTransparencyFactorTextures() const;
01182 
01186     KFbxLayerElementTexture* GetReflectionTextures();
01187 
01191     KFbxLayerElementTexture const* GetReflectionTextures() const;
01192 
01196     KFbxLayerElementTexture* GetReflectionFactorTextures();
01197 
01201     KFbxLayerElementTexture const* GetReflectionFactorTextures() const;
01202 
01203 
01204     KFbxLayerElementTexture* GetTextures(KFbxLayerElement::ELayerElementType pType);
01205     KFbxLayerElementTexture const* GetTextures(KFbxLayerElement::ELayerElementType pType) const;
01206     void SetTextures(KFbxLayerElement::ELayerElementType pType, KFbxLayerElementTexture* pTextures);
01207 
01236     KFbxLayerElement* GetLayerElementOfType(KFbxLayerElement::ELayerElementType pType, bool pIsUV=false);
01237 
01266     KFbxLayerElement const* GetLayerElementOfType(KFbxLayerElement::ELayerElementType pType, bool pIsUV=false) const;
01267 
01272     void SetNormals(KFbxLayerElementNormal* pNormals);
01273 
01277     void SetMaterials(KFbxLayerElementMaterial* pMaterials);
01278 
01282     void SetPolygonGroups(KFbxLayerElementPolygonGroup* pPolygonGroups);
01283 
01289     void SetUVs(KFbxLayerElementUV* pUVs, KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES);
01290 
01295     void SetVertexColors (KFbxLayerElementVertexColor* pVertexColors);
01296 
01301     void SetSmoothing (KFbxLayerElementSmoothing* pSmoothing);
01302 
01306     void SetUserData (KFbxLayerElementUserData* pUserData);
01307 
01311     void SetVisibility( KFbxLayerElementVisibility* lVisibility );
01312 
01316     void SetEmissiveTextures(KFbxLayerElementTexture* pTextures);
01317 
01321     void SetEmissiveFactorTextures(KFbxLayerElementTexture* pTextures);
01322 
01326     void SetAmbientTextures(KFbxLayerElementTexture* pTextures);
01327 
01331     void SetAmbientFactorTextures(KFbxLayerElementTexture* pTextures);
01332 
01336     void SetDiffuseTextures(KFbxLayerElementTexture* pTextures);
01337 
01341     void SetDiffuseFactorTextures(KFbxLayerElementTexture* pTextures);
01342 
01346     void SetSpecularTextures(KFbxLayerElementTexture* pTextures);
01347 
01351     void SetSpecularFactorTextures(KFbxLayerElementTexture* pTextures);
01352 
01356     void SetShininessTextures(KFbxLayerElementTexture* pTextures);
01357 
01361     void SetNormalMapTextures(KFbxLayerElementTexture* pTextures);
01362 
01366     void SetBumpTextures(KFbxLayerElementTexture* pTextures);
01367 
01371     void SetTransparentTextures(KFbxLayerElementTexture* pTextures);
01372 
01376     void SetTransparencyFactorTextures(KFbxLayerElementTexture* pTextures);
01377 
01381     void SetReflectionTextures(KFbxLayerElementTexture* pTextures);
01382 
01386     void SetReflectionFactorTextures(KFbxLayerElementTexture* pTextures);
01387 
01388 
01389     void Clone(KFbxLayer const& pSrcLayer, KFbxSdkManager* pSdkManager);    
01390     
01392     //KFbxLayer& operator=(KFbxLayer const& pSrcLayer); 
01394     
01395 
01396 
01398 //
01399 //  WARNING!
01400 //
01401 //  Anything beyond these lines may not be documented accurately and is 
01402 //  subject to change without notice.
01403 //
01405 
01406 #ifndef DOXYGEN_SHOULD_SKIP_THIS
01407 protected:
01409     KFbxLayer& operator=(KFbxLayer const& pSrcLayer);   
01411 private:
01412 
01413     KFbxLayer();
01414     virtual ~KFbxLayer();
01415 
01416     void Clear();
01417 
01418     KFbxLayerElementNormal*       mNormals;
01419     KFbxLayerElementMaterial*     mMaterials;
01420     KFbxLayerElementPolygonGroup* mPolygonGroups;
01421     KFbxLayerElementUV*           mUVs; 
01422     KFbxLayerElementVertexColor*  mVertexColors;
01423     KFbxLayerElementSmoothing*    mSmoothing;
01424     KFbxLayerElementUserData*     mUserData;
01425     KFbxLayerElementVisibility*   mVisibility;
01426 
01427     KFbxLayerElementUV*      mEmissiveUV;
01428     KFbxLayerElementUV*      mEmissiveFactorUV;
01429     KFbxLayerElementUV*      mAmbientUV;
01430     KFbxLayerElementUV*      mAmbientFactorUV;
01431     KFbxLayerElementUV*      mDiffuseFactorUV;
01432     KFbxLayerElementUV*      mSpecularUV;
01433     KFbxLayerElementUV*      mSpecularFactorUV;
01434     KFbxLayerElementUV*      mShininessUV;
01435     KFbxLayerElementUV*      mNormalMapUV;
01436     KFbxLayerElementUV*      mBumpUV;
01437     KFbxLayerElementUV*      mTransparentUV;
01438     KFbxLayerElementUV*      mTransparencyFactorUV;
01439     KFbxLayerElementUV*      mReflectionUV;
01440     KFbxLayerElementUV*      mReflectionFactorUV;
01441 
01442 
01443     KFbxLayerElementTexture*      mEmissiveTextures;
01444     KFbxLayerElementTexture*      mEmissiveFactorTextures;
01445     KFbxLayerElementTexture*      mAmbientTextures;
01446     KFbxLayerElementTexture*      mAmbientFactorTextures;
01447     KFbxLayerElementTexture*      mDiffuseTextures;
01448     KFbxLayerElementTexture*      mDiffuseFactorTextures;
01449     KFbxLayerElementTexture*      mSpecularTextures;
01450     KFbxLayerElementTexture*      mSpecularFactorTextures;
01451     KFbxLayerElementTexture*      mShininessTextures;
01452     KFbxLayerElementTexture*      mNormalMapTextures;
01453     KFbxLayerElementTexture*      mBumpTextures;
01454     KFbxLayerElementTexture*      mTransparentTextures;
01455     KFbxLayerElementTexture*      mTransparencyFactorTextures;
01456     KFbxLayerElementTexture*      mReflectionTextures;
01457     KFbxLayerElementTexture*      mReflectionFactorTextures;
01458 
01459     friend class KFbxLayerContainer;
01460 
01461 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
01462 };
01463 
01464 #include <fbxfilesdk_nsend.h>
01465 
01466 #endif // #ifndef _FBXSDK_LAYER_H_
01467 
01468 
01469