kfbxproperty.h

Go to the documentation of this file.
00001 
00003 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXPROPERTY_H
00004 #define FBXFILESDK_KFBXPLUGINS_KFBXPROPERTY_H
00005 
00006 /**************************************************************************************
00007 
00008  Copyright (C) 2001 - 2010 Autodesk, Inc. and/or its licensors.
00009  All Rights Reserved.
00010 
00011  The coded instructions, statements, computer programs, and/or related material 
00012  (collectively the "Data") in these files contain unpublished information 
00013  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00014  Canada and United States of America federal copyright law and by international 
00015  treaties. 
00016  
00017  The Data may not be disclosed or distributed to third parties, in whole or in
00018  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00019 
00020  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00021  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00022  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00023  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00024  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00025  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00026  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00027  
00028  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00029  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00030  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00031  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00032  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00033  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00034  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00035  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00036  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00037  OR DAMAGE. 
00038 
00039 **************************************************************************************/
00040 #include <fbxfilesdk/fbxfilesdk_def.h>
00041 
00042 #include <fbxfilesdk/kfbxplugins/kfbxplug.h>
00043 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00044 
00045 // FBX includes
00046 #include <fbxfilesdk/components/kfcurve/kfcurvenode.h>
00047 #include <fbxfilesdk/kfbxplugins/kfbxdatatypes.h>
00048 #include <fbxfilesdk/fbxcore/kfbxpropertydef.h>
00049 
00050 // FBX namespace
00051 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00052 
00053 // Forward declarations
00054 class KFbxObject;
00055 class KFbxColor;
00056 class KFbxCriteria;
00057 class KFbxAnimLayer;
00058 class KFbxAnimCurveNode;
00059 class KFbxAnimCurve;
00060 
00064     class KFBX_DLL KFbxProperty : private FbxPropertyFlags
00065     {
00070         public:
00071             using FbxPropertyFlags::eFbxPropertyFlags;
00072             using FbxPropertyFlags::eNO_FLAG;
00073             using FbxPropertyFlags::eANIMATABLE;
00074             using FbxPropertyFlags::eUSER;
00075             using FbxPropertyFlags::eTEMPORARY;
00076             using FbxPropertyFlags::ePUBLISHED;
00077             using FbxPropertyFlags::ePSTATIC;
00078 
00079             using FbxPropertyFlags::eNOT_SAVABLE;
00080             using FbxPropertyFlags::eHIDDEN;
00081 
00082             using FbxPropertyFlags::eUI_DISABLED;
00083             using FbxPropertyFlags::eUI_GROUP;
00084             using FbxPropertyFlags::eUI_BOOLGROUP;
00085             using FbxPropertyFlags::eUI_EXPANDED;
00086             using FbxPropertyFlags::eUI_NOCAPTION;
00087             using FbxPropertyFlags::eUI_PANEL;
00088             using FbxPropertyFlags::eUI_HIDDEN;
00089 
00090             typedef FbxPropertyFlags::eFbxPropertyFlags EFlags;
00091 
00100             static KFbxProperty Create(KFbxProperty const &pCompoundProperty, KFbxDataType const &pDataType, char const* pName, char const* pLabel="", bool pCheckForDup=true, bool* pWasFound=NULL);
00101 
00110             static KFbxProperty Create(KFbxObject* pObject, KFbxDataType const &pDataType, char const* pName, char const* pLabel="", bool pCheckForDup=true, bool* pWasFound=NULL);
00111 
00118             static KFbxProperty CreateFrom(KFbxProperty const& pCompoundProperty, KFbxProperty& pFromProperty, bool pCheckForDup=true);
00119 
00126             static KFbxProperty CreateFrom(KFbxObject* pObject, KFbxProperty& pFromProperty, bool pCheckForDup=true);
00127 
00130             void Destroy();
00131 
00135             void DestroyRecursively();
00136 
00140             void DestroyChildren();
00141 
00144             KFbxProperty();
00145 
00149             KFbxProperty(KFbxProperty const &pProperty);
00150 
00154             KFbxProperty(KFbxPropertyHandle const &pPropertyHandle);
00155 
00158             ~KFbxProperty();
00159 
00160         public:
00162 
00167         public:
00171             KFbxDataType        GetPropertyDataType() const;
00172 
00176             KString         GetName() const;
00177 
00181             KString             GetHierarchicalName() const;
00182 
00192             KString         GetLabel(bool pReturnNameIfEmpty=true) const;
00193 
00194 
00198             void                SetLabel(const KString & pLabel);
00199 
00203             KFbxObject*         GetFbxObject() const;
00204 
00206 
00214             void                SetUserTag(int pTag);
00215                 
00217             int                 GetUserTag();
00218 
00222             void  SetUserDataPtr(void* pUserData);
00223 
00227             void* GetUserDataPtr();
00229 
00238             void ModifyFlag(eFbxPropertyFlags pFlag, bool pValue);
00239 
00244             bool GetFlag(eFbxPropertyFlags pFlag) const;
00245 
00250             KFbxInheritType GetFlagInheritType( eFbxPropertyFlags pFlag ) const;
00251 
00257             bool SetFlagInheritType( eFbxPropertyFlags pFlag, KFbxInheritType pType );
00258 
00263             bool ModifiedFlag( eFbxPropertyFlags pFlag ) const;
00265 
00270 
00275             KFbxProperty &      operator=  (KFbxProperty const &pKProperty);
00276 
00281             bool                operator== (KFbxProperty const &pKProperty) const;
00282 
00287             bool                operator!= (KFbxProperty const &pKProperty) const;
00288 
00293             inline bool         operator== (int pValue) const { return pValue==0 ? !IsValid() : IsValid(); }
00294 
00299             inline bool         operator!= (int pValue) const { return pValue!=0 ? !IsValid() : IsValid(); }
00300 
00305             bool CompareValue(KFbxProperty const& pProp) const;
00307 
00312         bool CopyValue(KFbxProperty const& pProp);
00313 
00318         public:
00319 
00323             bool            IsValid() const;
00324 
00333             static bool HasDefaultValue( KFbxProperty& pProperty );
00334 
00341             bool Set(void const *pValue,EFbxType pValueType, bool pCheckForValueEquality);
00342 
00348             inline bool Set(void const *pValue,EFbxType pValueType) { return Set( pValue, pValueType, true ); }
00349 
00355             bool Get(void *pValue,EFbxType pValueType) const;
00356 
00361             template <class T> inline bool  Set( T const &pValue )  { return Set( &pValue,FbxTypeOf(pValue), true ); }
00362 
00367             template <class T> inline T     Get( T const *pFBX_TYPE) const { T lValue; Get( &lValue,FbxTypeOf(lValue) ); return lValue; }
00368 
00374             KFbxInheritType GetValueInheritType() const;
00375 
00386             bool SetValueInheritType( KFbxInheritType pType );
00387 
00395             bool Modified() const;
00396 
00398 
00407         public:
00411             void                SetMinLimit(double pMin);
00412 
00417          bool           HasMinLimit() const;
00418 
00422             double          GetMinLimit() const;
00423 
00428          bool           HasMaxLimit() const;
00429 
00433             void                SetMaxLimit(double pMax);
00434 
00438             double          GetMaxLimit() const;
00439 
00444             void                SetLimits(double pMin, double pMax);
00446 
00451         public:
00458             int                 AddEnumValue(char const *pStringValue);
00459 
00467             void                InsertEnumValue(int pIndex, char const *pStringValue);
00468 
00473             int                 GetEnumCount() const;
00474 
00483             void                SetEnumValue(int pIndex, char const *pStringValue);
00484 
00489             void                RemoveEnumValue(int pIndex);
00490 
00495             const char *              GetEnumValue(int pIndex) const;
00497 
00505             inline bool                 IsRoot() const                                          { return mPropertyHandle.IsRoot(); }
00506 
00511             inline bool                 IsChildOf(KFbxProperty  const & pParent) const          { return mPropertyHandle.IsChildOf(pParent.mPropertyHandle); }
00512 
00517             inline bool                 IsDescendentOf(KFbxProperty const & pAncestor) const    { return mPropertyHandle.IsDescendentOf(pAncestor.mPropertyHandle); }
00518 
00522             inline KFbxProperty         GetParent() const                                       { return KFbxProperty(mPropertyHandle.GetParent());  }
00523 
00528             bool                        SetParent( const KFbxProperty& pOther );
00529 
00533             inline KFbxProperty         GetChild() const                                        { return KFbxProperty(mPropertyHandle.GetChild());   }
00534 
00538             inline KFbxProperty         GetSibling() const                                      { return KFbxProperty(mPropertyHandle.GetSibling()); }
00539 
00543             inline KFbxProperty         GetFirstDescendent() const                              { return KFbxProperty(mPropertyHandle.GetFirstDescendent());   }
00544 
00549             inline KFbxProperty         GetNextDescendent(KFbxProperty const &pProperty) const  { return KFbxProperty(mPropertyHandle.GetNextDescendent(pProperty.mPropertyHandle)); }
00550 
00557             inline KFbxProperty         Find (char const *pName,bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,pCaseSensitive));  }
00558 
00566             inline KFbxProperty         Find (char const *pName,KFbxDataType const &pDataType, bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,pDataType.GetTypeInfoHandle(),pCaseSensitive));  }
00567 
00574             inline KFbxProperty         FindHierarchical (char const *pName,bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,sHierarchicalSeparator,pCaseSensitive));  }
00575 
00583             inline KFbxProperty         FindHierarchical (char const *pName,KFbxDataType const &pDataType, bool pCaseSensitive = true) const { return KFbxProperty(mPropertyHandle.Find(pName,sHierarchicalSeparator,pDataType.GetTypeInfoHandle(),pCaseSensitive));  }
00584 
00586 
00591 
00592             inline void     BeginCreateOrFindProperty() { mPropertyHandle.BeginCreateOrFindProperty();  }
00593 
00595             inline void     EndCreateOrFindProperty()   { mPropertyHandle.EndCreateOrFindProperty();    }
00596 
00598          struct KFbxPropertyNameCache
00599          {
00603             KFbxPropertyNameCache(const KFbxProperty& prop) :
00604                mProp(const_cast<KFbxProperty&>(prop))
00605             {
00606                mProp.BeginCreateOrFindProperty();
00607             }
00608 
00610             ~KFbxPropertyNameCache()
00611             {
00612                mProp.EndCreateOrFindProperty();
00613             }
00614 
00615          private:
00616             KFbxProperty & mProp;
00617 
00618             KFbxPropertyNameCache& operator=(const KFbxPropertyNameCache &other) { mProp = other.mProp; mProp.BeginCreateOrFindProperty(); return *this; }
00619          };
00621 
00630             bool            SetArraySize( int pSize, bool pVariableArray );
00631 
00633             int             GetArraySize() const;
00634 
00639             KFbxProperty    GetArrayItem(int pIndex) const;
00640 
00645             inline KFbxProperty operator[](int pIndex) const { return GetArrayItem(pIndex); }
00647 
00655             K_DEPRECATED
00656             KFCurveNode* CreateKFCurveNode(const char* pTakeName=NULL);
00657 
00665             K_DEPRECATED
00666             KFCurveNode* GetKFCurveNode(bool pCreateAsNeeded=false, const char* pTakeName=NULL);
00667 
00676             K_DEPRECATED
00677             KFCurve* GetKFCurve(const char* pChannel = NULL, bool pCreateAsNeeded=true);
00678 
00689             K_DEPRECATED
00690             KFCurve* GetKFCurve(const char* pChannel, const char* pTakeName, bool pCreateAsNeeded=true);
00692 
00705             KFbxAnimCurveNode* CreateCurveNode(KFbxAnimLayer* pAnimLayer);
00706 
00715             KFbxAnimCurveNode* GetCurveNode(KFbxAnimLayer* pAnimLayer, bool pCreateAsNeeded=false);
00716 
00722             KFbxAnimCurveNode* GetCurveNode(bool pCreateAsNeeded=false, const char* pAnimStackName = NULL);
00723 
00737             template <class T> inline T* GetCurve(KFbxAnimLayer* pAnimLayer, bool pCreateAsNeeded=false)
00738             {
00739                 return KFbxCast<T>(GetCurve(pAnimLayer, GetName(), NULL, pCreateAsNeeded));
00740             }
00741 
00757             template <class T> inline T* GetCurve(KFbxAnimLayer* pAnimLayer, const char* pChannel, bool pCreateAsNeeded=false)
00758             {
00759                 return KFbxCast<T>(GetCurve(pAnimLayer, GetName(), pChannel, pCreateAsNeeded));
00760             }
00761 
00779             template <class T> inline T* GetCurve(KFbxAnimLayer* pAnimLayer, const char* pName, const char* pChannel, bool pCreateAsNeeded=false)
00780             {
00781                 return KFbxCast<T>(GetCurve(pAnimLayer, pName, pChannel, pCreateAsNeeded));
00782             }
00784 
00789         public:
00790             // SrcObjects
00796             bool ConnectSrcObject       (KFbxObject* pObject,kFbxConnectionType pType=eFbxConnectionNone);
00797 
00802             bool IsConnectedSrcObject   (const KFbxObject* pObject) const;
00803 
00808             bool DisconnectSrcObject    (KFbxObject* pObject);
00809 
00813             bool DisconnectAllSrcObject();
00814 
00819             bool DisconnectAllSrcObject(KFbxCriteria const &pCriteria);
00820 
00825             bool DisconnectAllSrcObject(const kFbxClassId& pClassId);
00826 
00832             bool DisconnectAllSrcObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria);
00833 
00837             int GetSrcObjectCount()const;
00838 
00843             int GetSrcObjectCount(KFbxCriteria const &pCriteria)const;
00844 
00849             int GetSrcObjectCount(const kFbxClassId& pClassId)const;
00850 
00856             int GetSrcObjectCount(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria)const;
00857 
00862             KFbxObject* GetSrcObject(int pIndex=0) const;
00863 
00869             KFbxObject* GetSrcObject(KFbxCriteria const &pCriteria,int pIndex=0) const;
00870 
00876             KFbxObject* GetSrcObject(const kFbxClassId& pClassId,int pIndex=0) const;
00877 
00884             KFbxObject* GetSrcObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,int pIndex=0) const;
00885 
00891             KFbxObject* FindSrcObject(const char *pName,int pStartIndex=0) const;
00892 
00899             KFbxObject* FindSrcObject(KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
00900 
00907             KFbxObject* FindSrcObject(const kFbxClassId& pClassId,const char *pName,int pStartIndex=0) const;
00908 
00916             KFbxObject* FindSrcObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
00917 
00922             template < class T > inline bool DisconnectAllSrcObject (T const *pFBX_TYPE){ return DisconnectAllSrcObject(T::ClassId);}
00923 
00929             template < class T > inline bool DisconnectAllSrcObject (T const *pFBX_TYPE,KFbxCriteria const &pCriteria)  { return DisconnectAllSrcObject(T::ClassId,pCriteria);  }
00930 
00935             template < class T > inline int  GetSrcObjectCount(T const *pFBX_TYPE) const{ return GetSrcObjectCount(T::ClassId); }
00936 
00942             template < class T > inline int  GetSrcObjectCount(T const *pFBX_TYPE,KFbxCriteria const &pCriteria) const { return GetSrcObjectCount(T::ClassId,pCriteria); }
00943 
00949             template < class T > inline T*   GetSrcObject(T const *pFBX_TYPE,int pIndex=0) const { return (T*)GetSrcObject(T::ClassId,pIndex); }
00950 
00957             template < class T > inline T*   GetSrcObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,int pIndex=0) const { return (T*)GetSrcObject(T::ClassId,pCriteria,pIndex); }
00958 
00965             template < class T > inline T*   FindSrcObject(T const *pFBX_TYPE,const char *pName,int pStartIndex=0) const { return (T*)FindSrcObject(T::ClassId,pName,pStartIndex); }
00966 
00974             template < class T > inline T*   FindSrcObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const { return (T*)FindSrcObject(T::ClassId,pCriteria,pName,pStartIndex); }
00975 
00976             // DstObjects
00982             bool ConnectDstObject       (KFbxObject* pObject,kFbxConnectionType pType=eFbxConnectionNone);
00983 
00988             bool IsConnectedDstObject   (const KFbxObject* pObject) const;
00989 
00994             bool DisconnectDstObject    (KFbxObject* pObject);
00995 
00999             bool DisconnectAllDstObject();
01000 
01005             bool DisconnectAllDstObject(KFbxCriteria const &pCriteria);
01006 
01011             bool DisconnectAllDstObject(const kFbxClassId& pClassId);
01012 
01018             bool DisconnectAllDstObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria);
01019 
01023             int GetDstObjectCount() const;
01024 
01029             int GetDstObjectCount(KFbxCriteria const &pCriteria) const;
01030 
01035             int GetDstObjectCount(const kFbxClassId& pClassId) const;
01036 
01042             int GetDstObjectCount(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria) const;
01043 
01048             KFbxObject* GetDstObject(int pIndex=0) const;
01049 
01055             KFbxObject* GetDstObject(KFbxCriteria const &pCriteria,int pIndex=0) const;
01056 
01062             KFbxObject* GetDstObject(const kFbxClassId& pClassId,int pIndex=0) const;
01063 
01070             KFbxObject* GetDstObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,int pIndex=0)const;
01071 
01077             KFbxObject* FindDstObject(const char *pName,int pStartIndex=0) const;
01078 
01085             KFbxObject* FindDstObject(KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01086 
01093             KFbxObject* FindDstObject(const kFbxClassId& pClassId,const char *pName,int pStartIndex=0) const;
01094 
01102             KFbxObject* FindDstObject(const kFbxClassId& pClassId,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01103 
01108             template < class T > inline bool DisconnectAllDstObject (T const *pFBX_TYPE){ return DisconnectAllDstObject(T::ClassId);    }
01109 
01115             template < class T > inline bool DisconnectAllDstObject (T const *pFBX_TYPE,KFbxCriteria const &pCriteria)  { return DisconnectAllDstObject(T::ClassId,pCriteria);  }
01116 
01121             template < class T > inline int  GetDstObjectCount(T const *pFBX_TYPE) const { return GetDstObjectCount(T::ClassId); }
01122 
01128             template < class T > inline int  GetDstObjectCount(T const *pFBX_TYPE,KFbxCriteria const &pCriteria) const { return GetDstObjectCount(T::ClassId,pCriteria); }
01129 
01135             template < class T > inline T*   GetDstObject(T const *pFBX_TYPE,int pIndex=0) const { return (T*)GetDstObject(T::ClassId,pIndex); }
01136 
01143             template < class T > inline T*   GetDstObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,int pIndex=0) const { return (T*)GetDstObject(T::ClassId,pCriteria,pIndex); }
01144 
01151             template < class T > inline T*   FindDstObject(T const *pFBX_TYPE,const char *pName,int pStartIndex=0) const { return (T*)FindDstObject(T::ClassId,pName,pStartIndex); }
01152 
01160             template < class T > inline T*   FindDstObject(T const *pFBX_TYPE,KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const { return (T*)FindDstObject(T::ClassId,pCriteria,pName,pStartIndex); }
01162 
01167         public:
01168             // Properties
01173             bool            ConnectSrcProperty      (KFbxProperty const & pProperty);
01174 
01179             bool            IsConnectedSrcProperty  (KFbxProperty const & pProperty);
01180 
01185             bool            DisconnectSrcProperty   (KFbxProperty const & pProperty);
01186 
01190             int             GetSrcPropertyCount     () const;
01191 
01196             KFbxProperty    GetSrcProperty          (int pIndex=0) const;
01197 
01203             KFbxProperty    FindSrcProperty         (const char *pName,int pStartIndex=0) const;
01204 
01209             bool            ConnectDstProperty      (KFbxProperty const & pProperty);
01210 
01215             bool            IsConnectedDstProperty  (KFbxProperty const & pProperty);
01216 
01221             bool            DisconnectDstProperty   (KFbxProperty const & pProperty);
01222 
01226             int             GetDstPropertyCount     () const;
01227 
01232             KFbxProperty    GetDstProperty          (int pIndex=0) const;
01233 
01239             KFbxProperty    FindDstProperty         (const char *pName,int pStartIndex=0) const;
01240 
01242             void            ClearConnectCache();
01243 
01245 
01247         static const char* sHierarchicalSeparator;
01248 
01250         //  WARNING!
01251         //  Anything beyond these lines may not be documented accurately and is
01252         //  subject to change without notice.
01254         #ifndef DOXYGEN_SHOULD_SKIP_THIS
01255 
01256         protected:
01258             KFbxProperty(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType=KFbxDataType(), char const* pLabel="");
01259             KFbxProperty(KFbxProperty const & pParent, char const* pName, KFbxDataType const &pDataType, char const* pLabel);
01260 
01261         // General Property Connection and Relationship Management
01262         private:
01263             bool            ConnectSrc      (KFbxProperty const &pProperty,kFbxConnectionType pType=eFbxConnectionNone);
01264             bool            DisconnectSrc   (KFbxProperty const &pProperty);
01265             bool            DisconnectAllSrc();
01266             bool            DisconnectAllSrc(KFbxCriteria const &pCriteria);
01267             bool            IsConnectedSrc  (KFbxProperty const &pProperty) const;
01268             int             GetSrcCount     () const;
01269             int             GetSrcCount     (KFbxCriteria const &pCriteria) const;
01270             KFbxProperty    GetSrc          (int pIndex=0) const;
01271             KFbxProperty    GetSrc          (KFbxCriteria const &pCriteria,int pIndex=0) const;
01272             KFbxProperty    FindSrc         (KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01273 
01274             bool            ConnectDst      (KFbxProperty const &pProperty,kFbxConnectionType pType=eFbxConnectionNone);
01275             bool            DisconnectDst   (KFbxProperty const &pProperty);
01276             bool            DisconnectAllDst();
01277             bool            DisconnectAllDst(KFbxCriteria const &pCriteria);
01278             bool            IsConnectedDst  (KFbxProperty const &pProperty) const;
01279             int             GetDstCount     () const;
01280             int             GetDstCount     (KFbxCriteria const &pCriteria) const;
01281             KFbxProperty    GetDst          (int pIndex=0) const;
01282             KFbxProperty    GetDst          (KFbxCriteria const &pCriteria,int pIndex=0) const;
01283             KFbxProperty    FindDst         (KFbxCriteria const &pCriteria,const char *pName,int pStartIndex=0) const;
01284 
01285             KFbxAnimCurve*  GetCurve(KFbxAnimLayer* pAnimLayer, const char* pName, const char* pChannel, bool pCreateAsNeeded);
01286 
01287         private:
01289             mutable KFbxPropertyHandle  mPropertyHandle;
01290 
01291             friend class KFbxObject;
01292         #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
01293     };
01294 
01295     typedef KFbxProperty* HKFbxProperty;
01296 
01297     template <class T> inline bool  KFbxSet( KFbxProperty &pProperty,T const &pValue, bool pCheckValueEquality = true ) { return pProperty.Set( &pValue,FbxTypeOf(pValue),pCheckValueEquality ); }
01298     template <class T> inline bool  KFbxGet( KFbxProperty const& pProperty,T &pValue ) { return pProperty.Get( &pValue,FbxTypeOf(pValue) ); }
01299     template <class T> inline T     KFbxGet( KFbxProperty const& pProperty)            { T pValue; pProperty.Get( &pValue,FbxTypeOf(pValue) ); return pValue; }
01300 
01304     template <class T> class KFbxTypedProperty : public KFbxProperty {
01305         public:
01306 
01311 
01312             inline KFbxTypedProperty() : KFbxProperty()                                         {}
01313 
01317             inline KFbxTypedProperty(KFbxProperty const &pProperty) : KFbxProperty(pProperty)   {}
01318 
01320             inline ~KFbxTypedProperty() {}
01321 
01323 
01324 
01334             inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName,eFbxPropertyFlags pFlags=eNO_FLAG)
01335             {
01336                 *this = Create(pObject, GetFbxDataType(FbxTypeOf(*((T *)0))), pName, "");
01337                 ModifyFlag(pFlags, true);
01338                 return *this;
01339             }
01340 
01348             inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName,T const &pValue,bool pForceSet=true,eFbxPropertyFlags pFlags=eNO_FLAG)
01349             {
01350                 bool lWasFound = false;
01351                 *this = Create(pObject, GetFbxDataType(FbxTypeOf(*((T *)0))), pName, "", true, &lWasFound);
01352 
01353                 if( pForceSet || !lWasFound )
01354                 {
01355                     ModifyFlag(pFlags, true); // modify the flags before we set the value
01356                     Set(pValue,false);
01357                 }
01358 
01359                 return *this;
01360             }
01361 
01368             inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType,eFbxPropertyFlags pFlags=eNO_FLAG)
01369             {
01370                 *this = Create(pObject, pDataType, pName, "");
01371                 ModifyFlag(pFlags, true);
01372                 return *this;
01373             }
01374 
01383             inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType,T const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01384             {
01385                 bool lWasFound = false;
01386                 *this = Create(pObject, pDataType, pName, "", true, &lWasFound);
01387 
01388                 if( pForceSet || !lWasFound )
01389                 {
01390                     ModifyFlag(pFlags, true); // modify the flags before we set the value
01391                     // since we will trigger callbacks in there!
01392                     Set(pValue,false);
01393                 }
01394 
01395                 return *this;
01396             }
01397 
01406             inline KFbxProperty const & StaticInit(KFbxProperty pCompound, char const* pName, KFbxDataType const &pDataType,T const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01407             {
01408                 bool lWasFound = false;
01409                 *this = Create(pCompound, pDataType, pName, "", true, &lWasFound);
01410 
01411                 if( pForceSet || !lWasFound )
01412                 {
01413                     ModifyFlag(pFlags, true); // modify the flags before we set the value
01414                     // since we will trigger callbacks in there!
01415                     Set(pValue,false);
01416                 }
01417 
01418                 return *this;
01419             }
01420 
01422         public:
01423 
01428             KFbxTypedProperty &operator=(T const &pValue)      { KFbxSet(*this,pValue); return *this; }
01429 
01435             bool     Set(T const &pValue, bool pCheckValueEquality )    { return KFbxSet(*this,pValue,pCheckValueEquality); }
01436 
01441             bool     Set(T const &pValue )  { return KFbxSet(*this,pValue,true); }
01442 
01446             T        Get() const            { T lValue; KFbxGet(*this,lValue); return lValue; }
01447 
01448         friend class KFbxObject;
01449     };
01450 
01451     // For use with deprecated type functions
01452     //KFBX_DLL KFbxDataType                       EUserPropertyTypeToDataType(KFbxProperty::EUserPropertyType);
01453     //KFBX_DLL KFbxProperty::EUserPropertyType        DataTypeToEUserPropertyType(const KFbxDataType &pDataType);
01454 
01458     template <> class KFbxTypedProperty<fbxReference*> : public KFbxProperty
01459     {
01460     public:
01465 
01467         inline KFbxTypedProperty() : KFbxProperty()
01468         {}
01469 
01473         inline KFbxTypedProperty(KFbxProperty const &pProperty)
01474             : KFbxProperty(pProperty)
01475         {}
01476 
01478         inline ~KFbxTypedProperty()
01479         {}
01481 
01491         inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, eFbxPropertyFlags pFlags=eNO_FLAG)
01492         {
01493             *this = KFbxProperty::Create(pObject, GetFbxDataType(FbxTypeOf(*((fbxReference* *)0))), pName);
01494             ModifyFlag(pFlags, true);
01495             return *this;
01496         }
01497 
01505         inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, fbxReference* const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01506         {
01507             bool lWasFound = false;
01508             *this = KFbxProperty::Create(pObject, GetFbxDataType(FbxTypeOf(*((fbxReference* *)0))), pName, "", true, &lWasFound);
01509             if( pForceSet || !lWasFound )
01510             {
01511                 ModifyFlag(pFlags, true);
01512                 Set(pValue,false);
01513             }
01514             return *this;
01515         }
01516 
01523         inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType, eFbxPropertyFlags pFlags=eNO_FLAG)
01524         {
01525             *this = KFbxProperty::Create(pObject, pDataType, pName, "");
01526 //          KFbxProperty::StaticInit(pObject, pName, pDataType, "");
01527             ModifyFlag(pFlags, true);
01528             return *this;
01529         }
01530 
01539         inline KFbxProperty const & StaticInit(KFbxObject* pObject, char const* pName, KFbxDataType const &pDataType, fbxReference* const &pValue, bool pForceSet=true, eFbxPropertyFlags pFlags=eNO_FLAG)
01540         {
01541             bool lWasFound = false;
01542             *this = KFbxProperty::Create(pObject, pDataType, pName, "", true, &lWasFound);
01543             if( pForceSet || !lWasFound )
01544             {
01545                 ModifyFlag(pFlags, true);
01546                 Set(pValue,false);
01547             }
01548             return *this;
01549         }
01551 
01552     public:
01553 
01558         KFbxTypedProperty &operator=(fbxReference* const &pValue)
01559         {
01560             KFbxSet(*this,pValue);
01561             return *this;
01562         }
01563 
01571         inline bool Set(fbxReference* const &pValue ) { return Set(pValue, true); }
01572 
01581         bool Set(fbxReference* const &pValue, bool pCheckValueEquality )
01582         {
01583             KFbxObject* lValue = reinterpret_cast<KFbxObject*>(pValue);
01584             DisconnectAllSrcObject();
01585             if (lValue) {
01586                 return ConnectSrcObject(lValue);
01587             }
01588 
01589             return false;
01590         }
01591 
01595         fbxReference* Get() const
01596         {
01597             KFbxObject* lValue = GetSrcObjectCount() > 0 ? GetSrcObject(0) : NULL;
01598             return reinterpret_cast<fbxReference*>(lValue);
01599         }
01600 
01601         friend class KFbxObject;
01602     };
01603 
01604 
01605     typedef KFbxTypedProperty<fbxBool1>         KFbxPropertyBool1;
01606     typedef KFbxTypedProperty<fbxInteger1>      KFbxPropertyInteger1;
01607     typedef KFbxTypedProperty<fbxDouble1>       KFbxPropertyDouble1;
01608     typedef KFbxTypedProperty<fbxDouble3>       KFbxPropertyDouble3;
01609     typedef KFbxTypedProperty<fbxDouble4>       KFbxPropertyDouble4;
01610     typedef KFbxTypedProperty<fbxString>        KFbxPropertyString;
01611     typedef KFbxTypedProperty<fbxReference*>    KFbxPropertyReference;
01612 
01621     enum eFbxConnectEventType {
01622         eFbxConnectRequest,
01623         eFbxConnect,
01624         eFbxConnected,
01625         eFbxDisconnectRequest,
01626         eFbxDisconnect,
01627         eFbxDisconnected
01628     };
01629 
01634     enum eFbxConnectEventDirection {
01635         eConnectEventSrc,
01636         eConnectEventDst
01637     };
01638 
01642     class KFBX_DLL KFbxConnectEvent
01643     {
01648         public:
01649 
01656             inline KFbxConnectEvent(eFbxConnectEventType pType,eFbxConnectEventDirection pDir,KFbxProperty *pSrc,KFbxProperty *pDst)
01657                 : mType(pType)
01658                 , mDirection(pDir)
01659                 , mSrc(pSrc)
01660                 , mDst(pDst)
01661             {
01662             }
01664 
01669         public:
01670 
01672             inline eFbxConnectEventType GetType() const { return mType; }
01673 
01675             inline eFbxConnectEventDirection GetDirection() const { return mDirection; }
01676 
01678             inline KFbxProperty &GetSrc()  const    { return *mSrc;  }
01679 
01681             inline KFbxProperty &GetDst()  const    { return *mDst;  }
01682 
01687             template < class T > inline T*  GetSrcIfObject(T const *pFBX_TYPE) const    { return mSrc->IsRoot() ? KFbxCast<T>(mSrc->GetFbxObject()) : (T*)0; }
01688 
01693             template < class T > inline T*  GetDstIfObject(T const *pFBX_TYPE) const    { return mDst->IsRoot() ? KFbxCast<T>(mDst->GetFbxObject()) : (T*)0; }
01695 
01696         private:
01697             eFbxConnectEventType        mType;
01698             eFbxConnectEventDirection   mDirection;
01699             KFbxProperty*               mSrc;
01700             KFbxProperty*               mDst;
01701     };
01702 
01703 
01704 
01705 #include <fbxfilesdk/fbxfilesdk_nsend.h>
01706 
01707 #endif // FBXFILESDK_KFBXPLUGINS_KFBXPROPERTY_H
01708