kfbxclonemanager.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002 
00003    Copyright (C) 2010 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 
00015 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXCLONEMANAGER_H
00016 #define FBXFILESDK_KFBXPLUGINS_KFBXCLONEMANAGER_H
00017 
00018 
00019 #include <fbxfilesdk/fbxfilesdk_def.h>
00020 
00021 #include <fbxfilesdk/kfbxplugins/kfbxobject.h>
00022 #include <fbxfilesdk/fbxcore/kfbxquery.h>
00023 #include <fbxfilesdk/fbxcore/fbxcollection/kfbxpropertymap.h>
00024 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00025 
00026 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00027 
00051 class KFBX_DLL KFbxCloneManager
00052 {
00053 public:
00054 
00056     static const int sMaximumCloneDepth;
00057 
00061     static const int sConnectToOriginal;
00062 
00067     static const int sConnectToClone;
00068 
00075     struct KFBX_DLL CloneSetElement
00076     {
00077     public:
00085         CloneSetElement( int pSrcPolicy = 0,
00086                          int pExternalDstPolicy = 0,
00087                          KFbxObject::ECloneType pCloneType = KFbxObject::eREFERENCE_CLONE );
00088 
00090         KFbxObject::ECloneType mType;
00091 
00095         int mSrcPolicy;
00096 
00101         int mExternalDstPolicy;
00102 
00106         KFbxObject* mObjectClone;
00107     };
00108 
00111     class KFBX_DLL KFbxObjectCompare
00112     {
00113     public:
00118         inline int operator()(KFbxObject* const& pKeyA, KFbxObject* const& pKeyB) const
00119         {
00120             return (pKeyA < pKeyB) ? -1 : ((pKeyB < pKeyA) ? 1 : 0);
00121         }
00122     };
00123 
00129     typedef KMap<KFbxObject*,CloneSetElement,KFbxObjectCompare> CloneSet;
00130 
00133     KFbxCloneManager();
00134 
00137     virtual ~KFbxCloneManager();
00138 
00146     virtual bool Clone( CloneSet& pSet, KFbxObject* pContainer = NULL ) const;
00147 
00157     virtual void AddDependents( CloneSet& pSet,
00158                         const KFbxObject* pObject,
00159                         const CloneSetElement& pCloneOptions = CloneSetElement(),
00160                         KFbxCriteria pTypes = KFbxCriteria::ObjectType(KFbxObject::ClassId),
00161                         int pDepth = sMaximumCloneDepth ) const;
00162 
00163 
00165 //
00166 //  WARNING!
00167 //
00168 //  Anything beyond these lines may not be documented accurately and is
00169 //  subject to change without notice.
00170 //
00172 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00173     protected:
00174         bool CloneConnections( CloneSet::RecordType* pIterator, const CloneSet& pSet ) const;
00175 
00176 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00177 };
00178 
00179 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00180 
00181 #endif // FBXFILESDK_KFBXPLUGINS_KFBXCLONEMANAGER_H
00182