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 - 2010 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();
00430 
00432         void                WipeAllConnections();
00434 
00448     public:
00449 
00453         bool                    HasMin() const;
00454 
00460         bool                            GetMin      (void *pValue,EFbxType pValueType) const;
00461 
00467         bool                            SetMin      (void const *pValue,EFbxType pValueType);
00468 
00473         template <class T> inline bool  SetMin      ( T const &pValue )         { return SetMin( &pValue,FbxTypeOf(pValue) ); }
00474 
00480         template <class T> inline T     GetMin      ( T const *pFBX_TYPE) const { T lValue; GetMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00481 
00485         bool                    HasSoftMin() const;
00486 
00492         bool                            GetSoftMin  (void *pValue,EFbxType pValueType) const;
00493 
00499         bool                            SetSoftMin  (void const *pValue,EFbxType pValueType);
00500 
00505         template <class T> inline bool  SetSoftMin  ( T const &pValue )         { return SetSoftMin( &pValue,FbxTypeOf(pValue) ); }
00506 
00512         template <class T> inline T     GetSoftMin  ( T const *pFBX_TYPE) const { T lValue; GetSoftMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00513 
00517         bool                    HasMax() const;
00518 
00524         bool                            GetMax      (void *pValue,EFbxType pValueType) const;
00525 
00531         bool                            SetMax      (void const *pValue,EFbxType pValueType);
00532 
00537         template <class T> inline bool  SetMax      ( T const &pValue )         { return SetMax( &pValue,FbxTypeOf(pValue) ); }
00538 
00544         template <class T> inline T     GetMax      ( T const *pFBX_TYPE) const { T lValue; GetMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00545 
00549         bool                    HasSoftMax() const;
00550 
00556         bool                            GetSoftMax  (void *pValue,EFbxType pValueType) const;
00557 
00563         bool                            SetSoftMax  (void const *pValue,EFbxType pValueType);
00564 
00569         template <class T> inline bool  SetSoftMax  ( T const &pValue )         { return SetSoftMax( &pValue,FbxTypeOf(pValue) ); }
00570 
00576         template <class T> inline T     GetSoftMax  ( T const *pFBX_TYPE) const { T lValue; GetSoftMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00577 
00578 
00583     public:
00584 
00589         KFbxInheritType GetValueInheritType(bool pCheckReferences) const;
00590 
00595         bool            SetValueInheritType(KFbxInheritType pType);
00596 
00602         bool            GetDefaultValue(void *pValue,EFbxType pValueType) const;
00603 
00609         bool            Get(void *pValue,EFbxType pValueType) const;
00610 
00618         bool            Set(void const *pValue,EFbxType pValueType,bool pCheckValueEquality);
00619 
00624         template <class T> inline bool  Set( T const &pValue )          { return Set( &pValue,FbxTypeOf(pValue) ); }
00625 
00630         template <class T> inline T     Get( T const *pFBX_TYPE) const  { T lValue; Get( &lValue,FbxTypeOf(lValue) ); return lValue; }
00632 
00637     public:
00638 
00642         void    SetPageDataPtr(void *pData);
00643 
00647         void*   GetPageDataPtr() const;
00648 
00650 
00655 
00659         bool PushPropertiesToParentInstance();
00660 
00661 
00663 
00668     public:
00672         bool    IsAReferenceTo(void) const;
00673 
00677         void*   GetReferenceTo(void) const;
00678 
00682         bool    IsReferencedBy(void) const;
00683 
00687         int     GetReferencedByCount(void) const;
00688 
00693         void*   GetReferencedBy(int pIndex) const; 
00695 
00696 
00697     private:
00698         KFbxPropertyPage*       mPage;
00699         kFbxPropertyId          mId;
00700 
00701     };
00702 
00703 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00704 
00705 #endif // FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00706