fbxsdk/utils/fbxclonemanager.h Source File

fbxclonemanager.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_UTILS_CLONE_MANAGER_H_
14 #define _FBXSDK_UTILS_CLONE_MANAGER_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxobject.h>
19 #include <fbxsdk/core/fbxquery.h>
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
51 {
52 public:
53 
55  static const int sMaximumCloneDepth;
56 
60  static const int sConnectToOriginal;
61 
66  static const int sConnectToClone;
67 
75  {
76  public:
84  CloneSetElement( int pSrcPolicy = 0,
85  int pExternalDstPolicy = 0,
87 
90 
95 
101 
106 
111  };
112 
119 
122  FbxCloneManager();
123 
126  virtual ~FbxCloneManager();
127 
195  static FbxObject* Clone(const FbxObject* pObject, FbxObject* pContainer = NULL);
196 
224  virtual bool Clone( CloneSet& pSet, FbxObject* pContainer = NULL ) const;
225 
252  virtual void AddDependents( CloneSet& pSet,
253  const FbxObject* pObject,
254  const CloneSetElement& pCloneOptions = CloneSetElement(),
256  int pDepth = sMaximumCloneDepth ) const;
257 
258 /*****************************************************************************************************************************
259 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
260 *****************************************************************************************************************************/
261 #ifndef DOXYGEN_SHOULD_SKIP_THIS
262  static FbxObject* Clone(const FbxObject* pObject, CloneSet* pSet, FbxObject* pContainer = NULL);
263 
264 private:
265  friend class FbxScene;
266 
267  bool ReAssignLayerElements( FbxCloneManager::CloneSet::RecordType* pIterator, const FbxCloneManager::CloneSet& pSet) const;
268  bool CloneConnections( CloneSet::RecordType* pIterator, const CloneSet& pSet) const;
269  bool CheckIfCloneOnSameScene(const FbxObject* pObject, FbxObject* pContainer) const;
270 
271  virtual void LookForIndirectDependent(const FbxObject* pObject, CloneSet& pSet, FbxArray<FbxObject*>& lIndirectDepend);
272  virtual bool NeedToBeExcluded(FbxObject* lObj) const;
273 
274  bool mCloneOnSameScene;
275 
276 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
277 };
278 
279 #include <fbxsdk/fbxsdk_nsend.h>
280 
281 #define CloneSetCast(x) ((FbxCloneManager::CloneSet*)(x))
282 #define CloneSetElementCast(x) ((FbxCloneManager::CloneSetElement*)((x!=NULL)?&(x->GetValue()):NULL))
283 
284 #endif /* _FBXSDK_UTILS_CLONE_MANAGER_H_ */
FBX SDK environment definition.
#define NULL
Definition: fbxarch.h:210
ECloneType
Types of clones that can be created for FbxObject.
Definition: fbxobject.h:245
static const int sConnectToClone
Connect to clones of objects that are connected to original object.
Changes to original object properties propagate to clone.
Definition: fbxobject.h:248
bool mLayerElementProcessed
Internal use.
This represents an element in FbxCloneManager::CloneSet to be cloned.
The clone manager is a utility for cloning entire networks of FbxObject.
This class implements an efficient map based on key comparison, which stores key-value pairs...
Definition: fbxmap.h:68
static FbxCriteria ObjectType(const FbxClassId &pClassId)
Creates a new query criteria that only selects objects which have a specific class ID or derive from ...
static FbxClassId ClassId
Definition: fbxobject.h:159
FbxMap< FbxObject *, CloneSetElement > CloneSet
The CloneSet is a collection of pointers to objects that will be cloned in Clone() Attached to each o...
The base class of most FBX objects.
Definition: fbxobject.h:157
int mSrcPolicy
Policy on how to handle source connections on the original object.
static const int sConnectToOriginal
Connect to objects that are connected to original object.
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
Defines a filtering criteria for a query of objects, connections and properties, so that only those s...
Definition: fbxquery.h:104
FbxObject * mObjectClone
This is a pointer to the newly created clone.
#define FBXSDK_DLL
Definition: fbxarch.h:173
int mExternalDstPolicy
policy on how to handle destination connections on the original object to objects NOT in the clone se...
static const int sMaximumCloneDepth
Maximum depth to clone dependents.
FbxObject::ECloneType mType
the type of cloning to perform
StorageType::RecordType RecordType
Definition: fbxmap.h:98
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23