fbxsdk/utils/fbxclonemanager.h Source File
 
 
 
fbxsdk/utils/fbxclonemanager.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_UTILS_CLONE_MANAGER_H_
00014 #define _FBXSDK_UTILS_CLONE_MANAGER_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/fbxobject.h>
00019 #include <fbxsdk/core/fbxquery.h>
00020 
00021 #include <fbxsdk/fbxsdk_nsbegin.h>
00022 
00046 class FBXSDK_DLL FbxCloneManager
00047 {
00048 public:
00049 
00051     static const int sMaximumCloneDepth;
00052 
00056     static const int sConnectToOriginal;
00057 
00062     static const int sConnectToClone;
00063 
00070     struct FBXSDK_DLL CloneSetElement
00071     {
00072     public:
00080         CloneSetElement( int pSrcPolicy = 0,
00081                          int pExternalDstPolicy = 0,
00082                          FbxObject::ECloneType pCloneType = FbxObject::eReferenceClone );
00083 
00085         FbxObject::ECloneType mType;
00086 
00090         int mSrcPolicy;
00091 
00096         int mExternalDstPolicy;
00097 
00101         FbxObject* mObjectClone;
00102     };
00103 
00106     class FBXSDK_DLL ObjectCompare
00107     {
00108     public:
00113         inline int operator()(FbxObject* const& pKeyA, FbxObject* const& pKeyB) const
00114         {
00115             return (pKeyA < pKeyB) ? -1 : ((pKeyB < pKeyA) ? 1 : 0);
00116         }
00117     };
00118 
00124     typedef FbxMap<FbxObject*,CloneSetElement,ObjectCompare> CloneSet;
00125 
00128     FbxCloneManager();
00129 
00132     virtual ~FbxCloneManager();
00133 
00198     static FbxObject* Clone(const FbxObject* pObject, FbxObject* pContainer = NULL);
00199 
00207     virtual bool Clone( CloneSet& pSet, FbxObject* pContainer = NULL ) const;
00208 
00218     virtual void AddDependents( CloneSet& pSet,
00219                         const FbxObject* pObject,
00220                         const CloneSetElement& pCloneOptions = CloneSetElement(),
00221                         FbxCriteria pTypes = FbxCriteria::ObjectType(FbxObject::ClassId),
00222                         int pDepth = sMaximumCloneDepth ) const;
00223 
00224 /*****************************************************************************************************************************
00225 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00226 *****************************************************************************************************************************/
00227 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00228 protected:
00229         bool CloneConnections( CloneSet::RecordType* pIterator, const CloneSet& pSet ) const;
00230 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00231 };
00232 
00233 #include <fbxsdk/fbxsdk_nsend.h>
00234 
00235 #endif /* _FBXSDK_UTILS_CLONE_MANAGER_H_ */