- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxpropertyhandle.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2013 Autodesk, Inc.
    00004    All rights reserved.
    00005
    00006    Use of this software is subject to the terms of the Autodesk license agreement
    00007    provided at the time of installation or download, or which otherwise accompanies
    00008    this software in either electronic or hard copy form.
    00009
    00010 ****************************************************************************************/
    00011
    00013 #ifndef _FBXSDK_CORE_PROPERTY_HANDLE_H_
    00014 #define _FBXSDK_CORE_PROPERTY_HANDLE_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/fbxconnectionpoint.h>
    00019 #include <fbxsdk/core/fbxpropertytypes.h>
    00020 #include <fbxsdk/core/fbxpropertydef.h>
    00021
    00022 #include <fbxsdk/fbxsdk_nsbegin.h>
    00023
    00024 class FbxPropertyPage;
    00025 class FbxPropertyHandle;
    00026 class FbxConnectionPointFilter;
    00027
    00031 class FBXSDK_DLL FbxPropertyHandle
    00032 {
    00033 public:
    00038
    00039     static FbxPropertyHandle        Create();
    00040
    00044     static FbxPropertyHandle        Create(const FbxPropertyHandle& pInstanceOf);
    00045
    00050     static FbxPropertyHandle    Create(const char* pName, EFbxType pType=eFbxUndefined);
    00051
    00056     static FbxPropertyHandle    Create(const char* pName, FbxPropertyHandle pTypeInfo);
    00057
    00061     bool                        Destroy();
    00062
    00064     FbxPropertyHandle();
    00068     FbxPropertyHandle(const FbxPropertyHandle& pAddress);
    00069
    00071     ~FbxPropertyHandle();
    00072
    00073
    00078     FbxPropertyHandle(FbxPropertyPage* pPage, FbxInt pId=FBXSDK_PROPERTY_ID_ROOT);
    00079
    00080
    00082
    00087
    00088     // Assignment
    00092     FbxPropertyHandle& operator=(const FbxPropertyHandle& pHandle);
    00093
    00098     bool    operator==(const FbxPropertyHandle& pHandle) const;
    00099
    00104     bool    operator!=(const FbxPropertyHandle& pHandle) const;
    00105
    00110     bool    Is(const FbxPropertyHandle& pHandle) const;
    00111
    00113     bool    Valid() const;
    00114
    00116     const char* GetName() const;
    00118     const char* GetLabel() const;
    00123     bool    SetLabel(const char* pLabel);
    00124
    00126     EFbxType            GetType() const;
    00128     FbxPropertyHandle   GetTypeInfo() const;
    00129
    00130     // Flag management
    00132     FbxPropertyAttr::EFlags GetFlags() const;
    00133
    00139     FbxPropertyAttr::EInheritType   GetFlagsInheritType( FbxPropertyAttr::EFlags pFlags, bool pCheckReferences ) const;
    00140
    00146     bool    ModifyFlags(FbxPropertyAttr::EFlags pFlags, bool pValue);
    00147
    00153     bool    SetFlagsInheritType( FbxPropertyAttr::EFlags pFlags, FbxPropertyAttr::EInheritType pType );
    00154
    00156     void*   GetUserData() const;
    00157
    00162     bool    SetUserData(const void* pUserData);
    00163
    00165     int     GetUserTag() const;
    00166
    00171     bool    SetUserTag(int pUserData);
    00173
    00178
    00183     int     AddEnumValue(const char* pStringValue);
    00184
    00189     void    InsertEnumValue(int pIndex, const char* pStringValue);
    00190
    00194     int     GetEnumCount();
    00195
    00200     void    SetEnumValue(int pIndex, const char* pStringValue);
    00201
    00205     void    RemoveEnumValue(int pIndex);
    00206
    00211     char*   GetEnumValue(int pIndex);
    00213
    00214
    00219
    00220
    00221
    00223     void    BeginCreateOrFindProperty();
    00225     void    EndCreateOrFindProperty();
    00226
    00230     inline bool IsRoot() const { return (mPage && (mId==0)) ? true : false; }
    00231
    00236     bool    IsChildOf(const FbxPropertyHandle& pParent) const;
    00237
    00242     bool    IsDescendentOf(const FbxPropertyHandle& pParent) const;
    00243
    00248     bool    SetParent(const FbxPropertyHandle& pOther );
    00249
    00255     FbxPropertyHandle   Add(const char* pName, const FbxPropertyHandle& pTypeInfo);
    00256
    00260     FbxPropertyHandle   GetParent() const;
    00261
    00262
    00263
    00267     FbxPropertyHandle   GetChild()  const;
    00268
    00272     FbxPropertyHandle   GetSibling() const;
    00273
    00277     FbxPropertyHandle   GetFirstDescendent()  const;
    00278
    00284     FbxPropertyHandle   GetNextDescendent(const FbxPropertyHandle& pHandle) const;
    00285
    00291     FbxPropertyHandle   Find(const char* pName, bool pCaseSensitive) const;
    00292
    00299     FbxPropertyHandle   Find(const char* pName, const FbxPropertyHandle& pTypeInfo, bool pCaseSensitive) const;
    00300
    00309     FbxPropertyHandle   Find(const char* pName, const char* pChildrenSeparator, bool pCaseSensitive) const;
    00310
    00320     FbxPropertyHandle   Find(const char* pName, const char* pChildrenSeparator, const FbxPropertyHandle& pTypeInfo, bool pCaseSensitive) const;
    00322
    00327
    00333     bool    ConnectSrc(const FbxPropertyHandle& pSrc, const FbxConnection::EType pType=FbxConnection::eDefault);
    00334
    00340     int     GetSrcCount(FbxConnectionPointFilter* pFilter=0) const;
    00341
    00348     FbxPropertyHandle   GetSrc(FbxConnectionPointFilter* pFilter=0, int pIndex=0) const;
    00349
    00354     bool    DisconnectSrc(const FbxPropertyHandle& pSrc);
    00355
    00360     bool    IsConnectedSrc(const FbxPropertyHandle& pSrc);
    00361
    00367     bool    ConnectDst(const FbxPropertyHandle& pDst, const FbxConnection::EType pType=FbxConnection::eDefault);
    00368
    00374     int     GetDstCount(FbxConnectionPointFilter* pFilter=0) const;
    00375
    00382     FbxPropertyHandle   GetDst(FbxConnectionPointFilter* pFilter=0, int pIndex=0) const;
    00383
    00388     bool    DisconnectDst(const FbxPropertyHandle& pDst);
    00389
    00394     bool    IsConnectedDst(const FbxPropertyHandle& pDst);
    00395
    00397     void    ClearConnectCache();
    00398
    00400     void    WipeAllConnections();
    00402
    00416
    00420     bool    HasMin() const;
    00421
    00427     bool    GetMin(void* pValue, EFbxType pValueType) const;
    00428
    00434     bool    SetMin(const void* pValue, EFbxType pValueType);
    00435
    00440     template <class T> inline bool  SetMin( const T& pValue )           { return SetMin( &pValue,FbxTypeOf(pValue) ); }
    00441
    00447     template <class T> inline T     GetMin( const T* pFBX_TYPE) const   { T lValue; GetMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
    00448
    00452     bool    HasSoftMin() const;
    00453
    00459     bool    GetSoftMin(void* pValue, EFbxType pValueType) const;
    00460
    00466     bool    SetSoftMin(const void* pValue, EFbxType pValueType);
    00467
    00472     template <class T> inline bool  SetSoftMin( const T& pValue )           { return SetSoftMin( &pValue,FbxTypeOf(pValue) ); }
    00473
    00479     template <class T> inline T     GetSoftMin( const T* pFBX_TYPE) const   { T lValue; GetSoftMin( &lValue,FbxTypeOf(lValue) ); return lValue; }
    00480
    00484     bool    HasMax() const;
    00485
    00491     bool    GetMax(void* pValue, EFbxType pValueType) const;
    00492
    00498     bool    SetMax(const void* pValue, EFbxType pValueType);
    00499
    00504     template <class T> inline bool  SetMax( const T& pValue )           { return SetMax( &pValue,FbxTypeOf(pValue) ); }
    00505
    00511     template <class T> inline T     GetMax( const T* pFBX_TYPE) const   { T lValue; GetMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
    00512
    00516     bool    HasSoftMax() const;
    00517
    00523     bool    GetSoftMax(void* pValue, EFbxType pValueType) const;
    00524
    00530     bool    SetSoftMax  (const void* pValue, EFbxType pValueType);
    00531
    00536     template <class T> inline bool  SetSoftMax( const T& pValue )           { return SetSoftMax( &pValue,FbxTypeOf(pValue) ); }
    00537
    00543     template <class T> inline T     GetSoftMax( const T* pFBX_TYPE) const   { T lValue; GetSoftMax( &lValue,FbxTypeOf(lValue) ); return lValue; }
    00544
    00545
    00550
    00555     FbxPropertyAttr::EInheritType   GetValueInheritType(bool pCheckReferences) const;
    00556
    00561     bool    SetValueInheritType(FbxPropertyAttr::EInheritType pType);
    00562
    00568     bool    GetDefaultValue(void* pValue, EFbxType pValueType) const;
    00569
    00575     bool    Get(void* pValue, EFbxType pValueType) const;
    00576
    00584     bool    Set(const void* pValue, EFbxType pValueType, bool pCheckValueEquality);
    00585
    00590     template <class T> inline bool  Set( const T& pValue )          { return Set( &pValue,FbxTypeOf(pValue) ); }
    00591
    00596     template <class T> inline T     Get( const T* pFBX_TYPE) const  { T lValue; Get( &lValue,FbxTypeOf(lValue) ); return lValue; }
    00598
    00603 public:
    00604
    00608     void    SetPageDataPtr(void* pData);
    00609
    00613     void*   GetPageDataPtr() const;
    00614
    00616
    00621
    00625     bool    PushPropertiesToParentInstance();
    00626
    00627
    00629
    00634
    00638     bool    IsAReferenceTo(void) const;
    00639
    00643     void*   GetReferenceTo(void) const;
    00644
    00648     bool    IsReferencedBy(void) const;
    00649
    00653     int     GetReferencedByCount(void) const;
    00654
    00659     void*   GetReferencedBy(int pIndex) const;
    00661
    00662
    00663 private:
    00664     FbxPropertyPage*    mPage;
    00665     FbxInt              mId;
    00666
    00667 };
    00668
    00669 #include <fbxsdk/fbxsdk_nsend.h>
    00670
    00671 #endif /* _FBXSDK_CORE_PROPERTY_HANDLE_H_ */