- Main Page
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# fbxobject.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2012 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/fbxplug.h>
    00019 #include <fbxsdk/core/fbxproperty.h>
    00020 #include <fbxsdk/core/fbxstream.h>
    00021
    00022 #include <fbxsdk/core/base/fbxstringlist.h>
    00023
    00024 #include <fbxsdk/fbxsdk_nsbegin.h>
    00025
    00026 class FbxDocument;
    00027 class FbxImplementation;
    00028 class FbxImplementationFilter;
    00029 class FbxLibrary;
    00030 class FbxMessage;
    00031 class FbxPeripheral;
    00032 class FbxUserDataRecord;
    00033
    00035 #define FBXSDK_OBJECT_DECLARE(Class, Parent)                                    \
    00036     FBXSDK_PLUG_DECLARE(Class)      /* this also set public */                  \
    00037     typedef Parent ParentClass;                                                 \
    00038     static Class* Create(FbxObject* pContainer, const char* pName);             \
    00039     virtual ~Class(){};                                                         \
    00040 private:                                                                        \
    00041     Class(const Class&);                                                        \
    00042     Class& operator=(const Class&);                                             \
    00043
    00044
    00045 #define FBXSDK_ABSTRACT_OBJECT_DECLARE(Class, Parent)                           \
    00046     FBXSDK_ABSTRACT_PLUG_DECLARE(Class) /* this also set public */              \
    00047     typedef Parent ParentClass;                                                 \
    00048 private:                                                                        \
    00049     Class(const Class&);                                                        \
    00050     Class& operator=(const Class&);                                             \
    00051
    00052
    00053 #define FBXSDK_OBJECT_IMPLEMENT(Class)                                          \
    00054     FBXSDK_PLUG_IMPLEMENT(Class)                                                \
    00055     Class* Class::Create(FbxObject* pContainer, const char* pName)              \
    00056     {                                                                           \
    00057         if( !pContainer ) return NULL;                                          \
    00058         FbxManager* Manager = pContainer->GetFbxManager();                      \
    00059         FBX_ASSERT(Manager);                                                    \
    00060         Class* ClassPtr = 0;                                                    \
    00061         ClassPtr = (Class*)Manager->CreateNewObjectFromClassId(Class::ClassId,  \
    00062             pName, pContainer);                                                 \
    00063         return ClassPtr;                                                        \
    00064     }                                                                           \
    00065
    00066
    00067 #define FBXSDK_ABSTRACT_OBJECT_IMPLEMENT(Class)                                 \
    00068     FBXSDK_ABSTRACT_PLUG_IMPLEMENT(Class)                                       \
    00069
    00070 class FbxObject_internal;
    00071
    00134 class FBXSDK_DLL FbxObject : public FbxPlug
    00135 {
    00136     FBXSDK_OBJECT_DECLARE(FbxObject, FbxPlug);
    00137
    00138 public:
    00145         enum ECloneType
    00146         {
    00147             eDeepClone,
    00148             eReferenceClone
    00149         };
    00150
    00159         virtual FbxObject* Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject* pContainer=NULL) const;
    00160
    00164         bool IsAReferenceTo() const;
    00165
    00169         FbxObject* GetReferenceTo() const;
    00170
    00174         bool IsReferencedBy() const;
    00175
    00179         int GetReferencedByCount() const;
    00180
    00185         FbxObject* GetReferencedBy(int pIndex) const;
    00187
    00195         void SetName(const char* pName);
    00196
    00200         const char* GetName() const;
    00201
    00205         FbxString GetNameWithoutNameSpacePrefix() const;
    00206
    00210         FbxString GetNameWithNameSpacePrefix() const;
    00211
    00215         void SetInitialName(const char* pName);
    00216
    00220         const char* GetInitialName() const;
    00221
    00225         FbxString GetNameSpaceOnly();
    00226
    00230         void SetNameSpace(FbxString pNameSpace);
    00231
    00236         FbxArray<FbxString*> GetNameSpaceArray(char identifier);
    00237
    00241         FbxString GetNameOnly() const;
    00242
    00246         FbxString GetNameSpacePrefix() const;
    00247
    00252         static FbxString RemovePrefix(char* pName);
    00253
    00258         static FbxString StripPrefix(FbxString& lName);
    00259
    00264         static FbxString StripPrefix(const char* pName);
    00265
    00267         const FbxUInt64& GetUniqueID() const;
    00269
    00286         int ContentUnload();
    00287
    00294         int ContentLoad();
    00295
    00301         bool ContentIsLoaded() const;
    00302
    00306         void ContentDecrementLockCount();
    00307
    00311         void ContentIncrementLockCount();
    00312
    00319         bool ContentIsLocked() const;
    00321
    00333         virtual bool ContentWriteTo(FbxStream& pStream) const;
    00334
    00340         virtual bool ContentReadFrom(const FbxStream& pStream);
    00342
    00350         virtual bool GetSelected();
    00351
    00355         virtual void SetSelected(bool pSelected);
    00357
    00365         inline FbxProperty GetFirstProperty() const
    00366         {
    00367             return RootProperty.GetFirstDescendent();
    00368         }
    00369
    00374         inline FbxProperty GetNextProperty(const FbxProperty& pProperty) const
    00375         {
    00376             return RootProperty.GetNextDescendent(pProperty);
    00377         }
    00378
    00384         inline FbxProperty FindProperty(const char* pName, bool pCaseSensitive = true) const
    00385         {
    00386             return RootProperty.Find(pName, pCaseSensitive );
    00387         }
    00388
    00395         inline FbxProperty FindProperty(const char* pName, const FbxDataType& pDataType, bool pCaseSensitive = true) const
    00396         {
    00397             return RootProperty.Find(pName, pDataType, pCaseSensitive );
    00398         }
    00399
    00406         inline FbxProperty FindPropertyHierarchical(const char* pName, bool pCaseSensitive = true) const
    00407         {
    00408             return RootProperty.FindHierarchical(pName, pCaseSensitive );
    00409         }
    00410
    00418         inline FbxProperty FindPropertyHierarchical(const char* pName, const FbxDataType& pDataType, bool pCaseSensitive = true) const
    00419         {
    00420             return RootProperty.FindHierarchical(pName, pDataType, pCaseSensitive );
    00421         }
    00422
    00426         inline FbxProperty& GetRootProperty() { return RootProperty; }
    00427
    00431         inline const FbxProperty& GetRootProperty() const { return RootProperty; }
    00432
    00437         FbxProperty GetClassRootProperty();
    00439
    00449         inline bool ConnectSrcObject(FbxObject* pObject, FbxConnection::EType pType=FbxConnection::eNone) { return RootProperty.ConnectSrcObject(pObject,pType); }
    00450
    00455         inline bool IsConnectedSrcObject(const FbxObject* pObject) const { return RootProperty.IsConnectedSrcObject(pObject); }
    00456
    00461         inline bool DisconnectSrcObject(FbxObject* pObject){ return RootProperty.DisconnectSrcObject(pObject); }
    00462
    00466         inline bool DisconnectAllSrcObject() { return RootProperty.DisconnectAllSrcObject(); }
    00467
    00472         inline bool DisconnectAllSrcObject(const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllSrcObject(pCriteria); }
    00473
    00478         inline bool DisconnectAllSrcObject(FbxClassId pClassId) { return RootProperty.DisconnectAllSrcObject(pClassId); }
    00479
    00485         inline bool DisconnectAllSrcObject(FbxClassId pClassId, const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllSrcObject(pClassId,pCriteria); }
    00486
    00490         inline int GetSrcObjectCount() const { return RootProperty.GetSrcObjectCount(); }
    00491
    00496         inline int GetSrcObjectCount(const FbxCriteria& pCriteria) const { return RootProperty.GetSrcObjectCount(pCriteria); }
    00497
    00502         inline int GetSrcObjectCount(FbxClassId pClassId) const { return RootProperty.GetSrcObjectCount(pClassId); }
    00503
    00509         inline int GetSrcObjectCount(FbxClassId pClassId, const FbxCriteria& pCriteria) const { return RootProperty.GetSrcObjectCount(pClassId,pCriteria); }
    00510
    00515         inline FbxObject* GetSrcObject(int pIndex=0) const { return RootProperty.GetSrcObject(pIndex); }
    00516
    00522         inline FbxObject* GetSrcObject(const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetSrcObject(pCriteria,pIndex); }
    00523
    00529         inline FbxObject* GetSrcObject(FbxClassId pClassId, int pIndex=0) const { return RootProperty.GetSrcObject(pClassId,pIndex); }
    00530
    00537         inline FbxObject* GetSrcObject(FbxClassId pClassId, const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetSrcObject(pClassId,pCriteria,pIndex); }
    00538
    00544         inline FbxObject* FindSrcObject(const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pName,pStartIndex); }
    00545
    00552         inline FbxObject* FindSrcObject(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pCriteria,pName,pStartIndex); }
    00553
    00560         inline FbxObject* FindSrcObject(FbxClassId pClassId, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pClassId,pName,pStartIndex); }
    00561
    00569         inline FbxObject* FindSrcObject(FbxClassId pClassId, const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pClassId,pCriteria,pName,pStartIndex); }
    00570
    00575         template <class T> inline bool DisconnectAllSrcObject(const T* pFBX_TYPE) { return RootProperty.DisconnectAllSrcObject(pFBX_TYPE); }
    00576
    00582         template <class T> inline bool DisconnectAllSrcObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllSrcObject(pFBX_TYPE,pCriteria); }
    00583
    00588         template <class T> inline int GetSrcObjectCount(const T* pFBX_TYPE) const { return RootProperty.GetSrcObjectCount(pFBX_TYPE); }
    00589
    00595         template <class T> inline int GetSrcObjectCount(const T* pFBX_TYPE, const FbxCriteria& pCriteria) const { return RootProperty.GetSrcObjectCount(pFBX_TYPE,pCriteria); }
    00596
    00602         template <class T> inline T* GetSrcObject(const T* pFBX_TYPE, int pIndex=0) const { return RootProperty.GetSrcObject(pFBX_TYPE,pIndex); }
    00603
    00610         template <class T> inline T* GetSrcObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetSrcObject(pFBX_TYPE,pCriteria,pIndex); }
    00611
    00618         template <class T> inline T* FindSrcObject(const T* pFBX_TYPE, const char* pName, int pStartIndex=0) const { return RootProperty.FindSrcObject(pFBX_TYPE,pName,pStartIndex); }
    00619
    00627         template <class T> 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); }
    00628
    00634         inline bool ConnectDstObject(FbxObject* pObject, FbxConnection::EType pType=FbxConnection::eNone) { return RootProperty.ConnectDstObject(pObject,pType); }
    00635
    00640         inline bool IsConnectedDstObject(const FbxObject* pObject) const { return RootProperty.IsConnectedDstObject(pObject); }
    00641
    00646         inline bool DisconnectDstObject(FbxObject* pObject) { return RootProperty.DisconnectDstObject(pObject); }
    00647
    00651         inline bool DisconnectAllDstObject() { return RootProperty.DisconnectAllDstObject(); }
    00652
    00657         inline bool DisconnectAllDstObject(const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllDstObject(pCriteria); }
    00658
    00663         inline bool DisconnectAllDstObject(FbxClassId pClassId) { return RootProperty.DisconnectAllDstObject(pClassId); }
    00664
    00670         inline bool DisconnectAllDstObject(FbxClassId pClassId, const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllDstObject(pClassId,pCriteria); }
    00671
    00675         inline int GetDstObjectCount() const { return RootProperty.GetDstObjectCount(); }
    00676
    00681         inline int GetDstObjectCount(const FbxCriteria& pCriteria) const { return RootProperty.GetDstObjectCount(pCriteria); }
    00682
    00687         inline int GetDstObjectCount(FbxClassId pClassId) const { return RootProperty.GetDstObjectCount(pClassId); }
    00688
    00694         inline int GetDstObjectCount(FbxClassId pClassId, const FbxCriteria& pCriteria) const { return RootProperty.GetDstObjectCount(pClassId,pCriteria); }
    00695
    00700         inline FbxObject* GetDstObject(int pIndex=0) const { return RootProperty.GetDstObject(pIndex); }
    00701
    00707         inline FbxObject* GetDstObject(const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetDstObject(pCriteria,pIndex); }
    00708
    00714         inline FbxObject* GetDstObject(FbxClassId pClassId, int pIndex=0) const { return RootProperty.GetDstObject(pClassId,pIndex); }
    00715
    00722         inline FbxObject* GetDstObject(FbxClassId pClassId, const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetDstObject(pClassId,pCriteria,pIndex); }
    00723
    00729         inline FbxObject* FindDstObject(const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pName,pStartIndex); }
    00730
    00737         inline FbxObject* FindDstObject(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pCriteria,pName,pStartIndex); }
    00738
    00745         inline FbxObject* FindDstObject(FbxClassId pClassId, const char* pName,int pStartIndex=0) const { return RootProperty.FindDstObject(pClassId,pName,pStartIndex); }
    00746
    00754         inline FbxObject* FindDstObject(FbxClassId pClassId, const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pClassId,pCriteria,pName,pStartIndex); }
    00755
    00760         template <class T> inline bool DisconnectAllDstObject(const T* pFBX_TYPE) { return RootProperty.DisconnectAllDstObject(pFBX_TYPE); }
    00761
    00767         template <class T> inline bool DisconnectAllDstObject(const T* pFBX_TYPE, const FbxCriteria& pCriteria) { return RootProperty.DisconnectAllDstObject(pFBX_TYPE,pCriteria); }
    00768
    00773         template <class T> inline int GetDstObjectCount(const T* pFBX_TYPE) const { return RootProperty.GetDstObjectCount(pFBX_TYPE); }
    00774
    00780         template <class T> inline int GetDstObjectCount(const T* pFBX_TYPE, const FbxCriteria& pCriteria) const { return RootProperty.GetDstObjectCount(pFBX_TYPE,pCriteria); }
    00781
    00787         template <class T> inline T* GetDstObject(const T* pFBX_TYPE, int pIndex=0) const { return RootProperty.GetDstObject(pFBX_TYPE,pIndex); }
    00788
    00795         template <class T> inline T* GetDstObject(const T * pFBX_TYPE, const FbxCriteria& pCriteria, int pIndex=0) const { return RootProperty.GetDstObject(pFBX_TYPE,pCriteria,pIndex); }
    00796
    00803         template <class T> inline T* FindDstObject(const T* pFBX_TYPE, const char* pName, int pStartIndex=0) const { return RootProperty.FindDstObject(pFBX_TYPE,pName,pStartIndex); }
    00804
    00812         template <class T> 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); }
    00814
    00823         inline bool ConnectSrcProperty(const FbxProperty& pProperty) { return RootProperty.ConnectSrcProperty(pProperty); }
    00824
    00829         inline bool IsConnectedSrcProperty(const FbxProperty& pProperty) { return RootProperty.IsConnectedSrcProperty(pProperty); }
    00830
    00835         inline bool DisconnectSrcProperty(const FbxProperty& pProperty) { return RootProperty.DisconnectSrcProperty(pProperty); }
    00836
    00840         inline int GetSrcPropertyCount() const { return RootProperty.GetSrcPropertyCount(); }
    00841
    00846         inline FbxProperty GetSrcProperty(int pIndex=0) const { return RootProperty.GetSrcProperty(pIndex); }
    00847
    00853         inline FbxProperty FindSrcProperty(const char* pName,int pStartIndex=0) const { return RootProperty.FindSrcProperty(pName,pStartIndex); }
    00854
    00859         inline bool ConnectDstProperty(const FbxProperty& pProperty) { return RootProperty.ConnectDstProperty(pProperty); }
    00860
    00865         inline bool IsConnectedDstProperty(const FbxProperty& pProperty) { return RootProperty.IsConnectedDstProperty(pProperty); }
    00866
    00871         inline bool DisconnectDstProperty(const FbxProperty& pProperty) { return RootProperty.DisconnectDstProperty(pProperty); }
    00872
    00876         inline int GetDstPropertyCount() const { return RootProperty.GetDstPropertyCount(); }
    00877
    00882         inline FbxProperty GetDstProperty(int pIndex=0) const { return RootProperty.GetDstProperty(pIndex); }
    00883
    00889         inline FbxProperty FindDstProperty(const char* pName, int pStartIndex=0) const { return RootProperty.FindDstProperty(pName,pStartIndex); }
    00891
    00902         void SetUserDataPtr(const FbxUInt64& pUserID, void* pUserData);
    00903
    00908         void* GetUserDataPtr(const FbxUInt64& pUserID) const;
    00909
    00915         inline void SetUserDataPtr(void* pUserData){ SetUserDataPtr(GetUniqueID(), pUserData); }
    00916
    00920         inline void* GetUserDataPtr() const { return GetUserDataPtr(GetUniqueID()); }
    00922
    00931         FbxDocument* GetDocument() const;
    00932
    00939         FbxDocument* GetRootDocument() const;
    00940
    00945         FbxScene* GetScene() const;
    00947
    00956         void EmitMessage(FbxMessage* pMessage) const;
    00958
    00969         virtual const char* Localize(const char* pID, const char* pDefault=NULL) const;
    00971
    00979         FbxLibrary* GetParentLibrary() const;
    00980
    00986         bool AddImplementation(FbxImplementation* pImplementation);
    00987
    00993         bool RemoveImplementation(FbxImplementation* pImplementation);
    00994
    00998         bool HasDefaultImplementation(void) const;
    00999
    01003         FbxImplementation* GetDefaultImplementation(void) const;
    01004
    01011         bool SetDefaultImplementation(FbxImplementation* pImplementation);
    01012
    01017         int GetImplementationCount(const FbxImplementationFilter* pCriteria=NULL) const;
    01018
    01024         FbxImplementation* GetImplementation(int pIndex, const FbxImplementationFilter* pCriteria=NULL) const;
    01026
    01035         virtual FbxString GetUrl() const;
    01036
    01042         virtual bool SetUrl(char* pUrl);
    01044
    01050     virtual FbxObject& Copy(const FbxObject& pObject);
    01051
    01053     FbxProperty RootProperty;
    01054
    01055 protected:
    01060     virtual void ContentClear();
    01061
    01066     virtual FbxPeripheral* GetPeripheral();
    01067
    01069 //
    01070 //  WARNING!
    01071 //
    01072 //  Anything beyond these lines may not be documented accurately and is
    01073 //  subject to change without notice.
    01074 //
    01076 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01077 public:
    01078     virtual bool        Compare(FbxObject* pOtherObject);
    01079
    01080     virtual FbxManager* GetFbxManager() const;
    01081     virtual FbxClassId  GetRuntimeClassId() const;
    01082
    01083     enum EObjectFlag
    01084     {
    01085         eNone =                 0x00000000, //No flags
    01086         eSystem =               0x00000001, //System objects are destroyed only when manager is deleted
    01087         eSavable =              0x00000002, //Savable objects are persisted in files, true by default
    01088         eSelected =             0x00000004, //Selected flag, false by default
    01089         eHidden =               0x00000008, //Hidden flag, false by default
    01090         eContentLoaded =        0x00100000,
    01091         eUserRuntimeFirst =     0x10000000,
    01092         eAllRuntimeFlagsMask =  0xfff00000
    01093     };
    01094
    01095     void SetObjectFlags(EObjectFlag pFlags, bool pValue);
    01096     bool GetObjectFlags(EObjectFlag pFlags) const;
    01097
    01098     void    SetAllObjectFlags(FbxUInt pFlags);  //All flags at once
    01099     FbxUInt GetAllObjectFlags() const;          //All flags at once
    01100
    01101     //Basic comparison operator implementation. It simply compare property values between source and target.
    01102     //NOTE: If a property cannot be found on one of the object, the comparison fails (return false).
    01103     //Different classid will fail comparison as well as different property count. Reference properties are not compared.
    01104     bool    operator==(FbxObject const& pObject);
    01105     bool    operator!=(FbxObject const& pObject);
    01106
    01107     //Important note: If this function is not implemented, the pFileSubTypeName string used when registering your
    01108     //class via FbxManager::RegisterFbxClass will be used instead. This makes it useless to re-implement this
    01109     //function if you do not intend to return a different string for the same class.
    01110     virtual const char* GetTypeName() const;
    01111
    01112     virtual FbxStringList   GetTypeFlags() const;
    01113
    01114     virtual void                SetDocument(FbxDocument* pDocument);
    01115     inline FbxPropertyHandle&   GetPropertyHandle() { return RootProperty.mPropertyHandle; }
    01116
    01117     // This function will go as deep as possible to clear the Connection list without sending
    01118     // notifications to the connections to give them the chance to Disconnect themselves.
    01119     // This is a bypass of the intended workflow and should be used with care.
    01120     void WipeAllConnections();
    01121
    01122 protected:
    01123     FbxObject(FbxManager& pManager, const char* pName);
    01124
    01125     // Constructs the object. Each subclass should call the base
    01126     // FbxObject::Construct first. Note that property initialization
    01127     // should be done in the ConstructProperties() method, not this one.
    01128     // pFrom - The object this object should be cloned from. NULL to
    01129     // construct an independent object.
    01130     virtual void            Construct(const FbxObject* pFrom);
    01131
    01132     // Initialize the FbxProperty member variables of this class.
    01133     // Each subclass should call its parent, and initialize its properties
    01134     // in this method.
    01135     // pForceSet - Forces the property values to be set to default values.
    01136     virtual bool            ConstructProperties(bool pForceSet);
    01137     virtual void            Destruct(bool pRecursive, bool pDependents);
    01138
    01139     bool                    Copyable(const FbxObject& pObject);
    01140
    01141     virtual bool            SetRuntimeClassId(FbxClassId pClassId);
    01142     virtual bool            ConnecNotify(const FbxConnectEvent& pEvent);
    01143
    01144     // property callbacks
    01145     enum EPropertyNotifyType
    01146     {
    01147         ePropertySetRequest,
    01148         ePropertySet,
    01149         ePropertyGet
    01150     };
    01151
    01152     virtual bool PropertyNotify(EPropertyNotifyType pType, FbxProperty* pProperty);
    01153
    01154 private:
    01155     void    CopyPropertiesFrom(const FbxObject& pFrom);
    01156     void    SetClassRootProperty(FbxProperty& lProperty);
    01157     int     GetFlatPropertyCount() const;
    01158
    01159     FbxObject_internal* mData;
    01160
    01161     // friend classes for SDK access
    01162     friend class FbxScene;
    01163     friend class FbxProperty;
    01164 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01165 };
    01166
    01167 inline bool FbxConnectSrc(FbxObject* pDstObject, FbxObject* pSrcObject)   { return (pSrcObject && pDstObject) ? pDstObject->ConnectSrcObject(pSrcObject) : 0; }
    01168 inline bool FbxConnectDst(FbxObject* pSrcObject, FbxObject* pDstObject)   { return (pSrcObject && pDstObject) ? pSrcObject->ConnectDstObject(pDstObject) : 0; }
    01169
    01170 // template access functions SRC
    01171 template < class T > inline int FbxGetSrcCount(const FbxObject* pObject)                                                      { return pObject ? pObject->GetSrcObjectCount(T::ClassId) : 0; }
    01172 template < class T > inline int FbxGetSrcCount(const FbxObject* pObject, FbxClassId pClassId)                                { return pObject ? pObject->GetSrcObjectCount(pClassId) : 0;     }
    01173 template < class T > inline T* FbxGetSrc(const FbxObject* pObject, int pIndex=0)                                              { return pObject ? (T *) pObject->GetSrcObject(T::ClassId,pIndex) : 0; }
    01174 template < class T > inline T* FbxGetSrc(const FbxObject* pObject, int pIndex, FbxClassId pClassId)                          { return pObject ? (T *) pObject->GetSrcObject(pClassId,pIndex) : 0;    }
    01175 template < class T > inline T* FbxFindSrc(const FbxObject* pObject, const char* pName, int pIndex=0)                          { return pObject ? (T *) pObject->FindSrcObject(T::ClassId,pName,pIndex) : 0;   }
    01176 template < class T > inline T* FbxFindSrc(const FbxObject* pObject, const char* pName, FbxClassId pClassId, int pIndex=0)    { return pObject ? (T *) pObject->FindSrcObject(pClassId,pName,pIndex) : 0; }
    01177
    01178 template < class T > inline bool FbxDisconnectAllSrc(FbxObject *pObject)                                                      { return pObject->DisconnectAllSrcObject(T::ClassId);   }
    01179
    01180 // template access functions DST
    01181 template < class T > inline int FbxGetDstCount(const FbxObject* pObject)                                                      { return pObject ? pObject->GetDstObjectCount(T::ClassId) : 0; }
    01182 template < class T > inline int FbxGetDstCount(const FbxObject* pObject, FbxClassId pClassId)                                { return pObject ? pObject->GetDstObjectCount(pClassId) : 0;     }
    01183 template < class T > inline T* FbxGetDst(const FbxObject* pObject, int pIndex=0)                                              { return pObject ? (T *) pObject->GetDstObject(T::ClassId,pIndex) : 0; }
    01184 template < class T > inline T* FbxGetDst(const FbxObject* pObject, int pIndex, FbxClassId pClassId)                          { return pObject ? (T *) pObject->GetDstObject(pClassId,pIndex) : 0;    }
    01185 template < class T > inline T* FbxFindDst(const FbxObject* pObject, const char* pName, int pIndex=0)                          { return pObject ? (T *) pObject->FindDstObject(T::ClassId,pName,pIndex) : 0;   }
    01186 template < class T > inline T* FbxFindDst(const FbxObject* pObject, const char* pName, FbxClassId pClassId, int pIndex=0)    { return pObject ? (T *) pObject->FindDstObject(pClassId,pName,pIndex) : 0; }
    01187
    01188 template < class T > inline bool FbxDisconnectAllDst(const FbxObject* pObject)                                                { return pObject->DisconnectAllDstObject(T::ClassId);   }
    01189
    01190
    01191 /**********************************************************************
    01192 * Object Iterator
    01193 **********************************************************************/
    01194
    01198 template<typename FbxProperty> class FbxIterator
    01199 {
    01200     public:
    01204         FbxIterator(const FbxObject* pObject) : mObject(pObject) {}
    01205
    01209         inline const FbxProperty& GetFirst() { mProperty = mObject->GetFirstProperty(); return mProperty; }
    01210
    01214         inline const FbxProperty& GetNext() { mProperty = mObject->GetNextProperty(mProperty); return mProperty; }
    01215
    01216     private:
    01217         FbxProperty        mProperty;
    01218         const FbxObject*   mObject;
    01219 };
    01220
    01224 class FbxIteratorSrcBase
    01225 {
    01226 protected:
    01228     FbxProperty    mProperty;
    01230     FbxClassId     mClassId;
    01232     int             mSize;
    01234     int             mIndex;
    01235 public:
    01241     inline FbxIteratorSrcBase(FbxProperty& pProperty,FbxClassId pClassId) :
    01242         mProperty(pProperty),
    01243         mClassId(pClassId),
    01244         mSize(0),
    01245         mIndex(-1)
    01246     {
    01247         ResetToBegin();
    01248     }
    01249
    01255     inline FbxIteratorSrcBase(FbxObject* pObject,FbxClassId pClassId) :
    01256         mProperty(pObject->RootProperty),
    01257         mClassId(pClassId),
    01258         mSize(0),
    01259         mIndex(-1)
    01260     {
    01261         ResetToBegin();
    01262     }
    01263
    01268     inline FbxObject* GetFirst()
    01269     {
    01270         ResetToBegin();
    01271         return GetNext();
    01272     }
    01273
    01278     inline FbxObject* GetNext()
    01279     {
    01280         mIndex++;
    01281         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetSrcObject(mClassId,mIndex) : NULL;
    01282     }
    01283
    01289     inline FbxObject* GetSafeNext()
    01290     {
    01291         mSize = mProperty.GetSrcObjectCount(mClassId);
    01292         return GetNext();
    01293     }
    01294
    01299     inline FbxObject* GetLast()
    01300     {
    01301         ResetToEnd();
    01302         return GetPrevious();
    01303     }
    01304
    01309     inline FbxObject* GetPrevious()
    01310     {
    01311         mIndex--;
    01312         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetSrcObject(mClassId,mIndex) : NULL;
    01313     }
    01314
    01321     inline FbxObject* GetSafePrevious()
    01322     {
    01323         mSize = mProperty.GetSrcObjectCount(mClassId);
    01324         while (mIndex>mSize) mIndex--;
    01325         return GetPrevious();
    01326     }
    01327
    01328
    01329 // Internal Access Function
    01330 protected:
    01334     inline void ResetToBegin()
    01335     {
    01336         mSize = mProperty.GetSrcObjectCount(mClassId);
    01337         mIndex = -1;
    01338     }
    01339
    01343     inline void ResetToEnd()
    01344     {
    01345         mSize = mProperty.GetSrcObjectCount(mClassId);
    01346         mIndex = mSize;
    01347     }
    01348 };
    01349
    01355 template<class Type> class FbxIteratorSrc : protected FbxIteratorSrcBase
    01356 {
    01357 public:
    01362     inline FbxIteratorSrc(FbxObject* pObject) : FbxIteratorSrcBase(pObject,Type::ClassId) {}
    01363
    01368     inline FbxIteratorSrc(FbxProperty& pProperty) : FbxIteratorSrcBase(pProperty,Type::ClassId) {}
    01369
    01374     inline Type* GetFirst()         { return (Type*)FbxIteratorSrcBase::GetFirst(); }
    01375
    01380     inline Type* GetNext()          { return (Type*)FbxIteratorSrcBase::GetNext(); }
    01381
    01387     inline Type* GetSafeNext()      { return (Type*)FbxIteratorSrcBase::GetSafeNext(); }
    01388
    01393     inline Type* GetLast()          { return (Type*)FbxIteratorSrcBase::GetLast(); }
    01394
    01395
    01400     inline Type* GetPrevious()      { return (Type*)FbxIteratorSrcBase::GetPrevious(); }
    01401
    01408     inline Type* GetSafePrevious()  { return (Type*)FbxIteratorSrcBase::GetSafePrevious(); }
    01409
    01410 // Internal Access Function
    01411 protected:
    01412 };
    01413
    01417 class FbxIteratorDstBase
    01418 {
    01419 protected:
    01421     FbxProperty    mProperty;
    01423     FbxClassId     mClassId;
    01425     int             mSize;
    01427     int             mIndex;
    01428 public:
    01434     inline FbxIteratorDstBase(FbxProperty& pProperty,FbxClassId pClassId) :
    01435         mProperty(pProperty),
    01436         mClassId(pClassId),
    01437         mSize(0),
    01438         mIndex(-1)
    01439     {
    01440         ResetToBegin();
    01441     }
    01442
    01448     inline FbxIteratorDstBase(FbxObject* pObject,FbxClassId pClassId) :
    01449         mProperty(pObject->RootProperty),
    01450         mClassId(pClassId),
    01451         mSize(0),
    01452         mIndex(-1)
    01453     {
    01454         ResetToBegin();
    01455     }
    01456
    01461     inline FbxObject* GetFirst()
    01462     {
    01463         ResetToBegin();
    01464         return GetNext();
    01465     }
    01466
    01471     inline FbxObject* GetNext()
    01472     {
    01473         mIndex++;
    01474         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetDstObject(mClassId,mIndex) : NULL;
    01475     }
    01476
    01482     inline FbxObject* GetSafeNext()
    01483     {
    01484         mSize = mProperty.GetDstObjectCount(mClassId);
    01485         return GetNext();
    01486     }
    01487
    01492     inline FbxObject* GetLast()
    01493     {
    01494         ResetToEnd();
    01495         return GetPrevious();
    01496     }
    01497
    01502     inline FbxObject* GetPrevious()
    01503     {
    01504         mIndex--;
    01505         return ((mIndex>=0) && (mIndex<mSize)) ? mProperty.GetDstObject(mClassId,mIndex) : NULL;
    01506     }
    01507
    01514     inline FbxObject* GetSafePrevious()
    01515     {
    01516         mSize = mProperty.GetDstObjectCount(mClassId);
    01517         while (mIndex>mSize) mIndex--;
    01518         return GetPrevious();
    01519     }
    01520
    01521
    01522 // Internal Access Function
    01523 protected:
    01527     inline void ResetToBegin()
    01528     {
    01529         mSize = mProperty.GetDstObjectCount(mClassId);
    01530         mIndex = -1;
    01531     }
    01532
    01536     inline void ResetToEnd()
    01537     {
    01538         mSize = mProperty.GetDstObjectCount(mClassId);
    01539         mIndex = mSize;
    01540     }
    01541 };
    01542
    01548 template<class Type> class FbxIteratorDst : protected FbxIteratorDstBase
    01549 {
    01550 public:
    01555     inline FbxIteratorDst(FbxObject* pObject) : FbxIteratorDstBase(pObject,Type::ClassId) {}
    01556
    01561     inline FbxIteratorDst(FbxProperty& pProperty) : FbxIteratorDstBase(pProperty,Type::ClassId) {}
    01562
    01567     inline Type* GetFirst()         { return (Type*)FbxIteratorDstBase::GetFirst(); }
    01568
    01573     inline Type* GetNext()          { return (Type*)FbxIteratorDstBase::GetNext(); }
    01574
    01580     inline Type* GetSafeNext()      { return (Type*)FbxIteratorDstBase::GetSafeNext(); }
    01581
    01586     inline Type* GetLast()          { return (Type*)FbxIteratorDstBase::GetLast(); }
    01587
    01592     inline Type* GetPrevious()      { return (Type*)FbxIteratorDstBase::GetPrevious(); }
    01593
    01600     inline Type* GetSafePrevious()  { return (Type*)FbxIteratorDstBase::GetSafePrevious(); }
    01601 };
    01602
    01604 #define FbxForEach(Iterator,Object) for ( (Object)=(Iterator).GetFirst(); (Object)!=0; (Object)=(Iterator).GetNext() )
    01605
    01607 #define FbxForEachReverse(Iterator,Object) for ( Object=(Iterator).GetLast(); (Object)!=0;  Object=(Iterator).GetPrevious() )
    01608
    01610 //
    01611 //  WARNING!
    01612 //
    01613 //  Anything beyond these lines may not be documented accurately and is
    01614 //  subject to change without notice.
    01615 //
    01617 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01618 class FbxObjectPropertyChanged : public FbxEvent<FbxObjectPropertyChanged>
    01619 {
    01620     FBXSDK_EVENT_DECLARE(FbxObjectPropertyChanged);
    01621
    01622 public:
    01623     FbxObjectPropertyChanged(FbxProperty pProp) : mProp(pProp) {}
    01624     FbxProperty mProp;
    01625 };
    01626 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    01627
    01628 #include <fbxsdk/fbxsdk_nsend.h>
    01629
    01630 #endif /* _FBXSDK_CORE_OBJECT_H_ */