- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxproperty.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_PROPERTY_H_
    00014 #define _FBXSDK_CORE_PROPERTY_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/fbxquery.h>
    00019 #include <fbxsdk/core/fbxpropertydef.h>
    00020 #include <fbxsdk/core/fbxpropertytypes.h>
    00021 #include <fbxsdk/core/fbxdatatypes.h>
    00022 #include <fbxsdk/core/base/fbxmap.h>
    00023 #include <fbxsdk/core/base/fbxset.h>
    00024
    00025 #include <fbxsdk/fbxsdk_nsbegin.h>
    00026
    00027 class FbxObject;
    00028 class FbxAnimLayer;
    00029 class FbxAnimCurveNode;
    00030 class FbxAnimCurve;
    00031
    00035 class FBXSDK_DLL FbxProperty
    00036 {
    00037 public:
    00050         static FbxProperty Create(const FbxProperty& pCompoundProperty, const FbxDataType& pDataType, const char* pName, const char* pLabel="", bool pCheckForDup=true, bool* pWasFound=NULL);
    00051
    00060         static FbxProperty Create(FbxObject* pObject, const FbxDataType& pDataType, const char* pName, const char* pLabel="", bool pCheckForDup=true, bool* pWasFound=NULL);
    00061
    00068         static FbxProperty CreateFrom(const FbxProperty& pCompoundProperty, FbxProperty& pFromProperty, bool pCheckForDup=true);
    00069
    00076         static FbxProperty CreateFrom(FbxObject* pObject, FbxProperty& pFromProperty, bool pCheckForDup=true);
    00077
    00080         void Destroy();
    00081
    00085         void DestroyRecursively();
    00086
    00090         void DestroyChildren();
    00091
    00094         FbxProperty();
    00095
    00099         FbxProperty(const FbxProperty& pProperty);
    00100
    00104         FbxProperty(const FbxPropertyHandle& pPropertyHandle);
    00105
    00108         ~FbxProperty();
    00110
    00118         FbxDataType GetPropertyDataType() const;
    00119
    00123         FbxString GetName() const;
    00124
    00128         const char* GetNameAsCStr() const;
    00129
    00133         FbxString GetHierarchicalName() const;
    00134
    00144         FbxString GetLabel(bool pReturnNameIfEmpty=true) const;
    00145
    00146
    00150         void SetLabel(const FbxString& pLabel);
    00151
    00155         FbxObject* GetFbxObject() const;
    00157
    00165         void SetUserTag(int pTag);
    00166
    00168         int GetUserTag();
    00169
    00173         void SetUserDataPtr(void* pUserData);
    00174
    00178         void* GetUserDataPtr();
    00180
    00189         void ModifyFlag(FbxPropertyAttr::EFlags pFlag, bool pValue);
    00190
    00195         bool GetFlag(FbxPropertyAttr::EFlags pFlag) const;
    00196
    00200         FbxPropertyAttr::EFlags GetFlags() const;
    00201
    00206         FbxPropertyAttr::EInheritType GetFlagInheritType( FbxPropertyAttr::EFlags pFlag ) const;
    00207
    00213         bool SetFlagInheritType( FbxPropertyAttr::EFlags pFlag, FbxPropertyAttr::EInheritType pType );
    00214
    00219         bool ModifiedFlag( FbxPropertyAttr::EFlags pFlag ) const;
    00221
    00230         FbxProperty& operator= (const FbxProperty& pProperty);
    00231
    00236         bool operator== (const FbxProperty& pProperty) const;
    00237
    00242         bool operator!= (const FbxProperty& pProperty) const;
    00243
    00248         inline bool operator== (int pValue) const { return (pValue == 0) ? !IsValid() : IsValid(); }
    00249
    00254         inline bool operator!= (int pValue) const { return (pValue != 0) ? !IsValid() : IsValid(); }
    00255
    00260         bool CompareValue(const FbxProperty& pProperty) const;
    00262
    00267     bool CopyValue(const FbxProperty& pProperty);
    00268
    00277         template <class T> inline T Get() const { T lValue; Get(&lValue, FbxTypeOf(lValue)); return lValue; }
    00278
    00283         template <class T> inline bool Set(const T& pValue){ return Set(&pValue, FbxTypeOf(pValue)); }
    00284
    00288         bool IsValid() const;
    00289
    00298         static bool HasDefaultValue(FbxProperty& pProperty);
    00299
    00305         FbxPropertyAttr::EInheritType GetValueInheritType() const;
    00306
    00317         bool SetValueInheritType( FbxPropertyAttr::EInheritType pType );
    00318
    00326         bool Modified() const;
    00328
    00344         void SetMinLimit(double pMin);
    00345
    00350         bool HasMinLimit() const;
    00351
    00355         double GetMinLimit() const;
    00356
    00361         bool HasMaxLimit() const;
    00362
    00366         void SetMaxLimit(double pMax);
    00367
    00371         double GetMaxLimit() const;
    00372
    00377         void SetLimits(double pMin, double pMax);
    00379
    00390         int AddEnumValue(const char* pStringValue);
    00391
    00399         void InsertEnumValue(int pIndex, const char* pStringValue);
    00400
    00405         int GetEnumCount() const;
    00406
    00415         void SetEnumValue(int pIndex, const char* pStringValue);
    00416
    00421         void RemoveEnumValue(int pIndex);
    00422
    00427         const char* GetEnumValue(int pIndex) const;
    00429
    00437         inline bool IsRoot() const { return mPropertyHandle.IsRoot(); }
    00438
    00443         inline bool IsChildOf(const FbxProperty& pParent) const { return mPropertyHandle.IsChildOf(pParent.mPropertyHandle); }
    00444
    00449         inline bool IsDescendentOf(const FbxProperty& pAncestor) const { return mPropertyHandle.IsDescendentOf(pAncestor.mPropertyHandle); }
    00450
    00454         inline FbxProperty GetParent() const { return FbxProperty(mPropertyHandle.GetParent());  }
    00455
    00460         bool SetParent(const FbxProperty& pOther);
    00461
    00465         inline FbxProperty GetChild() const { return FbxProperty(mPropertyHandle.GetChild());   }
    00466
    00470         inline FbxProperty GetSibling() const { return FbxProperty(mPropertyHandle.GetSibling()); }
    00471
    00475         inline FbxProperty GetFirstDescendent() const { return FbxProperty(mPropertyHandle.GetFirstDescendent());   }
    00476
    00481         inline FbxProperty GetNextDescendent(const FbxProperty& pProperty) const { return FbxProperty(mPropertyHandle.GetNextDescendent(pProperty.mPropertyHandle)); }
    00482
    00489         inline FbxProperty Find (const char* pName, bool pCaseSensitive = true) const { return FbxProperty(mPropertyHandle.Find(pName,pCaseSensitive));  }
    00490
    00498         inline FbxProperty Find (const char* pName, const FbxDataType& pDataType, bool pCaseSensitive = true) const { return FbxProperty(mPropertyHandle.Find(pName,pDataType.GetTypeInfoHandle(),pCaseSensitive));  }
    00499
    00506         inline FbxProperty FindHierarchical (const char* pName, bool pCaseSensitive = true) const { return FbxProperty(mPropertyHandle.Find(pName,sHierarchicalSeparator,pCaseSensitive));  }
    00507
    00515         inline FbxProperty FindHierarchical (const char* pName, const FbxDataType& pDataType, bool pCaseSensitive = true) const { return FbxProperty(mPropertyHandle.Find(pName,sHierarchicalSeparator,pDataType.GetTypeInfoHandle(),pCaseSensitive));  }
    00517
    00522
    00523         inline void BeginCreateOrFindProperty(){ mPropertyHandle.BeginCreateOrFindProperty(); }
    00524
    00526         inline void EndCreateOrFindProperty(){ mPropertyHandle.EndCreateOrFindProperty(); }
    00527
    00529         class FbxPropertyNameCache
    00530         {
    00531         public:
    00535             FbxPropertyNameCache(const FbxProperty& prop) : mProp(const_cast<FbxProperty&>(prop)){ mProp.BeginCreateOrFindProperty(); }
    00536
    00538             ~FbxPropertyNameCache(){ mProp.EndCreateOrFindProperty(); }
    00539
    00540         private:
    00541             FbxProperty& mProp;
    00542             FbxPropertyNameCache& operator=(const FbxPropertyNameCache& pOther){ mProp = pOther.mProp; mProp.BeginCreateOrFindProperty(); return *this; }
    00543         };
    00545
    00554         bool    SetArraySize( int pSize, bool pVariableArray );
    00555
    00557         int     GetArraySize() const;
    00558
    00563         FbxProperty GetArrayItem(int pIndex) const;
    00564
    00569         inline FbxProperty operator[](int pIndex) const { return GetArrayItem(pIndex); }
    00571
    00584         FbxAnimCurveNode* CreateCurveNode(FbxAnimLayer* pAnimLayer);
    00585
    00594         FbxAnimCurveNode* GetCurveNode(FbxAnimLayer* pAnimLayer, bool pCreateAsNeeded=false);
    00595
    00601         FbxAnimCurveNode* GetCurveNode(bool pCreateAsNeeded=false, const char* pAnimStackName = NULL);
    00602
    00616         inline FbxAnimCurve* GetCurve(FbxAnimLayer* pAnimLayer, bool pCreateAsNeeded=false)
    00617         {
    00618             return GetCurve(pAnimLayer, GetName(), NULL, pCreateAsNeeded);
    00619         }
    00620
    00636         inline FbxAnimCurve* GetCurve(FbxAnimLayer* pAnimLayer, const char* pChannel, bool pCreateAsNeeded=false)
    00637         {
    00638             return GetCurve(pAnimLayer, GetName(), pChannel, pCreateAsNeeded);
    00639         }
    00640
    00658         FbxAnimCurve* GetCurve(FbxAnimLayer* pAnimLayer, const char* pName, const char* pChannel, bool pCreateAsNeeded);
    00660
    00670         bool ConnectSrcObject(FbxObject* pObject, FbxConnection::EType pType=FbxConnection::eNone);
    00671
    00676         bool IsConnectedSrcObject(const FbxObject* pObject) const;
    00677
    00682         bool DisconnectSrcObject(FbxObject* pObject);
    00683
    00687         bool DisconnectAllSrcObject();
    00688
    00693         bool DisconnectAllSrcObject(const FbxCriteria& pCriteria);
    00694
    00699         FBX_DEPRECATED bool DisconnectAllSrcObject(const FbxClassId& pClassId);
    00700
    00704         int  GetSrcObjectCount() const;
    00705
    00710         int GetSrcObjectCount(const FbxCriteria& pCriteria) const;
    00711
    00716         FBX_DEPRECATED int GetSrcObjectCount(const FbxClassId& pClassId) const;
    00717
    00722         FbxObject* GetSrcObject(const int pIndex=0) const;
    00723
    00729         FbxObject* GetSrcObject(const FbxCriteria& pCriteria, const int pIndex=0) const;
    00730
    00736         FBX_DEPRECATED FbxObject* GetSrcObject(const FbxClassId& pClassId, const int pIndex=0) const;
    00737
    00743         FbxObject* FindSrcObject(const char* pName, const int pStartIndex=0) const;
    00744
    00751         FbxObject* FindSrcObject(const FbxCriteria& pCriteria, const char* pName, const int pStartIndex=0) const;
    00752
    00759         FBX_DEPRECATED FbxObject* FindSrcObject(const FbxClassId& pClassId, const char* pName, const int pStartIndex=0) const;
    00760
    00765         template <class T> FBX_DEPRECATED inline bool DisconnectAllSrcObject (const T*){ return DisconnectAllSrcObject(T::ClassId);}
    00766
    00769         template <class T> inline bool DisconnectAllSrcObject(){ return DisconnectAllSrcObject(FbxCriteria::ObjectType(T::ClassId)); }
    00770
    00776         template <class T> FBX_DEPRECATED inline bool DisconnectAllSrcObject (const T*, const FbxCriteria& pCriteria)  { return DisconnectAllSrcObject(T::ClassId,pCriteria);  }
    00777
    00781         template <class T> inline bool DisconnectAllSrcObject(const FbxCriteria& pCriteria){ return DisconnectAllSrcObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    00782
    00787         template <class T> FBX_DEPRECATED inline int  GetSrcObjectCount(const T*) const{ return GetSrcObjectCount(T::ClassId); }
    00788
    00791         template <class T> inline int GetSrcObjectCount() const { return GetSrcObjectCount(FbxCriteria::ObjectType(T::ClassId)); }
    00792
    00798         template <class T> FBX_DEPRECATED inline int GetSrcObjectCount(const T*, const FbxCriteria& pCriteria) const { return GetSrcObjectCount(T::ClassId,pCriteria); }
    00799
    00803         template <class T> inline int GetSrcObjectCount(const FbxCriteria& pCriteria) const { return GetSrcObjectCount(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    00804
    00810         template <class T> FBX_DEPRECATED inline T* GetSrcObject(const T*, int pIndex=0) const { return (T*)GetSrcObject(T::ClassId,pIndex); }
    00811
    00815         template <class T> inline T* GetSrcObject(const int pIndex=0) const { return (T*)GetSrcObject(FbxCriteria::ObjectType(T::ClassId), pIndex); }
    00816
    00823         template <class T> FBX_DEPRECATED inline T* GetSrcObject(const T*, const FbxCriteria& pCriteria,int pIndex=0) const { return (T*)GetSrcObject(T::ClassId,pCriteria,pIndex); }
    00824
    00829         template <class T> inline T* GetSrcObject(const FbxCriteria& pCriteria, const int pIndex=0) const { return (T*)GetSrcObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pIndex); }
    00830
    00837         template <class T> FBX_DEPRECATED inline T* FindSrcObject(const T*, const char* pName, int pStartIndex=0) const { return (T*)FindSrcObject(T::ClassId,pName,pStartIndex); }
    00838
    00843         template <class T> inline T* FindSrcObject(const char* pName, const int pStartIndex=0) const { return (T*)FindSrcObject(FbxCriteria::ObjectType(T::ClassId), pName, pStartIndex); }
    00844
    00852         template <class T> FBX_DEPRECATED inline T* FindSrcObject(const T*, const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return (T*)FindSrcObject(T::ClassId,pCriteria,pName,pStartIndex); }
    00853
    00859         template <class T> inline T* FindSrcObject(const FbxCriteria& pCriteria, const char* pName, const int pStartIndex=0) const { return (T*)FindSrcObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pName, pStartIndex); }
    00860
    00866         bool ConnectDstObject(FbxObject* pObject, FbxConnection::EType pType=FbxConnection::eNone);
    00867
    00872         bool IsConnectedDstObject(const FbxObject* pObject) const;
    00873
    00878         bool DisconnectDstObject(FbxObject* pObject);
    00879
    00883         bool DisconnectAllDstObject();
    00884
    00889         bool DisconnectAllDstObject(const FbxCriteria& pCriteria);
    00890
    00895         FBX_DEPRECATED bool DisconnectAllDstObject(const FbxClassId& pClassId);
    00896
    00900         int GetDstObjectCount() const;
    00901
    00906         int GetDstObjectCount(const FbxCriteria& pCriteria) const;
    00907
    00912         FBX_DEPRECATED int GetDstObjectCount(const FbxClassId& pClassId) const;
    00913
    00918         FbxObject* GetDstObject(const int pIndex=0) const;
    00919
    00925         FbxObject* GetDstObject(const FbxCriteria& pCriteria, const int pIndex=0) const;
    00926
    00932         FBX_DEPRECATED FbxObject* GetDstObject(const FbxClassId& pClassId, const int pIndex=0) const;
    00933
    00939         FbxObject* FindDstObject(const char* pName, const int pStartIndex=0) const;
    00940
    00947         FbxObject* FindDstObject(const FbxCriteria& pCriteria, const char* pName, const int pStartIndex=0) const;
    00948
    00955         FBX_DEPRECATED FbxObject* FindDstObject(const FbxClassId& pClassId, const char* pName, const int pStartIndex=0) const;
    00956
    00961         template <class T> FBX_DEPRECATED inline bool DisconnectAllDstObject (const T*){ return DisconnectAllDstObject(T::ClassId);    }
    00962
    00965         template <class T> inline bool DisconnectAllDstObject(){ return DisconnectAllDstObject(FbxCriteria::ObjectType(T::ClassId)); }
    00966
    00972         template <class T> FBX_DEPRECATED inline bool DisconnectAllDstObject (const T*, const FbxCriteria& pCriteria)  { return DisconnectAllDstObject(T::ClassId,pCriteria);  }
    00973
    00977         template <class T> inline bool DisconnectAllDstObject(const FbxCriteria& pCriteria){ return DisconnectAllDstObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    00978
    00983         template <class T> FBX_DEPRECATED inline int GetDstObjectCount(const T*) const { return GetDstObjectCount(T::ClassId); }
    00984
    00987         template <class T> inline int GetDstObjectCount() const { return GetDstObjectCount(FbxCriteria::ObjectType(T::ClassId)); }
    00988
    00994         template <class T> FBX_DEPRECATED inline int  GetDstObjectCount(const T*, const FbxCriteria& pCriteria) const { return GetDstObjectCount(T::ClassId,pCriteria); }
    00995
    00999         template <class T> inline int GetDstObjectCount(const FbxCriteria& pCriteria) const { return GetDstObjectCount(FbxCriteria::ObjectType(T::ClassId) && pCriteria); }
    01000
    01006         template <class T> FBX_DEPRECATED inline T* GetDstObject(const T*, int pIndex=0) const { return (T*)GetDstObject(T::ClassId,pIndex); }
    01007
    01011         template <class T> inline T* GetDstObject(const int pIndex=0) const { return (T*)GetDstObject(FbxCriteria::ObjectType(T::ClassId), pIndex); }
    01012
    01019         template <class T> FBX_DEPRECATED inline T* GetDstObject(const T*, const FbxCriteria& pCriteria, int pIndex=0) const { return (T*)GetDstObject(T::ClassId,pCriteria,pIndex); }
    01020
    01025         template <class T> inline T* GetDstObject(const FbxCriteria& pCriteria, const int pIndex=0) const { return (T*)GetDstObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pIndex); }
    01026
    01033         template <class T> FBX_DEPRECATED inline T* FindDstObject(const T*, const char* pName, int pStartIndex=0) const { return (T*)FindDstObject(T::ClassId,pName,pStartIndex); }
    01034
    01039         template <class T> inline T* FindDstObject(const char* pName, const int pStartIndex=0) const { return (T*)FindDstObject(FbxCriteria::ObjectType(T::ClassId), pName, pStartIndex); }
    01040
    01048         template <class T> FBX_DEPRECATED inline T* FindDstObject(const T*, const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const { return (T*)FindDstObject(T::ClassId,pCriteria,pName,pStartIndex); }
    01049
    01055         template <class T> inline T* FindDstObject(const FbxCriteria& pCriteria, const char* pName, const int pStartIndex=0) const { return (T*)FindDstObject(FbxCriteria::ObjectType(T::ClassId) && pCriteria, pName, pStartIndex); }
    01057
    01062         // Properties
    01067         bool ConnectSrcProperty(const FbxProperty& pProperty);
    01068
    01073         bool IsConnectedSrcProperty(const FbxProperty& pProperty);
    01074
    01079         bool DisconnectSrcProperty(const FbxProperty& pProperty);
    01080
    01084         int GetSrcPropertyCount() const;
    01085
    01090         bool ConnectDstProperty(const FbxProperty&  pProperty);
    01091
    01096         bool IsConnectedDstProperty(const FbxProperty& pProperty);
    01097
    01102         bool DisconnectDstProperty(const FbxProperty& pProperty);
    01103
    01107         int GetDstPropertyCount() const;
    01108
    01110         void ClearConnectCache();
    01111
    01116         FbxProperty GetSrcProperty(const int pIndex=0) const;
    01117
    01123         FbxProperty FindSrcProperty(const char* pName, const int pStartIndex=0) const;
    01124
    01129         FbxProperty GetDstProperty(const int pIndex=0) const;
    01130
    01136         FbxProperty FindDstProperty(const char* pName, const int pStartIndex=0) const;
    01138
    01140     static const char* sHierarchicalSeparator;
    01141
    01142 /*****************************************************************************************************************************
    01143 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    01144 *****************************************************************************************************************************/
    01145 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01146 protected:
    01147     FbxProperty(FbxObject* pObject, char const* pName, const FbxDataType& pDataType=FbxDataType(), const char* pLabel="");
    01148     FbxProperty(const FbxProperty& pParent, const char* pName, const FbxDataType& pDataType, const char* pLabel);
    01149
    01150     bool Set(const void* pValue, const EFbxType& pValueType, bool pCheckForValueEquality=true);
    01151     bool Get(void* pValue, const EFbxType& pValueType) const;
    01152
    01153     bool NotifySetRequest();
    01154     bool NotifySet();
    01155     bool NotifyGet() const;
    01156
    01157 private:
    01158     inline void*    Get() const { FBX_ASSERT_NOW("Cannot get property value as void!"); return NULL; }
    01159     inline bool     Set(const void* &){ FBX_ASSERT_NOW("Cannot set property value as void!"); return false; }
    01160
    01161     bool            ConnectSrc(const FbxProperty& pProperty, FbxConnection::EType pType=FbxConnection::eNone);
    01162     bool            DisconnectSrc(const FbxProperty& pProperty);
    01163     bool            DisconnectAllSrc();
    01164     bool            DisconnectAllSrc(const FbxCriteria& pCriteria);
    01165     bool            IsConnectedSrc(const FbxProperty& pProperty) const;
    01166     int             GetSrcCount() const;
    01167     int             GetSrcCount(const FbxCriteria& pCriteria) const;
    01168     FbxProperty     GetSrc(int pIndex=0) const;
    01169     FbxProperty     GetSrc(const FbxCriteria& pCriteria, int pIndex=0) const;
    01170     FbxProperty     FindSrc(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const;
    01171
    01172     bool            ConnectDst(const FbxProperty& pProperty, FbxConnection::EType pType=FbxConnection::eNone);
    01173     bool            DisconnectDst(const FbxProperty& pProperty);
    01174     bool            DisconnectAllDst();
    01175     bool            DisconnectAllDst(const FbxCriteria& pCriteria);
    01176     bool            IsConnectedDst(const FbxProperty& pProperty) const;
    01177     int             GetDstCount() const;
    01178     int             GetDstCount(const FbxCriteria& pCriteria) const;
    01179     FbxProperty     GetDst(int pIndex=0) const;
    01180     FbxProperty     GetDst(const FbxCriteria& pCriteria, int pIndex=0) const;
    01181     FbxProperty     FindDst(const FbxCriteria& pCriteria, const char* pName, int pStartIndex=0) const;
    01182
    01183     mutable FbxPropertyHandle mPropertyHandle;
    01184
    01185     friend class FbxObject;
    01186     friend class FbxIOSettings;
    01187     friend class FbxBindingOperator;
    01188     friend class FbxAnimEvalClassic;
    01189     friend void FbxMarkObject(FbxObject* pObject, FbxMap<FbxObject*, int>& pObjectDstDisconnectCount, FbxSet2<FbxObject*>& pObjectsToDeleted, FbxArray<FbxObject*>& pObjectToDeletedInSequence);
    01190     friend void FbxCleanUpConnectionsAtDestructionBoundary(FbxScene* pObject, FbxArray<FbxObject*>& pObjectToDeletedInSequence);
    01191 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    01192 };
    01193
    01197 template <class T> class FbxPropertyT : public FbxProperty
    01198 {
    01199 public:
    01211         FbxProperty& StaticInit(FbxObject* pObject, const char* pName, const T& pValue, bool pForceSet, FbxPropertyAttr::EFlags pFlags=FbxPropertyAttr::eNone)
    01212         {
    01213             return StaticInit(pObject, pName, FbxGetDataTypeFromEnum(FbxTypeOf(*((T*)0))), pValue, pForceSet, pFlags);
    01214         }
    01215
    01224         FbxProperty& StaticInit(FbxObject* pObject, const char* pName, const FbxDataType& pDataType, const T& pValue, bool pForceSet, FbxPropertyAttr::EFlags pFlags=FbxPropertyAttr::eNone)
    01225         {
    01226             bool lWasFound = false;
    01227             *this = Create(pObject, pDataType, pName, "", true, &lWasFound);
    01228             if( pForceSet || !lWasFound )
    01229             {
    01230                 ModifyFlag(pFlags, true);   // modify the flags before we set the value
    01231                 FbxProperty::Set(&pValue, FbxTypeOf(pValue), false);
    01232             }
    01233             ModifyFlag(FbxPropertyAttr::eStatic, true);
    01234             return *this;
    01235         }
    01236
    01245         FbxProperty& StaticInit(FbxProperty pCompound, const char* pName, const FbxDataType& pDataType, const T& pValue, bool pForceSet=true, FbxPropertyAttr::EFlags pFlags=FbxPropertyAttr::eNone)
    01246         {
    01247             bool lWasFound = false;
    01248             *this = Create(pCompound, pDataType, pName, "", true, &lWasFound);
    01249             if( pForceSet || !lWasFound )
    01250             {
    01251                 ModifyFlag(pFlags, true);   // modify the flags before we set the value
    01252                 FbxProperty::Set(&pValue, FbxTypeOf(pValue), false);
    01253             }
    01254             ModifyFlag(FbxPropertyAttr::eStatic, true);
    01255             return *this;
    01256         }
    01258
    01267         FbxPropertyT& Set(const T& pValue){ FbxProperty::Set(&pValue, FbxTypeOf(pValue)); return *this; }
    01268
    01272         T Get() const { T lValue; FbxProperty::Get(&lValue, FbxTypeOf(lValue)); return lValue; }
    01273
    01278         FbxPropertyT& operator=(const T& pValue){ return Set(pValue); }
    01279
    01283         operator T() const { return Get(); }
    01285
    01286 /*****************************************************************************************************************************
    01287 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    01288 *****************************************************************************************************************************/
    01289 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01290     FbxPropertyT() : FbxProperty(){}
    01291     FbxPropertyT(const FbxProperty& pProperty) : FbxProperty(pProperty){}
    01292     ~FbxPropertyT(){}
    01293 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    01294 };
    01295
    01296 /*****************************************************************************************************************************
    01297 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    01298 *****************************************************************************************************************************/
    01299 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01300 template <> class FbxPropertyT<FbxReference> : public FbxProperty
    01301 {
    01302 public:
    01303     FbxPropertyT() : FbxProperty(){}
    01304     FbxPropertyT(const FbxProperty& pProperty) : FbxProperty(pProperty){}
    01305     ~FbxPropertyT(){}
    01306
    01307     const FbxProperty& StaticInit(FbxObject* pObject, const char* pName, const FbxReference& pValue, bool pForceSet, FbxPropertyAttr::EFlags pFlags=FbxPropertyAttr::eNone)
    01308     {
    01309         return StaticInit(pObject, pName, FbxGetDataTypeFromEnum(FbxTypeOf(*((FbxReference*)0))), pValue, pForceSet, pFlags);
    01310     }
    01311
    01312     const FbxProperty& StaticInit(FbxObject* pObject, const char* pName, const FbxDataType& pDataType, const FbxReference& pValue, bool pForceSet, FbxPropertyAttr::EFlags pFlags=FbxPropertyAttr::eNone)
    01313     {
    01314         bool lWasFound = false;
    01315         *this = Create(pObject, pDataType, pName, "", true, &lWasFound);
    01316         if( pForceSet || !lWasFound )
    01317         {
    01318             ModifyFlag(pFlags, true);   // modify the flags before we set the value
    01319             Set(pValue);            // since we will trigger callbacks in there!
    01320         }
    01321         ModifyFlag(FbxPropertyAttr::eStatic, true);
    01322         return *this;
    01323     }
    01324
    01325     FbxReference Get() const
    01326     {
    01327         FbxProperty::NotifyGet();
    01328         return GetSrcObject();
    01329     }
    01330
    01331     FbxPropertyT& Set(const FbxReference& pValue)
    01332     {
    01333         bool Result = FbxProperty::NotifySetRequest();
    01334         if( Result )
    01335         {
    01336             DisconnectAllSrcObject();
    01337             ConnectSrcObject(pValue);
    01338             FbxProperty::NotifySet();
    01339         }
    01340         return *this;
    01341     }
    01342
    01343     operator FbxReference() const
    01344     {
    01345         return Get();
    01346     }
    01347
    01348     FbxPropertyT& operator=(const FbxReference& pValue)
    01349     {
    01350         return Set(pValue);
    01351     }
    01352 };
    01353 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    01354
    01355 #include <fbxsdk/fbxsdk_nsend.h>
    01356
    01357 #endif /* _FBXSDK_CORE_PROPERTY_H_ */