- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxobject.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2013 Autodesk, Inc.
    00004    All rights reserved.
    00005
    00006    Use of this software is subject to the terms of the Autodesk license agreement
    00007    provided at the time of installation or download, or which otherwise accompanies
    00008    this software in either electronic or hard copy form.
    00009
    00010 ****************************************************************************************/
    00011
    00013 #ifndef _FBXSDK_CORE_OBJECT_H_
    00014 #define _FBXSDK_CORE_OBJECT_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/fbxclassid.h>
    00019 #include <fbxsdk/core/fbxquery.h>
    00020 #include <fbxsdk/core/fbxemitter.h>
    00021 #include <fbxsdk/core/fbxproperty.h>
    00022 #include <fbxsdk/core/fbxstream.h>
    00023 #include <fbxsdk/core/base/fbxstringlist.h>
    00024 #include <fbxsdk/utils/fbxnamehandler.h>
    00025
    00026 #include <fbxsdk/fbxsdk_nsbegin.h>
    00027
    00028 class FbxManager;
    00029 class FbxDocument;
    00030 class FbxImplementation;
    00031 class FbxImplementationFilter;
    00032 class FbxLibrary;
    00033 class FbxMessage;
    00034 class FbxPeripheral;
    00035 class FbxUserDataRecord;
    00036 class FbxConnectEvent;
    00037
    00039 #define FBXSDK_CLASS_DECLARE(Class, Parent)\
    00040 private:\
    00041     Class(const Class&);\
    00042     Class& operator=(const Class&);\
    00043 protected:\
    00044     virtual ~Class(){};\
    00045 public:\
    00046     static FbxClassId ClassId;\
    00047     virtual FbxClassId GetClassId() const { return ClassId; }\
    00048     friend class FBXSDK_NAMESPACE::FbxManager;\
    00049     typedef Parent ParentClass;\
    00050     static Class* Create(FbxManager* pManager, const char* pName);\
    00051
    00052
    00053 #define FBXSDK_FBXOBJECT_DECLARE(Class, Parent)\
    00054     FBXSDK_CLASS_DECLARE(Class, Parent)\
    00055     FBXSDK_FRIEND_NEW()\
    00056     static Class* Create(FbxObject* pContainer, const char* pName);\
    00057 protected:\
    00058     static Class* Allocate(FbxManager* pManager, const char* pName, const Class* pFrom);\
    00059
    00060
    00061 #define FBXSDK_OBJECT_DECLARE(Class, Parent)\
    00062     FBXSDK_FBXOBJECT_DECLARE(Class, Parent)\
    00063 protected:\
    00064     Class(FbxManager& pManager, const char* pName) : Parent(pManager, pName){};\
    00065 private: /* end of object declaration, put back private */\
    00066
    00067
    00068 #define FBXSDK_ABSTRACT_OBJECT_DECLARE(Class, Parent)\
    00069     FBXSDK_CLASS_DECLARE(Class, Parent)\
    00070 protected:\
    00071     static FbxObjectCreateProc Allocate;\
    00072     Class(FbxManager& pManager, const char* pName) : Parent(pManager, pName){};\
    00073 private: /* end of object declaration, put back private */\
    00074
    00075
    00076 #define FBXSDK_OBJECT_IMPLEMENT(Class)\
    00077     FbxClassId Class::ClassId;\
    00078     Class* Class::Create(FbxManager* pManager, const char* pName)\
    00079     {\
    00080         return (Class*)pManager->CreateNewObjectFromClassId(Class::ClassId, pName);\
    00081     }\
    00082     Class* Class::Create(FbxObject* pContainer, const char* pName)\
    00083     {\
    00084         FBX_ASSERT_RETURN_VALUE(pContainer && pContainer->GetFbxManager(), NULL);\
    00085         return (Class*)pContainer->GetFbxManager()->CreateNewObjectFromClassId(Class::ClassId, pName, pContainer);\
    00086     }\
    00087     Class* Class::Allocate(FbxManager* pManager, const char* pName, const Class* pFrom)\
    00088     {\
    00089         Class* lNewObject = FbxNew<Class>(*pManager, pName);\
    00090         lNewObject->Construct(pFrom);\
    00091         lNewObject->SetObjectFlags(FbxObject::eInitialized, true);\
    00092         return lNewObject;\
    00093     }\
    00094
    00095
    00096 #define FBXSDK_ABSTRACT_OBJECT_IMPLEMENT(Class)\
    00097     FbxClassId Class::ClassId;\
    00098     FbxObjectCreateProc Class::Allocate = 0;\
    00099     Class* Class::Create(FbxManager* pManager, const char* pName)\
    00100     {\
    00101         return (Class*)pManager->CreateNewObjectFromClassId(Class::ClassId, pName);\
    00102     }\
    00103
    00104
    00157 class FBXSDK_DLL FbxObject : public FbxEmitter
    00158 {
    00159     FBXSDK_FBXOBJECT_DECLARE(FbxObject, FbxEmitter);
    00160
    00161 public:
    00163
    00164
    00168         FBX_DEPRECATED inline bool Is(const FbxClassId& pClassId) const { return GetClassId().Is(pClassId); }
    00169
    00174         template <class T> FBX_DEPRECATED inline bool Is(T* pClassType) const { return Is(T::ClassId); }
    00175
    00179         template <class T> inline bool Is() const { return GetClassId().Is(T::ClassId); }
    00180
    00183         FbxManager* GetFbxManager() const;
    00184
    00187         FbxDocument* GetDocument() const;
    00188
    00192         FbxDocument* GetRootDocument() const;
    00193
    00196         FbxScene* GetScene() const;
    00197
    00200         void Destroy(bool pRecursive=false);
    00201
    00203         void ResetProperties();
    00205
    00207
    00208
    00209         enum EObjectFlag
    00210         {
    00211             eNone = 0,
    00212             eInitialized = 1 << 0,
    00213             eSystem = 1 << 1,
    00214             eSavable = 1 << 2,
    00215             eSelected = 1 << 3,
    00216             eHidden = 1 << 4,
    00217             eContentLoaded = 1 << 5,
    00218             eDontLocalize = 1 << 6
    00219         };
    00220
    00224         void SetObjectFlags(EObjectFlag pFlags, bool pValue);
    00225
    00229         bool GetObjectFlags(EObjectFlag pFlags) const;
    00230
    00234         void SetAllObjectFlags(FbxUInt pFlags);
    00235
    00238         FbxUInt GetAllObjectFlags() const;
    00240
    00242
    00243
    00247         virtual FbxObject& Copy(const FbxObject& pObject);
    00248
    00250         enum ECloneType
    00251         {
    00252             eDeepClone,
    00253             eReferenceClone
    00254         };
    00255
    00268         virtual FbxObject* Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject* pContainer=NULL) const;
    00269
    00272         bool IsAReferenceTo() const;
    00273
    00276         FbxObject* GetReferenceTo() const;
    00277
    00280         bool IsReferencedBy() const;
    00281
    00284         int GetReferencedByCount() const;
    00285
    00289         FbxObject* GetReferencedBy(int pIndex) const;
    00291
    00299         void SetName(const char* pName);
    00300
    00304         const char* GetName() const;
    00305
    00309         FbxString GetNameWithoutNameSpacePrefix() const;
    00310
    00314         FbxString GetNameWithNameSpacePrefix() const;
    00315
    00319         void SetInitialName(const char* pName);
    00320
    00324         const char* GetInitialName() const;
    00325
    00329         FbxString GetNameSpaceOnly();
    00330
    00334         void SetNameSpace(FbxString pNameSpace);
    00335
    00340         FbxArray<FbxString*> GetNameSpaceArray(char identifier);
    00341
    00345         FbxString GetNameOnly() const;
    00346
    00350         FbxString GetNameSpacePrefix() const;
    00351
    00356         static FbxString RemovePrefix(char* pName);
    00357
    00362         static FbxString StripPrefix(FbxString& lName);
    00363
    00368         static FbxString StripPrefix(const char* pName);
    00369
    00371         const FbxUInt64& GetUniqueID() const;
    00373
    00381         virtual bool GetSelected();
    00382
    00386         virtual void SetSelected(bool pSelected);
    00388
    00399         void SetUserDataPtr(const FbxUInt64& pUserID, void* pUserData);
    00400
    00405         void* GetUserDataPtr(const FbxUInt64& pUserID) const;
    00406
    00412         inline void SetUserDataPtr(void* pUserData){ SetUserDataPtr(GetUniqueID(), pUserData); }
    00413
    00417         inline void* GetUserDataPtr() const { return GetUserDataPtr(GetUniqueID()); }
    00419
    00429         inline bool ConnectSrcObject(FbxObject* pObject, FbxConnection::EType pType=FbxConnection::eNone) { return RootProperty.ConnectSrcObject(pObject,pType); }
    00430
    00435         inline bool IsConnectedSrcObject(const FbxObject* pObject) const { return RootProperty.IsConnectedSrcObject(pObject); }
    00436
    00441         inline bool DisconnectSrcObject(FbxObject* pObject){ return RootProperty.DisconnectSrcObject(pObject); }
    00442
    00446         inline bool DisconnectAllSrcObject() { return RootProperty.DisconnectAllSrcObject(); }
    00447
    00452         inline bool DisconnectAllSrcObject(const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllSrcObject(pCriteria); }
    00453
    00458         FBX_DEPRECATED inline bool DisconnectAllSrcObject(FbxClassId pClassId) { return RootProperty.DisconnectAllSrcObject(FbxCriteria::ObjectType(pClassId)); }
    00459
    00463         inline int GetSrcObjectCount() const { return RootProperty.GetSrcObjectCount(); }
    00464
    00469         inline int GetSrcObjectCount(const FbxCriteria& pCriteria) const { return RootProperty.GetSrcObjectCount(pCriteria); }
    00470
    00475         FBX_DEPRECATED inline int GetSrcObjectCount(FbxClassId pClassId) const { return RootProperty.GetSrcObjectCount(FbxCriteria::ObjectType(pClassId)); }
    00476
    00481         inline FbxObject* GetSrcObject(int pIndex=0) const { return RootProperty.GetSrcObject(pIndex); }
    00482
    00488         inline FbxObject* GetSrcObject(const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetSrcObject(pCriteria,pIndex); }
    00489
    00495         FBX_DEPRECATED inline FbxObject* GetSrcObject(FbxClassId pClassId, int pIndex=0) const { return RootProperty.GetSrcObject(FbxCriteria::ObjectType(pClassId), pIndex); }
    00496
    00502         inline FbxObject* FindSrcObject(const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pName,pStartIndex); }
    00503
    00510         inline FbxObject* FindSrcObject(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pCriteria,pName,pStartIndex); }
    00511
    00518         FBX_DEPRECATED inline FbxObject* FindSrcObject(FbxClassId pClassId, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(FbxCriteria::ObjectType(pClassId), pName, pStartIndex); }
    00519
    00524         template <class T> FBX_DEPRECATED inline bool DisconnectAllSrcObject(const T* pFBX_TYPE) { return RootProperty.DisconnectAllSrcObject(pFBX_TYPE); }
    00525
    00528         template <class T> inline bool DisconnectAllSrcObject() { return RootProperty.DisconnectAllSrcObject(FbxCriteria::ObjectType(T::ClassId)); }
    00529
    00535         template <class T> FBX_DEPRECATED inline bool DisconnectAllSrcObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllSrcObject(pFBX_TYPE,pCriteria); }
    00536
    00540         template <class T> inline bool DisconnectAllSrcObject(const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllSrcObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    00541
    00545         template <class T> FBX_DEPRECATED inline int GetSrcObjectCount(const T* pFBX_TYPE) const { return RootProperty.GetSrcObjectCount(pFBX_TYPE); }
    00546
    00549         template <class T> inline int GetSrcObjectCount() const { return RootProperty.GetSrcObjectCount(FbxCriteria::ObjectType(T::ClassId)); }
    00550
    00555         template <class T> FBX_DEPRECATED inline int GetSrcObjectCount(const T* pFBX_TYPE, const FbxCriteria& pCriteria) const { return RootProperty.GetSrcObjectCount(pFBX_TYPE,pCriteria); }
    00556
    00560         template <class T> inline int GetSrcObjectCount(const FbxCriteria& pCriteria) const { return RootProperty.GetSrcObjectCount(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    00561
    00566         template <class T> FBX_DEPRECATED inline T* GetSrcObject(const T* pFBX_TYPE, int pIndex=0) const { return RootProperty.GetSrcObject(pFBX_TYPE, pIndex); }
    00567
    00571         template <class T> inline T* GetSrcObject(int pIndex=0) const { return (T*)RootProperty.GetSrcObject(FbxCriteria::ObjectType(T::ClassId), pIndex); }
    00572
    00578         template <class T> FBX_DEPRECATED inline T* GetSrcObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetSrcObject(pFBX_TYPE,pCriteria,pIndex); }
    00579
    00584         template <class T> inline T* GetSrcObject(const FbxCriteria& pCriteria, int pIndex=0) const { return (T*)RootProperty.GetSrcObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pIndex); }
    00585
    00592         template <class T> FBX_DEPRECATED inline T* FindSrcObject(const T* pFBX_TYPE, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pFBX_TYPE,pName,pStartIndex); }
    00593
    00598         template <class T> inline T* FindSrcObject(const char* pName, int pStartIndex=0) const { return (T*)RootProperty.FindSrcObject(FbxCriteria::ObjectType(T::ClassId), pName, pStartIndex); }
    00599
    00607         template <class T> FBX_DEPRECATED inline T* FindSrcObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pFBX_TYPE,pCriteria,pName,pStartIndex); }
    00608
    00614         template <class T> inline T* FindSrcObject(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return (T*)RootProperty.FindSrcObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pName, pStartIndex); }
    00615
    00621         inline bool ConnectDstObject(FbxObject* pObject, FbxConnection::EType pType=FbxConnection::eNone) { return RootProperty.ConnectDstObject(pObject,pType); }
    00622
    00627         inline bool IsConnectedDstObject(const FbxObject* pObject) const { return RootProperty.IsConnectedDstObject(pObject); }
    00628
    00633         inline bool DisconnectDstObject(FbxObject* pObject) { return RootProperty.DisconnectDstObject(pObject); }
    00634
    00638         inline bool DisconnectAllDstObject() { return RootProperty.DisconnectAllDstObject(); }
    00639
    00644         inline bool DisconnectAllDstObject(const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllDstObject(pCriteria); }
    00645
    00650         FBX_DEPRECATED inline bool DisconnectAllDstObject(FbxClassId pClassId) { return RootProperty.DisconnectAllDstObject(FbxCriteria::ObjectType(pClassId)); }
    00651
    00655         inline int GetDstObjectCount() const { return RootProperty.GetDstObjectCount(); }
    00656
    00661         inline int GetDstObjectCount(const FbxCriteria& pCriteria) const { return RootProperty.GetDstObjectCount(pCriteria); }
    00662
    00667         FBX_DEPRECATED inline int GetDstObjectCount(FbxClassId pClassId) const { return RootProperty.GetDstObjectCount(FbxCriteria::ObjectType(pClassId)); }
    00668
    00673         inline FbxObject* GetDstObject(int pIndex=0) const { return RootProperty.GetDstObject(pIndex); }
    00674
    00680         inline FbxObject* GetDstObject(const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetDstObject(pCriteria,pIndex); }
    00681
    00687         FBX_DEPRECATED inline FbxObject* GetDstObject(FbxClassId pClassId, int pIndex=0) const { return RootProperty.GetDstObject(FbxCriteria::ObjectType(pClassId), pIndex); }
    00688
    00694         inline FbxObject* FindDstObject(const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pName,pStartIndex); }
    00695
    00702         inline FbxObject* FindDstObject(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pCriteria,pName,pStartIndex); }
    00703
    00710         FBX_DEPRECATED inline FbxObject* FindDstObject(FbxClassId pClassId, const char* pName,int pStartIndex=0) const { return RootProperty.FindDstObject(FbxCriteria::ObjectType(pClassId), pName, pStartIndex); }
    00711
    00716         template <class T> FBX_DEPRECATED inline bool DisconnectAllDstObject(const T* pFBX_TYPE) { return RootProperty.DisconnectAllDstObject(pFBX_TYPE); }
    00717
    00720         template <class T> inline bool DisconnectAllDstObject() { return RootProperty.DisconnectAllDstObject(FbxCriteria::ObjectType(T::ClassId)); }
    00721
    00727         template <class T> FBX_DEPRECATED inline bool DisconnectAllDstObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllDstObject(pFBX_TYPE,pCriteria); }
    00728
    00732         template <class T> inline bool DisconnectAllDstObject(const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllDstObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    00733
    00738         template <class T> FBX_DEPRECATED inline int GetDstObjectCount(const T* pFBX_TYPE) const { return RootProperty.GetDstObjectCount(pFBX_TYPE); }
    00739
    00742         template <class T> inline int GetDstObjectCount() const { return RootProperty.GetDstObjectCount(FbxCriteria::ObjectType(T::ClassId)); }
    00743
    00749         template <class T> FBX_DEPRECATED inline int GetDstObjectCount(const T* pFBX_TYPE, const FbxCriteria& pCriteria) const { return RootProperty.GetDstObjectCount(pFBX_TYPE,pCriteria); }
    00750
    00754         template <class T> inline int GetDstObjectCount(const FbxCriteria& pCriteria) const { return RootProperty.GetDstObjectCount(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    00755
    00761         template <class T> FBX_DEPRECATED inline T* GetDstObject(const T* pFBX_TYPE, int pIndex=0) const { return RootProperty.GetDstObject(pFBX_TYPE,pIndex); }
    00762
    00766         template <class T> inline T* GetDstObject(int pIndex=0) const { return (T*)RootProperty.GetDstObject(FbxCriteria::ObjectType(T::ClassId), pIndex); }
    00767
    00774         template <class T> FBX_DEPRECATED inline T* GetDstObject(const T * pFBX_TYPE, const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetDstObject(pFBX_TYPE,pCriteria,pIndex); }
    00775
    00780         template <class T> inline T* GetDstObject(const FbxCriteria& pCriteria, int pIndex=0) const { return (T*)RootProperty.GetDstObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pIndex); }
    00781
    00788         template <class T> FBX_DEPRECATED inline T* FindDstObject(const T* pFBX_TYPE, const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pFBX_TYPE,pName,pStartIndex); }
    00789
    00794         template <class T> inline T* FindDstObject(const char* pName, int pStartIndex=0) const { return (T*)RootProperty.FindDstObject(FbxCriteria::ObjectType(T::ClassId), pName, pStartIndex); }
    00795
    00803         template <class T> FBX_DEPRECATED inline T* FindDstObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pFBX_TYPE,pCriteria,pName,pStartIndex); }
    00804
    00810         template <class T> inline T* FindDstObject(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return (T*)RootProperty.FindDstObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pName, pStartIndex); }
    00812
    00820         inline FbxProperty GetFirstProperty() const
    00821         {
    00822             return RootProperty.GetFirstDescendent();
    00823         }
    00824
    00829         inline FbxProperty GetNextProperty(const FbxProperty& pProperty) const
    00830         {
    00831             return RootProperty.GetNextDescendent(pProperty);
    00832         }
    00833
    00839         inline FbxProperty FindProperty(const char* pName, bool pCaseSensitive = true) const
    00840         {
    00841             return RootProperty.Find(pName, pCaseSensitive );
    00842         }
    00843
    00850         inline FbxProperty FindProperty(const char* pName, const FbxDataType& pDataType, bool pCaseSensitive = true) const
    00851         {
    00852             return RootProperty.Find(pName, pDataType, pCaseSensitive );
    00853         }
    00854
    00861         inline FbxProperty FindPropertyHierarchical(const char* pName, bool pCaseSensitive = true) const
    00862         {
    00863             return RootProperty.FindHierarchical(pName, pCaseSensitive );
    00864         }
    00865
    00873         inline FbxProperty FindPropertyHierarchical(const char* pName, const FbxDataType& pDataType, bool pCaseSensitive = true) const
    00874         {
    00875             return RootProperty.FindHierarchical(pName, pDataType, pCaseSensitive );
    00876         }
    00877
    00881         FBX_DEPRECATED inline FbxProperty& GetRootProperty() { return RootProperty; }
    00882
    00886         FBX_DEPRECATED inline const FbxProperty& GetRootProperty() const { return RootProperty; }
    00887
    00892         FbxProperty GetClassRootProperty();
    00893
    00898         inline bool ConnectSrcProperty(const FbxProperty& pProperty) { return RootProperty.ConnectSrcProperty(pProperty); }
    00899
    00904         inline bool IsConnectedSrcProperty(const FbxProperty& pProperty) { return RootProperty.IsConnectedSrcProperty(pProperty); }
    00905
    00910         inline bool DisconnectSrcProperty(const FbxProperty& pProperty) { return RootProperty.DisconnectSrcProperty(pProperty); }
    00911
    00915         inline int GetSrcPropertyCount() const { return RootProperty.GetSrcPropertyCount(); }
    00916
    00921         inline FbxProperty GetSrcProperty(int pIndex=0) const { return RootProperty.GetSrcProperty(pIndex); }
    00922
    00928         inline FbxProperty FindSrcProperty(const char* pName,int pStartIndex=0) const { return RootProperty.FindSrcProperty(pName,pStartIndex); }
    00929
    00934         inline bool ConnectDstProperty(const FbxProperty& pProperty) { return RootProperty.ConnectDstProperty(pProperty); }
    00935
    00940         inline bool IsConnectedDstProperty(const FbxProperty& pProperty) { return RootProperty.IsConnectedDstProperty(pProperty); }
    00941
    00946         inline bool DisconnectDstProperty(const FbxProperty& pProperty) { return RootProperty.DisconnectDstProperty(pProperty); }
    00947
    00951         inline int GetDstPropertyCount() const { return RootProperty.GetDstPropertyCount(); }
    00952
    00957         inline FbxProperty GetDstProperty(int pIndex=0) const { return RootProperty.GetDstProperty(pIndex); }
    00958
    00964         inline FbxProperty FindDstProperty(const char* pName, int pStartIndex=0) const { return RootProperty.FindDstProperty(pName,pStartIndex); }
    00966
    00983         int ContentUnload();
    00984
    00991         int ContentLoad();
    00992
    00998         bool ContentIsLoaded() const;
    00999
    01003         void ContentDecrementLockCount();
    01004
    01008         void ContentIncrementLockCount();
    01009
    01016         bool ContentIsLocked() const;
    01017
    01023         virtual bool ContentWriteTo(FbxStream& pStream) const;
    01024
    01030         virtual bool ContentReadFrom(const FbxStream& pStream);
    01032
    01041         void EmitMessage(FbxMessage* pMessage) const;
    01043
    01054         virtual const char* Localize(const char* pID, const char* pDefault=NULL) const;
    01056
    01064         FbxLibrary* GetParentLibrary() const;
    01065
    01071         bool AddImplementation(FbxImplementation* pImplementation);
    01072
    01078         bool RemoveImplementation(FbxImplementation* pImplementation);
    01079
    01083         bool HasDefaultImplementation(void) const;
    01084
    01088         FbxImplementation* GetDefaultImplementation(void) const;
    01089
    01096         bool SetDefaultImplementation(FbxImplementation* pImplementation);
    01097
    01102         int GetImplementationCount(const FbxImplementationFilter* pCriteria=NULL) const;
    01103
    01109         FbxImplementation* GetImplementation(int pIndex, const FbxImplementationFilter* pCriteria=NULL) const;
    01111
    01120         virtual FbxString GetUrl() const;
    01121
    01127         virtual bool SetUrl(char* pUrl);
    01129
    01134         void SetRuntimeClassId(const FbxClassId& pClassId);
    01135
    01138         FbxClassId GetRuntimeClassId() const;
    01139
    01144         bool IsRuntime(const FbxClassId& pClassId) const;
    01145
    01148         bool IsRuntimePlug() const;
    01150
    01152     FbxProperty RootProperty;
    01153
    01154 protected:
    01158     virtual void Construct(const FbxObject* pFrom);
    01159
    01163     virtual void ConstructProperties(bool pForceSet);
    01164
    01168     virtual void Destruct(bool pRecursive);
    01169
    01172     virtual void ContentClear();
    01173
    01177     virtual FbxPeripheral* GetPeripheral();
    01178
    01179 /*****************************************************************************************************************************
    01180 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    01181 *****************************************************************************************************************************/
    01182 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01183 public:
    01184     virtual bool Compare(FbxObject* pOtherObject);
    01185
    01186     //Basic comparison operator implementation. It simply compare property values between source and target.
    01187     //NOTE: If a property cannot be found on one of the object, the comparison fails (return false).
    01188     //Different classid will fail comparison as well as different property count. Reference properties are not compared.
    01189     bool operator==(const FbxObject& pObject);
    01190     bool operator!=(const FbxObject& pObject);
    01191
    01192     virtual void                SetDocument(FbxDocument* pDocument);
    01193
    01194     inline FbxPropertyHandle&   GetPropertyHandle() { return RootProperty.mPropertyHandle; }
    01195
    01196     //Important note: If this function is not implemented, the pFileSubTypeName string used when registering your
    01197     //class via FbxManager::RegisterFbxClass will be used instead. This makes it useless to re-implement this
    01198     //function if you do not intend to return a different string for the same class.
    01199     virtual const char*         GetTypeName() const;
    01200     virtual FbxStringList       GetTypeFlags() const;
    01201
    01202     // This function will go as deep as possible to clear the Connection list without sending
    01203     // notifications to the connections to give them the chance to Disconnect themselves.
    01204     // This is a bypass of the intended workflow and should be used with care.
    01205     void WipeAllConnections();
    01206
    01207     //Used as global flag to modify the behavior of FbxObject::Destruct() during a ForceKill() on the scene. This is for internal use.
    01208     static void SetWipeMode(bool pState);
    01209     static bool GetWipeMode();
    01210
    01211 protected:
    01212     FbxObject(FbxManager& pManager, const char* pName);
    01213
    01214     enum EPropertyNotifyType
    01215     {
    01216         ePropertySetRequest,
    01217         ePropertySet,
    01218         ePropertyGet
    01219     };
    01220
    01221     virtual bool        ConnectNotify(const FbxConnectEvent& pEvent);
    01222     virtual bool        PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty);
    01223     bool                Copyable(const FbxObject& pObject);
    01224
    01225 private:
    01226     void                CopyPropertiesFrom(const FbxObject& pFrom);
    01227     void                SetClassRootProperty(FbxProperty& lProperty);
    01228     int                 GetFlatPropertyCount() const;
    01229
    01230     FbxNameHandler      mName;
    01231     FbxClassId          mRuntimeClassId;
    01232     FbxUserDataRecord*  mUserData;
    01233     FbxManager*         mManager;
    01234     FbxImplementation*  mDefaultImplementation;
    01235     FbxUInt64           mUniqueID;
    01236     FbxInt32            mObjectFlags;
    01237     FbxInt32            mContentLockCount;
    01238     FbxInt32            mUserDataCount;
    01239     static bool         mWipeMode;
    01240
    01241     friend class FbxProperty;
    01242 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    01243 };
    01244
    01248 template<typename FbxProperty> class FbxIterator
    01249 {
    01250 public:
    01254     FbxIterator(const FbxObject* pObject) : mObject(pObject) {}
    01255
    01259     inline const FbxProperty& GetFirst() { mProperty = mObject->GetFirstProperty(); return mProperty; }
    01260
    01264     inline const FbxProperty& GetNext() { mProperty = mObject->GetNextProperty(mProperty); return mProperty; }
    01265
    01266 private:
    01267     FbxProperty        mProperty;
    01268     const FbxObject*   mObject;
    01269 };
    01270
    01274 class FbxIteratorSrcBase
    01275 {
    01276 public:
    01282     inline FbxIteratorSrcBase(FbxProperty& pProperty,FbxClassId pClassId) :
    01283         mProperty(pProperty),
    01284         mClassId(pClassId),
    01285         mSize(0),
    01286         mIndex(-1)
    01287     {
    01288         ResetToBegin();
    01289     }
    01290
    01296     inline FbxIteratorSrcBase(FbxObject* pObject,FbxClassId pClassId) :
    01297         mProperty(pObject->RootProperty),
    01298         mClassId(pClassId),
    01299         mSize(0),
    01300         mIndex(-1)
    01301     {
    01302         ResetToBegin();
    01303     }
    01304
    01309     inline FbxObject* GetFirst()
    01310     {
    01311         ResetToBegin();
    01312         return GetNext();
    01313     }
    01314
    01319     inline FbxObject* GetNext()
    01320     {
    01321         mIndex++;
    01322         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetSrcObject(FbxCriteria::ObjectType(mClassId), mIndex) : NULL;
    01323     }
    01324
    01330     inline FbxObject* GetSafeNext()
    01331     {
    01332         mSize = mProperty.GetSrcObjectCount(FbxCriteria::ObjectType(mClassId));
    01333         return GetNext();
    01334     }
    01335
    01340     inline FbxObject* GetLast()
    01341     {
    01342         ResetToEnd();
    01343         return GetPrevious();
    01344     }
    01345
    01350     inline FbxObject* GetPrevious()
    01351     {
    01352         mIndex--;
    01353         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetSrcObject(FbxCriteria::ObjectType(mClassId), mIndex) : NULL;
    01354     }
    01355
    01362     inline FbxObject* GetSafePrevious()
    01363     {
    01364         mSize = mProperty.GetSrcObjectCount(FbxCriteria::ObjectType(mClassId));
    01365         while (mIndex>mSize) mIndex--;
    01366         return GetPrevious();
    01367     }
    01368
    01369 protected:
    01373     inline void ResetToBegin()
    01374     {
    01375         mSize = mProperty.GetSrcObjectCount(FbxCriteria::ObjectType(mClassId));
    01376         mIndex = -1;
    01377     }
    01378
    01382     inline void ResetToEnd()
    01383     {
    01384         mSize = mProperty.GetSrcObjectCount(FbxCriteria::ObjectType(mClassId));
    01385         mIndex = mSize;
    01386     }
    01387
    01388     FbxProperty mProperty;
    01389     FbxClassId  mClassId;
    01390     int         mSize;
    01391     int         mIndex;
    01392 };
    01393
    01399 template<class Type> class FbxIteratorSrc : protected FbxIteratorSrcBase
    01400 {
    01401 public:
    01406     inline FbxIteratorSrc(FbxObject* pObject) : FbxIteratorSrcBase(pObject,Type::ClassId) {}
    01407
    01412     inline FbxIteratorSrc(FbxProperty& pProperty) : FbxIteratorSrcBase(pProperty,Type::ClassId) {}
    01413
    01418     inline Type* GetFirst()         { return (Type*)FbxIteratorSrcBase::GetFirst(); }
    01419
    01424     inline Type* GetNext()          { return (Type*)FbxIteratorSrcBase::GetNext(); }
    01425
    01431     inline Type* GetSafeNext()      { return (Type*)FbxIteratorSrcBase::GetSafeNext(); }
    01432
    01437     inline Type* GetLast()          { return (Type*)FbxIteratorSrcBase::GetLast(); }
    01438
    01439
    01444     inline Type* GetPrevious()      { return (Type*)FbxIteratorSrcBase::GetPrevious(); }
    01445
    01452     inline Type* GetSafePrevious()  { return (Type*)FbxIteratorSrcBase::GetSafePrevious(); }
    01453 };
    01454
    01458 class FbxIteratorDstBase
    01459 {
    01460 protected:
    01462     FbxProperty    mProperty;
    01464     FbxClassId     mClassId;
    01466     int             mSize;
    01468     int             mIndex;
    01469
    01470 public:
    01476     inline FbxIteratorDstBase(FbxProperty& pProperty,FbxClassId pClassId) :
    01477         mProperty(pProperty),
    01478         mClassId(pClassId),
    01479         mSize(0),
    01480         mIndex(-1)
    01481     {
    01482         ResetToBegin();
    01483     }
    01484
    01490     inline FbxIteratorDstBase(FbxObject* pObject,FbxClassId pClassId) :
    01491         mProperty(pObject->RootProperty),
    01492         mClassId(pClassId),
    01493         mSize(0),
    01494         mIndex(-1)
    01495     {
    01496         ResetToBegin();
    01497     }
    01498
    01503     inline FbxObject* GetFirst()
    01504     {
    01505         ResetToBegin();
    01506         return GetNext();
    01507     }
    01508
    01513     inline FbxObject* GetNext()
    01514     {
    01515         mIndex++;
    01516         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetDstObject(FbxCriteria::ObjectType(mClassId), mIndex) : NULL;
    01517     }
    01518
    01524     inline FbxObject* GetSafeNext()
    01525     {
    01526         mSize = mProperty.GetDstObjectCount(FbxCriteria::ObjectType(mClassId));
    01527         return GetNext();
    01528     }
    01529
    01534     inline FbxObject* GetLast()
    01535     {
    01536         ResetToEnd();
    01537         return GetPrevious();
    01538     }
    01539
    01544     inline FbxObject* GetPrevious()
    01545     {
    01546         mIndex--;
    01547         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetDstObject(FbxCriteria::ObjectType(mClassId), mIndex) : NULL;
    01548     }
    01549
    01556     inline FbxObject* GetSafePrevious()
    01557     {
    01558         mSize = mProperty.GetDstObjectCount(FbxCriteria::ObjectType(mClassId));
    01559         while (mIndex>mSize) mIndex--;
    01560         return GetPrevious();
    01561     }
    01562
    01563 protected:
    01567     inline void ResetToBegin()
    01568     {
    01569         mSize = mProperty.GetDstObjectCount(FbxCriteria::ObjectType(mClassId));
    01570         mIndex = -1;
    01571     }
    01572
    01576     inline void ResetToEnd()
    01577     {
    01578         mSize = mProperty.GetDstObjectCount(FbxCriteria::ObjectType(mClassId));
    01579         mIndex = mSize;
    01580     }
    01581 };
    01582
    01588 template<class Type> class FbxIteratorDst : protected FbxIteratorDstBase
    01589 {
    01590 public:
    01595     inline FbxIteratorDst(FbxObject* pObject) : FbxIteratorDstBase(pObject,Type::ClassId) {}
    01596
    01601     inline FbxIteratorDst(FbxProperty& pProperty) : FbxIteratorDstBase(pProperty,Type::ClassId) {}
    01602
    01607     inline Type* GetFirst()         { return (Type*)FbxIteratorDstBase::GetFirst(); }
    01608
    01613     inline Type* GetNext()          { return (Type*)FbxIteratorDstBase::GetNext(); }
    01614
    01620     inline Type* GetSafeNext()      { return (Type*)FbxIteratorDstBase::GetSafeNext(); }
    01621
    01626     inline Type* GetLast()          { return (Type*)FbxIteratorDstBase::GetLast(); }
    01627
    01632     inline Type* GetPrevious()      { return (Type*)FbxIteratorDstBase::GetPrevious(); }
    01633
    01640     inline Type* GetSafePrevious()  { return (Type*)FbxIteratorDstBase::GetSafePrevious(); }
    01641 };
    01642
    01650 #define FBX_TYPE(class) ((const class*)0)
    01651
    01658 template <class T> inline T* FbxCast(FbxObject* pObject)
    01659 {
    01660     return pObject && pObject->Is<T>() ? (T*)pObject : 0;
    01661 }
    01662
    01669 template <class T> inline const T* FbxCast(const FbxObject* pObject)
    01670 {
    01671     return pObject && pObject->Is<T>() ? (const T*)pObject : 0;
    01672 }
    01673
    01675 #define FbxForEach(Iterator, Object) for((Object)=(Iterator).GetFirst();(Object)!=0;(Object)=(Iterator).GetNext())
    01676
    01678 #define FbxForEachReverse(Iterator, Object) for(Object=(Iterator).GetLast();(Object)!=0;Object=(Iterator).GetPrevious())
    01679
    01680 /*****************************************************************************************************************************
    01681 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    01682 *****************************************************************************************************************************/
    01683 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01684
    01685 //All these functions have been retired, please use their equivalent as stated in the documentation.
    01686 FBX_DEPRECATED inline bool FbxConnectSrc(FbxObject* pDstObject, FbxObject* pSrcObject){ return (pSrcObject && pDstObject) ? pDstObject->ConnectSrcObject(pSrcObject) : 0; }
    01687 FBX_DEPRECATED inline bool FbxConnectDst(FbxObject* pSrcObject, FbxObject* pDstObject){ return (pSrcObject && pDstObject) ? pSrcObject->ConnectDstObject(pDstObject) : 0; }
    01688 template <class T> FBX_DEPRECATED inline int FbxGetSrcCount(const FbxObject* pObject){ return pObject ? pObject->GetSrcObjectCount(T::ClassId) : 0; }
    01689 template <class T> FBX_DEPRECATED inline int FbxGetSrcCount(const FbxObject* pObject, FbxClassId pClassId){ return pObject ? pObject->GetSrcObjectCount(pClassId) : 0; }
    01690 template <class T> FBX_DEPRECATED inline T* FbxGetSrc(const FbxObject* pObject, int pIndex=0){ return pObject ? (T *) pObject->GetSrcObject(T::ClassId,pIndex) : 0; }
    01691 template <class T> FBX_DEPRECATED inline T* FbxGetSrc(const FbxObject* pObject, int pIndex, FbxClassId pClassId){ return pObject ? (T *) pObject->GetSrcObject(pClassId,pIndex) : 0; }
    01692 template <class T> FBX_DEPRECATED inline T* FbxFindSrc(const FbxObject* pObject, const char* pName, int pIndex=0){ return pObject ? (T *) pObject->FindSrcObject(T::ClassId,pName,pIndex) : 0; }
    01693 template <class T> FBX_DEPRECATED inline T* FbxFindSrc(const FbxObject* pObject, const char* pName, FbxClassId pClassId, int pIndex=0){ return pObject ? (T *) pObject->FindSrcObject(pClassId, pName, pIndex) : 0; }
    01694 template <class T> FBX_DEPRECATED inline bool FbxDisconnectAllSrc(FbxObject *pObject){ return pObject->DisconnectAllSrcObject(T::ClassId); }
    01695 template <class T> FBX_DEPRECATED inline int FbxGetDstCount(const FbxObject* pObject){ return pObject ? pObject->GetDstObjectCount(T::ClassId) : 0; }
    01696 template <class T> FBX_DEPRECATED inline int FbxGetDstCount(const FbxObject* pObject, FbxClassId pClassId){ return pObject ? pObject->GetDstObjectCount(pClassId) : 0; }
    01697 template <class T> FBX_DEPRECATED inline T* FbxGetDst(const FbxObject* pObject, int pIndex=0){ return pObject ? (T *) pObject->GetDstObject(T::ClassId,pIndex) : 0; }
    01698 template <class T> FBX_DEPRECATED inline T* FbxGetDst(const FbxObject* pObject, int pIndex, FbxClassId pClassId){ return pObject ? (T *) pObject->GetDstObject(pClassId,pIndex) : 0; }
    01699 template <class T> FBX_DEPRECATED inline T* FbxFindDst(const FbxObject* pObject, const char* pName, int pIndex=0){ return pObject ? (T *) pObject->FindDstObject(T::ClassId,pName,pIndex) : 0; }
    01700 template <class T> FBX_DEPRECATED inline T* FbxFindDst(const FbxObject* pObject, const char* pName, FbxClassId pClassId, int pIndex=0){ return pObject ? (T *) pObject->FindDstObject(pClassId, pName, pIndex) : 0; }
    01701 template <class T> FBX_DEPRECATED inline bool FbxDisconnectAllDst(const FbxObject* pObject){ return pObject->DisconnectAllDstObject(T::ClassId); }
    01702
    01703 class FBXSDK_DLL FbxConnectEvent
    01704 {
    01705 public:
    01706     enum EType
    01707     {
    01708         eConnectRequest,
    01709         eConnect,
    01710         eConnected,
    01711         eDisconnectRequest,
    01712         eDisconnect,
    01713         eDisconnected
    01714     };
    01715
    01716     enum EDirection
    01717     {
    01718         eSource,
    01719         eDestination
    01720     };
    01721
    01722     inline FbxConnectEvent(EType pType,EDirection pDir,FbxProperty *pSrc,FbxProperty *pDst) :
    01723         mType(pType),
    01724         mDirection(pDir),
    01725         mSrc(pSrc),
    01726         mDst(pDst)
    01727     {
    01728     }
    01729     inline EType GetType() const { return mType; }
    01730     inline EDirection GetDirection() const { return mDirection; }
    01731     inline FbxProperty& GetSrc() const { return *mSrc;  }
    01732     inline FbxProperty& GetDst() const { return *mDst;  }
    01733     template <class T> inline T* GetSrcIfObject() const { return mSrc->IsRoot() ? FbxCast<T>(mSrc->GetFbxObject()) : (T*)0; }
    01734     template <class T> inline T* GetDstIfObject() const { return mDst->IsRoot() ? FbxCast<T>(mDst->GetFbxObject()) : (T*)0; }
    01735
    01736 private:
    01737     EType           mType;
    01738     EDirection      mDirection;
    01739     FbxProperty*    mSrc;
    01740     FbxProperty*    mDst;
    01741 };
    01742
    01743 class FbxObjectPropertyChanged : public FbxEvent<FbxObjectPropertyChanged>
    01744 {
    01745     FBXSDK_EVENT_DECLARE(FbxObjectPropertyChanged);
    01746
    01747 public:
    01748     FbxObjectPropertyChanged(FbxProperty pProp) : mProp(pProp) {}
    01749     FbxProperty mProp;
    01750 };
    01751 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    01752
    01753 #include <fbxsdk/fbxsdk_nsend.h>
    01754
    01755 #endif /* _FBXSDK_CORE_OBJECT_H_ */