kfbxpropertyhandle.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00005 #define FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00044 #include <fbxfilesdk/fbxcore/kfbxpropertydef.h>
00045 
00046 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00047 
00048     // Forwards
00049     class   KMemoryAllocator;
00050     class   KFbxPropertyPage;
00051     class   KFbxPropertyHandle;
00052     class   KFbxConnectionPointFilter;
00053 
00054     /***********************************************
00055       KFbxPropertyHandle
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         // Assignment
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         // Flag management
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     // Internal Allocator Function
00688     KFBX_DLL KMemoryAllocator & GetConnectionPointAllocator();
00689 
00690 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00691 
00692 #endif // FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00693