00001 #ifndef _FBXSDK_KFBXPROPERTYHANDLE_H_
00002 #define _FBXSDK_KFBXPROPERTYHANDLE_H_
00003
00004
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 #include <kaydaradef.h>
00040 #ifndef KFBX_DLL
00041 #define KFBX_DLL K_DLLIMPORT
00042 #endif
00043
00044 #include <kfbxplugins/kfbxtypes.h>
00045 #include <fbxcore/kfbxpropertydef.h>
00046
00047
00048 #include <fbxfilesdk_nsbegin.h>
00049
00050
00051 class KFbxPropertyPage;
00052 class KFbxPropertyHandle;
00053 class KFbxConnectionPointFilter;
00054
00055
00056
00057
00058 typedef KFbxPropertyHandle KFbxTypeInfoHandle;
00059 typedef KFbxPropertyHandle KFbxObjectHandle;
00060 typedef int kFbxPropertyId;
00061
00065 class KFBX_DLL KFbxPropertyHandle
00066 {
00071 public:
00072
00074 static KFbxObjectHandle Create();
00076 static KFbxObjectHandle Create(KFbxObjectHandle const &pInstanceOf);
00078 static KFbxTypeInfoHandle Create(char const *pName,EFbxType pType=eUNIDENTIFIED);
00080 static KFbxTypeInfoHandle Create(char const *pName,KFbxTypeInfoHandle pTypeInfo);
00084 bool Destroy();
00085 public:
00087 KFbxPropertyHandle();
00089 KFbxPropertyHandle(KFbxPropertyHandle const &pAddress);
00090
00092 ~KFbxPropertyHandle();
00093
00094 public:
00096 KFbxPropertyHandle(KFbxPropertyPage* pPage,kFbxPropertyId pId=kFbxProperyIdRoot);
00097
00098
00100
00105 public:
00106
00108 KFbxPropertyHandle &operator = (KFbxPropertyHandle const &pHandle);
00110 bool operator == (KFbxPropertyHandle const &pHandle) const;
00112 bool operator != (KFbxPropertyHandle const &pHandle) const;
00114 bool Is (KFbxPropertyHandle const &pHandle) const;
00116 bool Valid() const;
00117
00119 const char * GetName() const;
00121 EFbxType GetType() const;
00123 KFbxTypeInfoHandle GetTypeInfo() const;
00125 const char * GetLabel() const;
00126
00131 bool SetLabel(char const *pLabel);
00132
00133
00135 FbxPropertyFlags::eFbxPropertyFlags GetFlags() const;
00136
00142 bool ModifyFlags(FbxPropertyFlags::eFbxPropertyFlags pFlags, bool pValue);
00143
00149 KFbxInheritType GetFlagsInheritType( FbxPropertyFlags::eFbxPropertyFlags pFlags, bool pCheckReferences ) const;
00150
00156 bool SetFlagsInheritType( FbxPropertyFlags::eFbxPropertyFlags pFlags, KFbxInheritType pType );
00157
00159 void * GetUserData() const;
00160
00165 bool SetUserData(void const *pUserData);
00166
00168 int GetUserTag() const;
00169
00174 bool SetUserTag(int pUserData);
00176
00181 public:
00182
00187 int AddEnumValue(char const *pStringValue);
00188
00193 void InsertEnumValue(int pIndex, char const *pStringValue);
00194
00198 int GetEnumCount();
00199
00204 void SetEnumValue(int pIndex, char const *pStringValue);
00205
00209 void RemoveEnumValue(int pIndex);
00210
00215 char * GetEnumValue(int pIndex);
00217
00218
00223 public:
00229 KFbxPropertyHandle Add(char const * pName,KFbxTypeInfoHandle const &pTypeInfo);
00230
00232 void BeginCreateOrFindProperty();
00234 void EndCreateOrFindProperty();
00235
00239 inline bool IsRoot() const { return (mPage && (mId==0)) ? true : false; }
00240
00245 bool IsChildOf(KFbxPropertyHandle const & pParent) const;
00246
00251 bool IsDescendentOf(KFbxPropertyHandle const & pParent) const;
00252
00256 KFbxPropertyHandle GetParent() const;
00257
00261 bool SetParent( KFbxPropertyHandle const& pOther );
00262
00266 KFbxPropertyHandle GetChild() const;
00267
00271 KFbxPropertyHandle GetSibling() const;
00272
00276 KFbxPropertyHandle GetFirstDescendent() const;
00277
00283 KFbxPropertyHandle GetNextDescendent(KFbxPropertyHandle const &pHandle) const;
00284
00290 KFbxPropertyHandle Find (char const *pName,bool pCaseSensitive) const;
00291
00298 KFbxPropertyHandle Find (char const *pName,KFbxTypeInfoHandle const &pTypeInfo,bool pCaseSensitive) const;
00299
00308 KFbxPropertyHandle Find (char const *pName, const char* pChildrenSeparator,bool pCaseSensitive) const;
00309
00319 KFbxPropertyHandle Find (char const *pName, const char* pChildrenSeparator,KFbxTypeInfoHandle const &pTypeInfo,bool pCaseSensitive) const;
00321
00326 public:
00327
00333 bool ConnectSrc (KFbxPropertyHandle const &pSrc,kFbxConnectionType const pType=eFbxConnectionDefault);
00334
00340 int GetSrcCount (KFbxConnectionPointFilter* pFilter=0) const;
00341
00348 KFbxPropertyHandle GetSrc (KFbxConnectionPointFilter* pFilter=0,int pIndex=0) const;
00349
00354 bool DisconnectSrc (KFbxPropertyHandle const &pSrc);
00355
00360 bool IsConnectedSrc (KFbxPropertyHandle const &pSrc);
00361
00367 bool ConnectDst (KFbxPropertyHandle const &pDst,kFbxConnectionType const pType=eFbxConnectionDefault);
00368
00374 int GetDstCount (KFbxConnectionPointFilter* pFilter=0) const;
00375
00382 KFbxPropertyHandle GetDst (KFbxConnectionPointFilter* pFilter=0,int pIndex=0) const;
00383
00388 bool DisconnectDst (KFbxPropertyHandle const &pDst);
00389
00394 bool IsConnectedDst (KFbxPropertyHandle const &pDst);
00395
00397 void ClearConnectCache();
00399
00404 public:
00405
00409 bool HasMin() const;
00410
00416 bool GetMin (void *pValue,EFbxType pValueType) const;
00417
00423 bool SetMin (void const *pValue,EFbxType pValueType);
00424
00429 template <class T> inline bool SetMin ( T const &pValue ) { return SetMin( &pValue,FbxTypeOf(pValue) ); }
00430
00435 template <class T> inline T GetMin ( T const *pFBX_TYPE) const { T lValue; GetMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00436
00440 bool HasSoftMin() const;
00441
00447 bool GetSoftMin (void *pValue,EFbxType pValueType) const;
00448
00454 bool SetSoftMin (void const *pValue,EFbxType pValueType);
00455
00460 template <class T> inline bool SetSoftMin ( T const &pValue ) { return SetSoftMin( &pValue,FbxTypeOf(pValue) ); }
00461
00466 template <class T> inline T GetSoftMin ( T const *pFBX_TYPE) const { T lValue; GetSoftMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00467
00471 bool HasMax() const;
00472
00478 bool GetMax (void *pValue,EFbxType pValueType) const;
00479
00485 bool SetMax (void const *pValue,EFbxType pValueType);
00486
00491 template <class T> inline bool SetMax ( T const &pValue ) { return SetMax( &pValue,FbxTypeOf(pValue) ); }
00492
00497 template <class T> inline T GetMax ( T const *pFBX_TYPE) const { T lValue; GetMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00498
00502 bool HasSoftMax() const;
00503
00509 bool GetSoftMax (void *pValue,EFbxType pValueType) const;
00510
00516 bool SetSoftMax (void const *pValue,EFbxType pValueType);
00517
00522 template <class T> inline bool SetSoftMax ( T const &pValue ) { return SetSoftMax( &pValue,FbxTypeOf(pValue) ); }
00523
00528 template <class T> inline T GetSoftMax ( T const *pFBX_TYPE) const { T lValue; GetSoftMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00529
00530
00535 public:
00536
00541 KFbxInheritType GetValueInheritType(bool pCheckReferences) const;
00542
00547 bool SetValueInheritType(KFbxInheritType pType);
00548
00554 bool GetDefaultValue(void *pValue,EFbxType pValueType) const;
00555
00561 bool Get(void *pValue,EFbxType pValueType) const;
00562
00570 bool Set(void const *pValue,EFbxType pValueType,bool pCheckValueEquality);
00571
00576 template <class T> inline bool Set( T const &pValue ) { return Set( &pValue,FbxTypeOf(pValue) ); }
00577
00582 template <class T> inline T Get( T const *pFBX_TYPE) const { T lValue; Get( &lValue,FbxTypeOf(lValue) ); return lValue; }
00584
00589 public:
00590
00594 void SetPageDataPtr(void *pData);
00595
00599 void* GetPageDataPtr() const;
00600
00602
00607
00611 bool PushPropertiesToParentInstance();
00612
00613
00615
00620 public:
00624 bool IsAReferenceTo(void) const;
00625
00629 void* GetReferenceTo(void) const;
00630
00634 bool IsReferencedBy(void) const;
00635
00639 int GetReferencedByCount(void) const;
00640
00645 void* GetReferencedBy(int pIndex) const;
00647
00648
00649 private:
00650 KFbxPropertyPage* mPage;
00651 kFbxPropertyId mId;
00652
00653 };
00654
00655
00656 KFBX_DLL KMemoryAllocator & GetConnectionPointAllocator();
00657
00658 #include <fbxfilesdk_nsend.h>
00659
00660 #endif // #ifndef _FBXSDK_Document_H_