00001 
00004 #ifndef FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00005 #define FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
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 
00041 
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00044 #include <fbxfilesdk/fbxcore/kfbxpropertydef.h>
00045 
00046 
00047 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00048 
00049     
00050     class   KFbxPropertyPage;
00051     class   KFbxPropertyHandle;
00052     class   KFbxConnectionPointFilter;
00053 
00054     
00055 
00056 
00057     typedef KFbxPropertyHandle  KFbxTypeInfoHandle;
00058     typedef KFbxPropertyHandle  KFbxObjectHandle;
00059     typedef int                 kFbxPropertyId;
00060 
00064     class KFBX_DLL KFbxPropertyHandle
00065     {
00070     public:
00071 
00073         static KFbxObjectHandle     Create();
00074 
00078         static KFbxObjectHandle     Create(KFbxObjectHandle const &pInstanceOf);
00079 
00084         static KFbxTypeInfoHandle   Create(char const *pName,EFbxType pType=eUNIDENTIFIED);
00085 
00090         static KFbxTypeInfoHandle   Create(char const *pName,KFbxTypeInfoHandle pTypeInfo);
00091 
00095         bool                        Destroy();
00096     public:
00098         KFbxPropertyHandle();
00102         KFbxPropertyHandle(KFbxPropertyHandle const &pAddress);
00103 
00105         ~KFbxPropertyHandle();
00106 
00107     public:
00112         KFbxPropertyHandle(KFbxPropertyPage* pPage,kFbxPropertyId pId=kFbxProperyIdRoot);
00113 
00114 
00116 
00121     public:
00122         
00126         KFbxPropertyHandle &operator =  (KFbxPropertyHandle const &pHandle);
00127 
00132         bool                operator == (KFbxPropertyHandle const &pHandle) const;
00133 
00138         bool                operator != (KFbxPropertyHandle const &pHandle) const;
00139 
00144         bool                Is          (KFbxPropertyHandle const &pHandle) const;
00145 
00147         bool                Valid() const;
00148 
00150         const char *            GetName() const;
00152         EFbxType                GetType() const;
00154         KFbxTypeInfoHandle      GetTypeInfo() const;
00156         const char *            GetLabel() const;
00157 
00162         bool                    SetLabel(char const *pLabel);
00163 
00164         
00166         FbxPropertyFlags::eFbxPropertyFlags     GetFlags() const;
00167 
00173         bool                                    ModifyFlags(FbxPropertyFlags::eFbxPropertyFlags pFlags, bool pValue);
00174 
00180         KFbxInheritType                         GetFlagsInheritType( FbxPropertyFlags::eFbxPropertyFlags pFlags, bool pCheckReferences ) const;
00181 
00187         bool                                    SetFlagsInheritType( FbxPropertyFlags::eFbxPropertyFlags pFlags, KFbxInheritType pType );
00188 
00190         void *                  GetUserData() const;
00191 
00196         bool                    SetUserData(void const *pUserData);
00197 
00199         int                     GetUserTag() const;
00200 
00205         bool                    SetUserTag(int pUserData);
00207 
00212     public:
00213 
00218         int     AddEnumValue(char const *pStringValue);
00219 
00224         void    InsertEnumValue(int pIndex, char const *pStringValue);
00225 
00229         int     GetEnumCount();
00230 
00235         void    SetEnumValue(int pIndex,  char const *pStringValue);
00236 
00240         void    RemoveEnumValue(int pIndex);
00241 
00246         char *  GetEnumValue(int pIndex);
00248 
00249 
00254     public:
00260         KFbxPropertyHandle      Add(char const * pName,KFbxTypeInfoHandle const &pTypeInfo);
00261 
00263         void                    BeginCreateOrFindProperty();
00265         void                    EndCreateOrFindProperty();
00266 
00270         inline bool             IsRoot() const              { return (mPage && (mId==0)) ? true : false; }
00271 
00276         bool                    IsChildOf(KFbxPropertyHandle    const & pParent) const;
00277 
00282         bool                    IsDescendentOf(KFbxPropertyHandle   const & pParent) const;
00283 
00287         KFbxPropertyHandle      GetParent() const;
00288 
00293         bool                    SetParent( KFbxPropertyHandle const& pOther );
00294 
00298         KFbxPropertyHandle      GetChild()  const;
00299 
00303         KFbxPropertyHandle      GetSibling() const;
00304 
00308         KFbxPropertyHandle      GetFirstDescendent()  const;
00309 
00315         KFbxPropertyHandle      GetNextDescendent(KFbxPropertyHandle const &pHandle) const;
00316 
00322         KFbxPropertyHandle      Find (char const *pName,bool pCaseSensitive) const;
00323 
00330         KFbxPropertyHandle      Find (char const *pName,KFbxTypeInfoHandle const &pTypeInfo,bool pCaseSensitive) const;
00331 
00340         KFbxPropertyHandle      Find (char const *pName, const char* pChildrenSeparator,bool pCaseSensitive) const;
00341 
00351         KFbxPropertyHandle      Find (char const *pName, const char* pChildrenSeparator,KFbxTypeInfoHandle const &pTypeInfo,bool pCaseSensitive) const;
00353 
00358     public:
00359 
00365         bool                ConnectSrc      (KFbxPropertyHandle const &pSrc,kFbxConnectionType const pType=eFbxConnectionDefault); 
00366 
00372         int                 GetSrcCount     (KFbxConnectionPointFilter* pFilter=0) const; 
00373 
00380         KFbxPropertyHandle  GetSrc          (KFbxConnectionPointFilter* pFilter=0,int pIndex=0) const; 
00381 
00386         bool                DisconnectSrc   (KFbxPropertyHandle const &pSrc);
00387 
00392         bool                IsConnectedSrc  (KFbxPropertyHandle const &pSrc);
00393 
00399         bool                ConnectDst      (KFbxPropertyHandle const &pDst,kFbxConnectionType const pType=eFbxConnectionDefault); 
00400 
00406         int                 GetDstCount     (KFbxConnectionPointFilter* pFilter=0) const; 
00407 
00414         KFbxPropertyHandle  GetDst          (KFbxConnectionPointFilter* pFilter=0,int pIndex=0) const; 
00415 
00420         bool                DisconnectDst   (KFbxPropertyHandle const &pDst);
00421 
00426         bool                IsConnectedDst  (KFbxPropertyHandle const &pDst);
00427 
00429         void                ClearConnectCache();
00431 
00436     public:
00437 
00441         bool                    HasMin() const;
00442 
00448         bool                            GetMin      (void *pValue,EFbxType pValueType) const;
00449 
00455         bool                            SetMin      (void const *pValue,EFbxType pValueType);
00456 
00461         template <class T> inline bool  SetMin      ( T const &pValue )         { return SetMin( &pValue,FbxTypeOf(pValue) ); }
00462 
00467         template <class T> inline T     GetMin      ( T const *pFBX_TYPE) const { T lValue; GetMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00468 
00472         bool                    HasSoftMin() const;
00473 
00479         bool                            GetSoftMin  (void *pValue,EFbxType pValueType) const;
00480 
00486         bool                            SetSoftMin  (void const *pValue,EFbxType pValueType);
00487 
00492         template <class T> inline bool  SetSoftMin  ( T const &pValue )         { return SetSoftMin( &pValue,FbxTypeOf(pValue) ); }
00493 
00498         template <class T> inline T     GetSoftMin  ( T const *pFBX_TYPE) const { T lValue; GetSoftMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00499 
00503         bool                    HasMax() const;
00504 
00510         bool                            GetMax      (void *pValue,EFbxType pValueType) const;
00511 
00517         bool                            SetMax      (void const *pValue,EFbxType pValueType);
00518 
00523         template <class T> inline bool  SetMax      ( T const &pValue )         { return SetMax( &pValue,FbxTypeOf(pValue) ); }
00524 
00529         template <class T> inline T     GetMax      ( T const *pFBX_TYPE) const { T lValue; GetMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00530 
00534         bool                    HasSoftMax() const;
00535 
00541         bool                            GetSoftMax  (void *pValue,EFbxType pValueType) const;
00542 
00548         bool                            SetSoftMax  (void const *pValue,EFbxType pValueType);
00549 
00554         template <class T> inline bool  SetSoftMax  ( T const &pValue )         { return SetSoftMax( &pValue,FbxTypeOf(pValue) ); }
00555 
00560         template <class T> inline T     GetSoftMax  ( T const *pFBX_TYPE) const { T lValue; GetSoftMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00561 
00562 
00567     public:
00568 
00573         KFbxInheritType GetValueInheritType(bool pCheckReferences) const;
00574 
00579         bool            SetValueInheritType(KFbxInheritType pType);
00580 
00586         bool            GetDefaultValue(void *pValue,EFbxType pValueType) const;
00587 
00593         bool            Get(void *pValue,EFbxType pValueType) const;
00594 
00602         bool            Set(void const *pValue,EFbxType pValueType,bool pCheckValueEquality);
00603 
00608         template <class T> inline bool  Set( T const &pValue )          { return Set( &pValue,FbxTypeOf(pValue) ); }
00609 
00614         template <class T> inline T     Get( T const *pFBX_TYPE) const  { T lValue; Get( &lValue,FbxTypeOf(lValue) ); return lValue; }
00616 
00621     public:
00622 
00626         void    SetPageDataPtr(void *pData);
00627 
00631         void*   GetPageDataPtr() const;
00632 
00634 
00639 
00643         bool PushPropertiesToParentInstance();
00644 
00645 
00647 
00652     public:
00656         bool    IsAReferenceTo(void) const;
00657 
00661         void*   GetReferenceTo(void) const;
00662 
00666         bool    IsReferencedBy(void) const;
00667 
00671         int     GetReferencedByCount(void) const;
00672 
00677         void*   GetReferencedBy(int pIndex) const; 
00679 
00680 
00681     private:
00682         KFbxPropertyPage*       mPage;
00683         kFbxPropertyId          mId;
00684 
00685     };
00686 
00687     
00688     KFBX_DLL KMemoryAllocator & GetConnectionPointAllocator();
00689 
00690 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00691 
00692 #endif // FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00693