00001
00003 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXPROPERTY_H
00004 #define FBXFILESDK_KFBXPLUGINS_KFBXPROPERTY_H
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #include <fbxfilesdk/fbxfilesdk_def.h>
00041
00042 #include <fbxfilesdk/kfbxplugins/kfbxplug.h>
00043 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00044
00045
00046 #include <fbxfilesdk/components/kfcurve/kfcurvenode.h>
00047 #include <fbxfilesdk/kfbxplugins/kfbxdatatypes.h>
00048 #include <fbxfilesdk/fbxcore/kfbxpropertydef.h>
00049 #include <fbxfilesdk/components/kbaselib/klib/kmap.h>
00050
00051
00052 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00053
00054
00055 class KFbxObject;
00056 class KFbxColor;
00057 class KFbxCriteria;
00058 class KFbxAnimLayer;
00059 class KFbxAnimCurveNode;
00060 class KFbxAnimCurve;
00061
00065 class KFBX_DLL KFbxProperty : private FbxPropertyFlags
00066 {
00071 public:
00072 using FbxPropertyFlags::eFbxPropertyFlags;
00073 using FbxPropertyFlags::eNO_FLAG;
00074 using FbxPropertyFlags::eANIMATABLE;
00075 using FbxPropertyFlags::eUSER;
00076 using FbxPropertyFlags::eTEMPORARY;
00077 using FbxPropertyFlags::ePUBLISHED;
00078 using FbxPropertyFlags::ePSTATIC;
00079
00080 using FbxPropertyFlags::eNOT_SAVABLE;
00081 using FbxPropertyFlags::eHIDDEN;
00082
00083 using FbxPropertyFlags::eUI_DISABLED;
00084 using FbxPropertyFlags::eUI_GROUP;
00085 using FbxPropertyFlags::eUI_BOOLGROUP;
00086 using FbxPropertyFlags::eUI_EXPANDED;
00087 using FbxPropertyFlags::eUI_NOCAPTION;
00088 using FbxPropertyFlags::eUI_PANEL;
00089 using FbxPropertyFlags::eUI_HIDDEN;
00090
00091 typedef FbxPropertyFlags::eFbxPropertyFlags EFlags;
00092
00101 static KFbxProperty Create(KFbxProperty const &pCompoundProperty, KFbxDataType const &pDataType, char const* pName, char const* pLabel="", bool pCheckForDup=true, bool* pWasFound=NULL);
00102
00111 static KFbxProperty Create(KFbxObject* pObject, KFbxDataType const &pDataType, char const* pName, char const* pLabel="", bool pCheckForDup=true, bool* pWasFound=NULL);
00112
00119 static KFbxProperty CreateFrom(KFbxProperty const& pCompoundProperty, KFbxProperty& pFromProperty, bool pCheckForDup=true);
00120
00127 static KFbxProperty CreateFrom(KFbxObject* pObject, KFbxProperty& pFromProperty, bool pCheckForDup=true);
00128
00131 void Destroy();
00132
00136 void DestroyRecursively();
00137
00141 void DestroyChildren();
00142
00145 KFbxProperty();
00146
00150 KFbxProperty(KFbxProperty const &pProperty);
00151
00155 KFbxProperty(KFbxPropertyHandle const &pPropertyHandle);
00156
00159 ~KFbxProperty();
00160
00161 public:
00163
00168 public:
00172 KFbxDataType GetPropertyDataType() const;
00173
00177 KString GetName() const;
00178
00182 KString GetHierarchicalName() const;
00183
00193 KString GetLabel(bool pReturnNameIfEmpty=true) const;
00194
00195
00199 void SetLabel(const KString & pLabel);
00200
00204 KFbxObject* GetFbxObject() const;
00205
00207
00215 void SetUserTag(int pTag);
00216
00218 int GetUserTag();
00219
00223 void SetUserDataPtr(void* pUserData);
00224
00228 void* GetUserDataPtr();
00230
00239 void ModifyFlag(eFbxPropertyFlags pFlag, bool pValue);
00240
00245 bool GetFlag(eFbxPropertyFlags pFlag) const;
00246
00251 KFbxInheritType GetFlagInheritType( eFbxPropertyFlags pFlag ) const;
00252
00258 bool SetFlagInheritType( eFbxPropertyFlags pFlag, KFbxInheritType pType );
00259
00264 bool ModifiedFlag( eFbxPropertyFlags pFlag ) const;
00266
00271
00276 KFbxProperty & operator= (KFbxProperty const &pKProperty);
00277
00282 bool operator== (KFbxProperty const &pKProperty) const;
00283
00288 bool operator!= (KFbxProperty const &pKProperty) const;
00289
00294 inline bool operator== (int pValue) const { return pValue==0 ? !IsValid() : IsValid(); }
00295
00300 inline bool operator!= (int pValue) const { return pValue!=0 ? !IsValid() : IsValid(); }
00301
00306 bool CompareValue(KFbxProperty const& pProp) const;
00308
00313 bool CopyValue(KFbxProperty const& pProp);
00314
00319 public:
00320
00324 bool IsValid() const;
00325
00334 static bool HasDefaultValue( KFbxProperty& pProperty );
00335
00342 bool Set(void const *pValue,EFbxType pValueType, bool pCheckForValueEquality);
00343
00349 inline bool Set(void const *pValue,EFbxType pValueType) { return Set( pValue, pValueType, true ); }
00350
00356 bool Get(void *pValue,EFbxType pValueType) const;
00357
00362 template <class T> inline bool Set( T const &pValue ) { return Set( &pValue,FbxTypeOf(pValue), true ); }
00363
00368 template <class T> inline T Get( T const *pFBX_TYPE) const { T lValue; Get( &lValue,FbxTypeOf(lValue) ); return lValue; }
00369
00375 KFbxInheritType GetValueInheritType() const;
00376
00387 bool SetValueInheritType( KFbxInheritType pType );
00388
00396 bool Modified() const;
00397
00399
00412 public:
00416 void SetMinLimit(double pMin);
00417
00422 bool HasMinLimit() const;
00423
00427 double GetMinLimit() const;
00428
00433 bool HasMaxLimit() const;
00434
00438 void SetMaxLimit(double pMax);
00439
00443 double GetMaxLimit() const;
00444
00449 void SetLimits(double pMin, double pMax);
00451
00456 public:
00463 int AddEnumValue(char const *pStringValue);
00464
00472 void InsertEnumValue(int pIndex, char const *pStringValue);
00473
00478 int GetEnumCount() const;
00479
00488 void SetEnumValue(int pIndex, char const *pStringValue);
00489
00494 void RemoveEnumValue(int pIndex);
00495
00500 const char * GetEnumValue(int pIndex) const;
00502
00510 inline bool IsRoot() const { return mPropertyHandle.IsRoot(); }
00511
00516 inline bool IsChildOf(KFbxProperty const & pParent) const { return mPropertyHandle.IsChildOf(pParent.mPropertyHandle); }
00517
00522 inline bool IsDescendentOf(KFbxProperty const & pAncestor) const { return mPropertyHandle.IsDescendentOf(pAncestor.mPropertyHandle); }
00523
00527 inline KFbxProperty GetParent() const { return KFbxProperty(mPropertyHandle.GetParent()); }
00528
00533 bool SetParent( const KFbxProperty& pOther );
00534
00538 inline KFbxProperty GetChild() const { return KFbxProperty(mPropertyHandle.GetChild()); }
00539
00543 inline KFbxProperty GetSibling() const { return KFbxProperty(mPropertyHandle.GetSibling()); }
00544
00548 inline KFbxProperty GetFirstDescendent() const { return KFbxProperty(mPropertyHandle.GetFirstDescendent()); }
00549
00554 inline KFbxProperty GetNextDescendent(KFbxProperty const &pProperty) const { return KFbxProperty(mPropertyHandle.GetNextDescendent(pProperty.mPropertyHandle)); }
00555
00562 inline KFbxProperty Find (char const *pName,bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,pCaseSensitive)); }
00563
00571 inline KFbxProperty Find (char const *pName,KFbxDataType const &pDataType, bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,pDataType.GetTypeInfoHandle(),pCaseSensitive)); }
00572
00579 inline KFbxProperty FindHierarchical (char const *pName,bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,sHierarchicalSeparator,pCaseSensitive)); }
00580
00588 inline KFbxProperty FindHierarchical (char const *pName,KFbxDataType const &pDataType, bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,sHierarchicalSeparator,pDataType.GetTypeInfoHandle(),pCaseSensitive)); }
00589
00591
00596
00597 inline void BeginCreateOrFindProperty() { mPropertyHandle.BeginCreateOrFindProperty(); }
00598
00600 inline void EndCreateOrFindProperty() { mPropertyHandle.EndCreateOrFindProperty(); }
00601
00603 struct KFbxPropertyNameCache
00604 {
00608 KFbxPropertyNameCache(const KFbxProperty& prop) :
00609 mProp(const_cast<KFbxProperty&>(prop))
00610 {
00611 mProp.BeginCreateOrFindProperty();
00612 }
00613
00615 ~KFbxPropertyNameCache()
00616 {
00617 mProp.EndCreateOrFindProperty();
00618 }
00619
00620 private:
00621 KFbxProperty & mProp;
00622
00623 KFbxPropertyNameCache& operator=(const KFbxPropertyNameCache &other) { mProp = other.mProp; mProp.BeginCreateOrFindProperty(); return *this; }
00624 };
00626
00635 bool SetArraySize( int pSize, bool pVariableArray );
00636
00638 int GetArraySize() const;
00639
00644 KFbxProperty GetArrayItem(int pIndex) const;
00645
00650 inline KFbxProperty operator[](int pIndex) const { return GetArrayItem(pIndex); }
00652
00665 KFbxAnimCurveNode* CreateCurveNode(KFbxAnimLayer* pAnimLayer);
00666
00675 KFbxAnimCurveNode* GetCurveNode(KFbxAnimLayer* pAnimLayer, bool pCreateAsNeeded=false);
00676
00682 KFbxAnimCurveNode* GetCurveNode(bool pCreateAsNeeded=false, const char* pAnimStackName = NULL);
00683
00697 template <class T> inline T* GetCurve(KFbxAnimLayer* pAnimLayer, bool pCreateAsNeeded=false)
00698 {
00699 return KFbxCast<T>(GetCurve(pAnimLayer, GetName(), NULL, pCreateAsNeeded));
00700 }
00701
00717 template <class T> inline T* GetCurve(KFbxAnimLayer* pAnimLayer, const char* pChannel, bool pCreateAsNeeded=false)
00718 {
00719 return KFbxCast<T>(GetCurve(pAnimLayer, GetName(), pChannel, pCreateAsNeeded));
00720 }
00721
00739 template <class T> inline T* GetCurve(KFbxAnimLayer* pAnimLayer, const char* pName, const char* pChannel, bool pCreateAsNeeded=false)
00740 {
00741 return KFbxCast<T>(GetCurve(pAnimLayer, pName, pChannel, pCreateAsNeeded));
00742 }
00744
00749 public:
00750
00756 bool ConnectSrcObject (KFbxObject* pObject,kFbxConnectionType pType=eFbxConnectionNone);
00757
00762 bool IsConnectedSrcObject (const KFbxObject* pObject) const;
00763
00768 bool DisconnectSrcObject (KFbxObject* pObject);
00769
00773 bool DisconnectAllSrcObject();
00774
00779 bool DisconnectAllSrcObject(KFbxCriteria const &pCriteria);
00780
00785 bool DisconnectAllSrcObject(const kFbxClassId& pClassId);
00786
00792 bool DisconnectAllSrcObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria);
00793
00797 int GetSrcObjectCount()const;
00798
00803 int GetSrcObjectCount(KFbxCriteria const &pCriteria)const;
00804
00809 int GetSrcObjectCount(const kFbxClassId& pClassId)const;
00810
00816 int GetSrcObjectCount(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria)const;
00817
00822 KFbxObject* GetSrcObject(int pIndex=0) const;
00823
00829 KFbxObject* GetSrcObject(KFbxCriteria const &pCriteria,int pIndex=0) const;
00830
00836 KFbxObject* GetSrcObject(const kFbxClassId& pClassId,int pIndex=0) const;
00837
00844 KFbxObject* GetSrcObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,int pIndex=0) const;
00845
00851 KFbxObject* FindSrcObject(const char *pName,int pStartIndex=0) const;
00852
00859 KFbxObject* FindSrcObject(KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
00860
00867 KFbxObject* FindSrcObject(const kFbxClassId& pClassId,const char *pName,int pStartIndex=0) const;
00868
00876 KFbxObject* FindSrcObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
00877
00882 template < class T > inline bool DisconnectAllSrcObject (T const *pFBX_TYPE){ return DisconnectAllSrcObject(T::ClassId);}
00883
00889 template < class T > inline bool DisconnectAllSrcObject (T const *pFBX_TYPE,KFbxCriteria const &pCriteria) { return DisconnectAllSrcObject(T::ClassId,pCriteria); }
00890
00895 template < class T > inline int GetSrcObjectCount(T const *pFBX_TYPE) const{ return GetSrcObjectCount(T::ClassId); }
00896
00902 template < class T > inline int GetSrcObjectCount(T const *pFBX_TYPE,KFbxCriteria const &pCriteria) const { return GetSrcObjectCount(T::ClassId,pCriteria); }
00903
00909 template < class T > inline T* GetSrcObject(T const *pFBX_TYPE,int pIndex=0) const { return (T*)GetSrcObject(T::ClassId,pIndex); }
00910
00917 template < class T > inline T* GetSrcObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,int pIndex=0) const { return (T*)GetSrcObject(T::ClassId,pCriteria,pIndex); }
00918
00925 template < class T > inline T* FindSrcObject(T const *pFBX_TYPE,const char *pName,int pStartIndex=0) const { return (T*)FindSrcObject(T::ClassId,pName,pStartIndex); }
00926
00934 template < class T > inline T* FindSrcObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const { return (T*)FindSrcObject(T::ClassId,pCriteria,pName,pStartIndex); }
00935
00936
00942 bool ConnectDstObject (KFbxObject* pObject,kFbxConnectionType pType=eFbxConnectionNone);
00943
00948 bool IsConnectedDstObject (const KFbxObject* pObject) const;
00949
00954 bool DisconnectDstObject (KFbxObject* pObject);
00955
00959 bool DisconnectAllDstObject();
00960
00965 bool DisconnectAllDstObject(KFbxCriteria const &pCriteria);
00966
00971 bool DisconnectAllDstObject(const kFbxClassId& pClassId);
00972
00978 bool DisconnectAllDstObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria);
00979
00983 int GetDstObjectCount() const;
00984
00989 int GetDstObjectCount(KFbxCriteria const &pCriteria) const;
00990
00995 int GetDstObjectCount(const kFbxClassId& pClassId) const;
00996
01002 int GetDstObjectCount(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria) const;
01003
01008 KFbxObject* GetDstObject(int pIndex=0) const;
01009
01015 KFbxObject* GetDstObject(KFbxCriteria const &pCriteria,int pIndex=0) const;
01016
01022 KFbxObject* GetDstObject(const kFbxClassId& pClassId,int pIndex=0) const;
01023
01030 KFbxObject* GetDstObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,int pIndex=0)const;
01031
01037 KFbxObject* FindDstObject(const char *pName,int pStartIndex=0) const;
01038
01045 KFbxObject* FindDstObject(KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01046
01053 KFbxObject* FindDstObject(const kFbxClassId& pClassId,const char *pName,int pStartIndex=0) const;
01054
01062 KFbxObject* FindDstObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01063
01068 template < class T > inline bool DisconnectAllDstObject (T const *pFBX_TYPE){ return DisconnectAllDstObject(T::ClassId); }
01069
01075 template < class T > inline bool DisconnectAllDstObject (T const *pFBX_TYPE,KFbxCriteria const &pCriteria) { return DisconnectAllDstObject(T::ClassId,pCriteria); }
01076
01081 template < class T > inline int GetDstObjectCount(T const *pFBX_TYPE) const { return GetDstObjectCount(T::ClassId); }
01082
01088 template < class T > inline int GetDstObjectCount(T const *pFBX_TYPE,KFbxCriteria const &pCriteria) const { return GetDstObjectCount(T::ClassId,pCriteria); }
01089
01095 template < class T > inline T* GetDstObject(T const *pFBX_TYPE,int pIndex=0) const { return (T*)GetDstObject(T::ClassId,pIndex); }
01096
01103 template < class T > inline T* GetDstObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,int pIndex=0) const { return (T*)GetDstObject(T::ClassId,pCriteria,pIndex); }
01104
01111 template < class T > inline T* FindDstObject(T const *pFBX_TYPE,const char *pName,int pStartIndex=0) const { return (T*)FindDstObject(T::ClassId,pName,pStartIndex); }
01112
01120 template < class T > inline T* FindDstObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const { return (T*)FindDstObject(T::ClassId,pCriteria,pName,pStartIndex); }
01122
01127 public:
01128
01133 bool ConnectSrcProperty (KFbxProperty const & pProperty);
01134
01139 bool IsConnectedSrcProperty (KFbxProperty const & pProperty);
01140
01145 bool DisconnectSrcProperty (KFbxProperty const & pProperty);
01146
01150 int GetSrcPropertyCount () const;
01151
01156 KFbxProperty GetSrcProperty (int pIndex=0) const;
01157
01163 KFbxProperty FindSrcProperty (const char *pName,int pStartIndex=0) const;
01164
01169 bool ConnectDstProperty (KFbxProperty const & pProperty);
01170
01175 bool IsConnectedDstProperty (KFbxProperty const & pProperty);
01176
01181 bool DisconnectDstProperty (KFbxProperty const & pProperty);
01182
01186 int GetDstPropertyCount () const;
01187
01192 KFbxProperty GetDstProperty (int pIndex=0) const;
01193
01199 KFbxProperty FindDstProperty (const char *pName,int pStartIndex=0) const;
01200
01202 void ClearConnectCache();
01203
01205
01207 static const char* sHierarchicalSeparator;
01208
01210
01211
01212
01214 #ifndef DOXYGEN_SHOULD_SKIP_THIS
01215
01216 protected:
01218 KFbxProperty(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType=KFbxDataType(), char const* pLabel="");
01219 KFbxProperty(KFbxProperty const & pParent, char const* pName, KFbxDataType const &pDataType, char const* pLabel);
01220
01221
01222 private:
01223 bool ConnectSrc (KFbxProperty const &pProperty,kFbxConnectionType pType=eFbxConnectionNone);
01224 bool DisconnectSrc (KFbxProperty const &pProperty);
01225 bool DisconnectAllSrc();
01226 bool DisconnectAllSrc(KFbxCriteria const &pCriteria);
01227 bool IsConnectedSrc (KFbxProperty const &pProperty) const;
01228 int GetSrcCount () const;
01229 int GetSrcCount (KFbxCriteria const &pCriteria) const;
01230 KFbxProperty GetSrc (int pIndex=0) const;
01231 KFbxProperty GetSrc (KFbxCriteria const &pCriteria,int pIndex=0) const;
01232 KFbxProperty FindSrc (KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01233
01234 bool ConnectDst (KFbxProperty const &pProperty,kFbxConnectionType pType=eFbxConnectionNone);
01235 bool DisconnectDst (KFbxProperty const &pProperty);
01236 bool DisconnectAllDst();
01237 bool DisconnectAllDst(KFbxCriteria const &pCriteria);
01238 bool IsConnectedDst (KFbxProperty const &pProperty) const;
01239 int GetDstCount () const;
01240 int GetDstCount (KFbxCriteria const &pCriteria) const;
01241 KFbxProperty GetDst (int pIndex=0) const;
01242 KFbxProperty GetDst (KFbxCriteria const &pCriteria,int pIndex=0) const;
01243 KFbxProperty FindDst (KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01244
01245 KFbxAnimCurve* GetCurve(KFbxAnimLayer* pAnimLayer, const char* pName, const char* pChannel, bool pCreateAsNeeded);
01246
01247 private:
01249 mutable KFbxPropertyHandle mPropertyHandle;
01250
01251 friend class KFbxObject;
01252 friend void KMarkObject(KFbxObject* pObject, KMap<KFbxObject*, int>& pObjectDstDisconnectCount, KSet2<KFbxObject*>& pObjectsToDeleted, KArrayTemplate<KFbxObject*>& pObjectToDeletedInSequence);
01253 friend void KCleanUpConnectionsAtDestructionBoundary(KFbxScene* pObject, KArrayTemplate<KFbxObject*>& pObjectToDeletedInSequence);
01254 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
01255 };
01256
01257 typedef KFbxProperty* HKFbxProperty;
01258
01259 template <class T> inline bool KFbxSet( KFbxProperty &pProperty,T const &pValue, bool pCheckValueEquality = true ) { return pProperty.Set( &pValue,FbxTypeOf(pValue),pCheckValueEquality ); }
01260 template <class T> inline bool KFbxGet( KFbxProperty const& pProperty,T &pValue ) { return pProperty.Get( &pValue,FbxTypeOf(pValue) ); }
01261 template <class T> inline T KFbxGet( KFbxProperty const& pProperty) { T pValue; pProperty.Get( &pValue,FbxTypeOf(pValue) ); return pValue; }
01262
01266 template <class T> class KFbxTypedProperty : public KFbxProperty {
01267 public:
01268
01273
01274 inline KFbxTypedProperty() : KFbxProperty() {}
01275
01279 inline KFbxTypedProperty(KFbxProperty const &pProperty) : KFbxProperty(pProperty) {}
01280
01282 inline ~KFbxTypedProperty() {}
01283
01285
01286
01296 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName,eFbxPropertyFlags pFlags=eNO_FLAG)
01297 {
01298 *this = Create(pObject, GetFbxDataType(FbxTypeOf(*((T *)0))), pName, "");
01299 ModifyFlag(pFlags, true);
01300 return *this;
01301 }
01302
01310 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName,T const &pValue,bool pForceSet=true,eFbxPropertyFlags pFlags=eNO_FLAG)
01311 {
01312 bool lWasFound = false;
01313 *this = Create(pObject, GetFbxDataType(FbxTypeOf(*((T *)0))), pName, "", true, &lWasFound);
01314
01315 if( pForceSet || !lWasFound )
01316 {
01317 ModifyFlag(pFlags, true);
01318 Set(pValue,false);
01319 }
01320
01321 return *this;
01322 }
01323
01330 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType,eFbxPropertyFlags pFlags=eNO_FLAG)
01331 {
01332 *this = Create(pObject, pDataType, pName, "");
01333 ModifyFlag(pFlags, true);
01334 return *this;
01335 }
01336
01345 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType,T const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01346 {
01347 bool lWasFound = false;
01348 *this = Create(pObject, pDataType, pName, "", true, &lWasFound);
01349
01350 if( pForceSet || !lWasFound )
01351 {
01352 ModifyFlag(pFlags, true);
01353
01354 Set(pValue,false);
01355 }
01356
01357 return *this;
01358 }
01359
01368 inline KFbxProperty const & StaticInit(KFbxProperty pCompound, char const* pName, KFbxDataType const &pDataType,T const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01369 {
01370 bool lWasFound = false;
01371 *this = Create(pCompound, pDataType, pName, "", true, &lWasFound);
01372
01373 if( pForceSet || !lWasFound )
01374 {
01375 ModifyFlag(pFlags, true);
01376
01377 Set(pValue,false);
01378 }
01379
01380 return *this;
01381 }
01382
01384 public:
01385
01390 KFbxTypedProperty &operator=(T const &pValue) { KFbxSet(*this,pValue); return *this; }
01391
01397 bool Set(T const &pValue, bool pCheckValueEquality ) { return KFbxSet(*this,pValue,pCheckValueEquality); }
01398
01403 bool Set(T const &pValue ) { return KFbxSet(*this,pValue,true); }
01404
01408 T Get() const { T lValue; KFbxGet(*this,lValue); return lValue; }
01409
01410 friend class KFbxObject;
01411 };
01412
01413
01414
01415
01416
01420 template <> class KFbxTypedProperty<fbxReference*> : public KFbxProperty
01421 {
01422 public:
01427
01429 inline KFbxTypedProperty() : KFbxProperty()
01430 {}
01431
01435 inline KFbxTypedProperty(KFbxProperty const &pProperty)
01436 : KFbxProperty(pProperty)
01437 {}
01438
01440 inline ~KFbxTypedProperty()
01441 {}
01443
01453 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, eFbxPropertyFlags pFlags=eNO_FLAG)
01454 {
01455 *this = KFbxProperty::Create(pObject, GetFbxDataType(FbxTypeOf(*((fbxReference* *)0))), pName);
01456 ModifyFlag(pFlags, true);
01457 return *this;
01458 }
01459
01467 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, fbxReference* const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01468 {
01469 bool lWasFound = false;
01470 *this = KFbxProperty::Create(pObject, GetFbxDataType(FbxTypeOf(*((fbxReference* *)0))), pName, "", true, &lWasFound);
01471 if( pForceSet || !lWasFound )
01472 {
01473 ModifyFlag(pFlags, true);
01474 Set(pValue,false);
01475 }
01476 return *this;
01477 }
01478
01485 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType, eFbxPropertyFlags pFlags=eNO_FLAG)
01486 {
01487 *this = KFbxProperty::Create(pObject, pDataType, pName, "");
01488
01489 ModifyFlag(pFlags, true);
01490 return *this;
01491 }
01492
01501 inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType, fbxReference* const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01502 {
01503 bool lWasFound = false;
01504 *this = KFbxProperty::Create(pObject, pDataType, pName, "", true, &lWasFound);
01505 if( pForceSet || !lWasFound )
01506 {
01507 ModifyFlag(pFlags, true);
01508 Set(pValue,false);
01509 }
01510 return *this;
01511 }
01513
01514 public:
01515
01520 KFbxTypedProperty &operator=(fbxReference* const &pValue)
01521 {
01522 KFbxSet(*this,pValue);
01523 return *this;
01524 }
01525
01533 inline bool Set(fbxReference* const &pValue ) { return Set(pValue, true); }
01534
01543 bool Set(fbxReference* const &pValue, bool pCheckValueEquality )
01544 {
01545 KFbxObject* lValue = reinterpret_cast<KFbxObject*>(pValue);
01546 DisconnectAllSrcObject();
01547 if (lValue) {
01548 return ConnectSrcObject(lValue);
01549 }
01550
01551 return false;
01552 }
01553
01557 fbxReference* Get() const
01558 {
01559 KFbxObject* lValue = GetSrcObjectCount() > 0 ? GetSrcObject(0) : NULL;
01560 return reinterpret_cast<fbxReference*>(lValue);
01561 }
01562
01563 friend class KFbxObject;
01564 };
01565
01566
01567 typedef KFbxTypedProperty<fbxBool1> KFbxPropertyBool1;
01568 typedef KFbxTypedProperty<fbxInteger1> KFbxPropertyInteger1;
01569 typedef KFbxTypedProperty<fbxDouble1> KFbxPropertyDouble1;
01570 typedef KFbxTypedProperty<fbxDouble3> KFbxPropertyDouble3;
01571 typedef KFbxTypedProperty<fbxDouble4> KFbxPropertyDouble4;
01572 typedef KFbxTypedProperty<fbxString> KFbxPropertyString;
01573 typedef KFbxTypedProperty<fbxReference*> KFbxPropertyReference;
01574
01583 enum eFbxConnectEventType {
01584 eFbxConnectRequest,
01585 eFbxConnect,
01586 eFbxConnected,
01587 eFbxDisconnectRequest,
01588 eFbxDisconnect,
01589 eFbxDisconnected
01590 };
01591
01596 enum eFbxConnectEventDirection {
01597 eConnectEventSrc,
01598 eConnectEventDst
01599 };
01600
01604 class KFBX_DLL KFbxConnectEvent
01605 {
01610 public:
01611
01618 inline KFbxConnectEvent(eFbxConnectEventType pType,eFbxConnectEventDirection pDir,KFbxProperty *pSrc,KFbxProperty *pDst)
01619 : mType(pType)
01620 , mDirection(pDir)
01621 , mSrc(pSrc)
01622 , mDst(pDst)
01623 {
01624 }
01626
01631 public:
01632
01634 inline eFbxConnectEventType GetType() const { return mType; }
01635
01637 inline eFbxConnectEventDirection GetDirection() const { return mDirection; }
01638
01640 inline KFbxProperty &GetSrc() const { return *mSrc; }
01641
01643 inline KFbxProperty &GetDst() const { return *mDst; }
01644
01649 template < class T > inline T* GetSrcIfObject(T const *pFBX_TYPE) const { return mSrc->IsRoot() ? KFbxCast<T>(mSrc->GetFbxObject()) : (T*)0; }
01650
01655 template < class T > inline T* GetDstIfObject(T const *pFBX_TYPE) const { return mDst->IsRoot() ? KFbxCast<T>(mDst->GetFbxObject()) : (T*)0; }
01657
01658 private:
01659 eFbxConnectEventType mType;
01660 eFbxConnectEventDirection mDirection;
01661 KFbxProperty* mSrc;
01662 KFbxProperty* mDst;
01663 };
01664
01665
01666
01667 #include <fbxfilesdk/fbxfilesdk_nsend.h>
01668
01669 #endif // FBXFILESDK_KFBXPLUGINS_KFBXPROPERTY_H
01670