fbxsdk/utils/fbxclonemanager.h Source File

fbxclonemanager.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2014 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  };
107 
114 
117  FbxCloneManager();
118 
121  virtual ~FbxCloneManager();
122 
190  static FbxObject* Clone(const FbxObject* pObject, FbxObject* pContainer = NULL);
191 
219  virtual bool Clone( CloneSet& pSet, FbxObject* pContainer = NULL ) const;
220 
247  virtual void AddDependents( CloneSet& pSet,
248  const FbxObject* pObject,
249  const CloneSetElement& pCloneOptions = CloneSetElement(),
250  FbxCriteria pTypes = FbxCriteria::ObjectType(FbxObject::ClassId),
251  int pDepth = sMaximumCloneDepth ) const;
252 
253 /*****************************************************************************************************************************
254 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
255 *****************************************************************************************************************************/
256 #ifndef DOXYGEN_SHOULD_SKIP_THIS
257  static FbxObject* Clone(const FbxObject* pObject, CloneSet* pSet, FbxObject* pContainer = NULL);
258 
259 private:
260  friend class FbxScene;
261 
262  bool ReAssignLayerElements( FbxCloneManager::CloneSet::RecordType* pIterator, const FbxCloneManager::CloneSet& pSet) const;
263  bool CloneConnections( CloneSet::RecordType* pIterator, const CloneSet& pSet) const;
264  bool CheckIfCloneOnSameScene(const FbxObject* pObject, FbxObject* pContainer) const;
265 
266  virtual void LookForIndirectDependent(const FbxObject* pObject, CloneSet& pSet, FbxArray<FbxObject*>& lIndirectDepend);
267  virtual bool NeedToBeExcluded(FbxObject* lObj) const;
268 
269  bool mCloneOnSameScene;
270 
271 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
272 };
273 
274 #include <fbxsdk/fbxsdk_nsend.h>
275 
276 #define CloneSetCast(x) ((FbxCloneManager::CloneSet*)(x))
277 #define CloneSetElementCast(x) ((FbxCloneManager::CloneSetElement*)((x!=NULL)?&(x->GetValue()):NULL))
278 
279 #endif /* _FBXSDK_UTILS_CLONE_MANAGER_H_ */
FBX SDK environment definition.
#define NULL
Definition: fbxarch.h:207
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
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 ...
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:170
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