FBX SDK Reference Guide: kfbxpropertyhandle.h Source File
00001 #ifndef FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00002 #define FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00003 
00004 /**************************************************************************************
00005 
00006  Copyright © 2001 - 2008 Autodesk, Inc. and/or its licensors.
00007  All Rights Reserved.
00008 
00009  The coded instructions, statements, computer programs, and/or related material 
00010  (collectively the "Data") in these files contain unpublished information 
00011  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00012  Canada and United States of America federal copyright law and by international 
00013  treaties. 
00014  
00015  The Data may not be disclosed or distributed to third parties, in whole or in
00016  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00017 
00018  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00019  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00020  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00021  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00022  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00023  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00024  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00028  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00029  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00030  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00031  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00032  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00033  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00034  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00035  OR DAMAGE. 
00036 
00037 **************************************************************************************/
00038 
00039 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00040 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00041 #include <fbxfilesdk/fbxcore/kfbxpropertydef.h>
00042 
00043 
00044 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00045 
00046     // Forwards
00047     class   KFbxPropertyPage;
00048     class   KFbxPropertyHandle;
00049     class   KFbxConnectionPointFilter;
00050 
00051     /***********************************************
00052       KFbxPropertyHandle
00053     ************************************************/
00054     typedef KFbxPropertyHandle  KFbxTypeInfoHandle;
00055     typedef KFbxPropertyHandle  KFbxObjectHandle;
00056     typedef int                 kFbxPropertyId;
00057 
00061     class KFBX_DLL KFbxPropertyHandle
00062     {
00067     public:
00068 
00070         static KFbxObjectHandle     Create();
00071 
00075         static KFbxObjectHandle     Create(KFbxObjectHandle const &pInstanceOf);
00076 
00081         static KFbxTypeInfoHandle   Create(char const *pName,EFbxType pType=eUNIDENTIFIED);
00082 
00087         static KFbxTypeInfoHandle   Create(char const *pName,KFbxTypeInfoHandle pTypeInfo);
00088 
00092         bool                        Destroy();
00093     public:
00095         KFbxPropertyHandle();
00099         KFbxPropertyHandle(KFbxPropertyHandle const &pAddress);
00100 
00102         ~KFbxPropertyHandle();
00103 
00104     public:
00109         KFbxPropertyHandle(KFbxPropertyPage* pPage,kFbxPropertyId pId=kFbxProperyIdRoot);
00110 
00111 
00113 
00118     public:
00119         // Assignment
00123         KFbxPropertyHandle &operator =  (KFbxPropertyHandle const &pHandle);
00124 
00129         bool                operator == (KFbxPropertyHandle const &pHandle) const;
00130 
00135         bool                operator != (KFbxPropertyHandle const &pHandle) const;
00136 
00141         bool                Is          (KFbxPropertyHandle const &pHandle) const;
00142 
00144         bool                Valid() const;
00145 
00147         const char *            GetName() const;
00149         EFbxType                GetType() const;
00151         KFbxTypeInfoHandle      GetTypeInfo() const;
00153         const char *            GetLabel() const;
00154 
00159         bool                    SetLabel(char const *pLabel);
00160 
00161         // Flag management
00163         FbxPropertyFlags::eFbxPropertyFlags     GetFlags() const;
00164 
00170         bool                                    ModifyFlags(FbxPropertyFlags::eFbxPropertyFlags pFlags, bool pValue);
00171 
00177         KFbxInheritType                         GetFlagsInheritType( FbxPropertyFlags::eFbxPropertyFlags pFlags, bool pCheckReferences ) const;
00178 
00184         bool                                    SetFlagsInheritType( FbxPropertyFlags::eFbxPropertyFlags pFlags, KFbxInheritType pType );
00185 
00187         void *                  GetUserData() const;
00188 
00193         bool                    SetUserData(void const *pUserData);
00194 
00196         int                     GetUserTag() const;
00197 
00202         bool                    SetUserTag(int pUserData);
00204 
00209     public:
00210 
00215         int     AddEnumValue(char const *pStringValue);
00216 
00221         void    InsertEnumValue(int pIndex, char const *pStringValue);
00222 
00226         int     GetEnumCount();
00227 
00232         void    SetEnumValue(int pIndex,  char const *pStringValue);
00233 
00237         void    RemoveEnumValue(int pIndex);
00238 
00243         char *  GetEnumValue(int pIndex);
00245 
00246 
00251     public:
00257         KFbxPropertyHandle      Add(char const * pName,KFbxTypeInfoHandle const &pTypeInfo);
00258 
00260         void                    BeginCreateOrFindProperty();
00262         void                    EndCreateOrFindProperty();
00263 
00267         inline bool             IsRoot() const              { return (mPage && (mId==0)) ? true : false; }
00268 
00273         bool                    IsChildOf(KFbxPropertyHandle    const & pParent) const;
00274 
00279         bool                    IsDescendentOf(KFbxPropertyHandle   const & pParent) const;
00280 
00284         KFbxPropertyHandle      GetParent() const;
00285 
00290         bool                    SetParent( KFbxPropertyHandle const& pOther );
00291 
00295         KFbxPropertyHandle      GetChild()  const;
00296 
00300         KFbxPropertyHandle      GetSibling() const;
00301 
00305         KFbxPropertyHandle      GetFirstDescendent()  const;
00306 
00312         KFbxPropertyHandle      GetNextDescendent(KFbxPropertyHandle const &pHandle) const;
00313 
00319         KFbxPropertyHandle      Find (char const *pName,bool pCaseSensitive) const;
00320 
00327         KFbxPropertyHandle      Find (char const *pName,KFbxTypeInfoHandle const &pTypeInfo,bool pCaseSensitive) const;
00328 
00337         KFbxPropertyHandle      Find (char const *pName, const char* pChildrenSeparator,bool pCaseSensitive) const;
00338 
00348         KFbxPropertyHandle      Find (char const *pName, const char* pChildrenSeparator,KFbxTypeInfoHandle const &pTypeInfo,bool pCaseSensitive) const;
00350 
00355     public:
00356 
00362         bool                ConnectSrc      (KFbxPropertyHandle const &pSrc,kFbxConnectionType const pType=eFbxConnectionDefault); 
00363 
00369         int                 GetSrcCount     (KFbxConnectionPointFilter* pFilter=0) const; 
00370 
00377         KFbxPropertyHandle  GetSrc          (KFbxConnectionPointFilter* pFilter=0,int pIndex=0) const; 
00378 
00383         bool                DisconnectSrc   (KFbxPropertyHandle const &pSrc);
00384 
00389         bool                IsConnectedSrc  (KFbxPropertyHandle const &pSrc);
00390 
00396         bool                ConnectDst      (KFbxPropertyHandle const &pDst,kFbxConnectionType const pType=eFbxConnectionDefault); 
00397 
00403         int                 GetDstCount     (KFbxConnectionPointFilter* pFilter=0) const; 
00404 
00411         KFbxPropertyHandle  GetDst          (KFbxConnectionPointFilter* pFilter=0,int pIndex=0) const; 
00412 
00417         bool                DisconnectDst   (KFbxPropertyHandle const &pDst);
00418 
00423         bool                IsConnectedDst  (KFbxPropertyHandle const &pDst);
00424 
00426         void                ClearConnectCache();
00428 
00433     public:
00434 
00438         bool                    HasMin() const;
00439 
00445         bool                            GetMin      (void *pValue,EFbxType pValueType) const;
00446 
00452         bool                            SetMin      (void const *pValue,EFbxType pValueType);
00453 
00458         template <class T> inline bool  SetMin      ( T const &pValue )         { return SetMin( &pValue,FbxTypeOf(pValue) ); }
00459 
00464         template <class T> inline T     GetMin      ( T const *pFBX_TYPE) const { T lValue; GetMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00465 
00469         bool                    HasSoftMin() const;
00470 
00476         bool                            GetSoftMin  (void *pValue,EFbxType pValueType) const;
00477 
00483         bool                            SetSoftMin  (void const *pValue,EFbxType pValueType);
00484 
00489         template <class T> inline bool  SetSoftMin  ( T const &pValue )         { return SetSoftMin( &pValue,FbxTypeOf(pValue) ); }
00490 
00495         template <class T> inline T     GetSoftMin  ( T const *pFBX_TYPE) const { T lValue; GetSoftMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
00496 
00500         bool                    HasMax() const;
00501 
00507         bool                            GetMax      (void *pValue,EFbxType pValueType) const;
00508 
00514         bool                            SetMax      (void const *pValue,EFbxType pValueType);
00515 
00520         template <class T> inline bool  SetMax      ( T const &pValue )         { return SetMax( &pValue,FbxTypeOf(pValue) ); }
00521 
00526         template <class T> inline T     GetMax      ( T const *pFBX_TYPE) const { T lValue; GetMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00527 
00531         bool                    HasSoftMax() const;
00532 
00538         bool                            GetSoftMax  (void *pValue,EFbxType pValueType) const;
00539 
00545         bool                            SetSoftMax  (void const *pValue,EFbxType pValueType);
00546 
00551         template <class T> inline bool  SetSoftMax  ( T const &pValue )         { return SetSoftMax( &pValue,FbxTypeOf(pValue) ); }
00552 
00557         template <class T> inline T     GetSoftMax  ( T const *pFBX_TYPE) const { T lValue; GetSoftMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
00558 
00559 
00564     public:
00565 
00570         KFbxInheritType GetValueInheritType(bool pCheckReferences) const;
00571 
00576         bool            SetValueInheritType(KFbxInheritType pType);
00577 
00583         bool            GetDefaultValue(void *pValue,EFbxType pValueType) const;
00584 
00590         bool            Get(void *pValue,EFbxType pValueType) const;
00591 
00599         bool            Set(void const *pValue,EFbxType pValueType,bool pCheckValueEquality);
00600 
00605         template <class T> inline bool  Set( T const &pValue )          { return Set( &pValue,FbxTypeOf(pValue) ); }
00606 
00611         template <class T> inline T     Get( T const *pFBX_TYPE) const  { T lValue; Get( &lValue,FbxTypeOf(lValue) ); return lValue; }
00613 
00618     public:
00619 
00623         void    SetPageDataPtr(void *pData);
00624 
00628         void*   GetPageDataPtr() const;
00629 
00631 
00636 
00640         bool PushPropertiesToParentInstance();
00641 
00642 
00644 
00649     public:
00653         bool    IsAReferenceTo(void) const;
00654 
00658         void*   GetReferenceTo(void) const;
00659 
00663         bool    IsReferencedBy(void) const;
00664 
00668         int     GetReferencedByCount(void) const;
00669 
00674         void*   GetReferencedBy(int pIndex) const; 
00676 
00677 
00678     private:
00679         KFbxPropertyPage*       mPage;
00680         kFbxPropertyId          mId;
00681 
00682     };
00683 
00684     // Internal Allocator Function
00685     KFBX_DLL KMemoryAllocator & GetConnectionPointAllocator();
00686 
00687 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00688 
00689 #endif // FBXFILESDK_FBXCORE_KFBXPROPERTYHANDLE_H
00690