FBX C++ API Reference
|
#include <fbxclonemanager.h>
The clone manager is a utility for cloning entire networks of FbxObject.
Options are available for specifying how the clones inherit the connections of the original.
Networks of FbxObject (inter-connected objects by OO, OP, PO or PP connections) can be cloned. How the connections of clones are handled depends on mSrcPolicy and mExternalDstPolicy.
To clone FbxObject instances and their dependents, put them into a CloneSet and pass the CloneSet to this class:
Definition at line 50 of file fbxclonemanager.h.
Classes | |
struct | CloneSetElement |
This represents an element in FbxCloneManager::CloneSet to be cloned. More... | |
Public Types | |
typedef FbxMap< FbxObject *, CloneSetElement > | CloneSet |
The CloneSet is a collection of pointers to objects that will be cloned in Clone() Attached to each object is a CloneSetElement. More... | |
Public Member Functions | |
FbxCloneManager () | |
Constructor. More... | |
virtual | ~FbxCloneManager () |
Destructor. More... | |
virtual bool | Clone (CloneSet &pSet, FbxObject *pContainer=((void *) 0)) const |
Clone all objects in the set using the given policies for duplication of connections. More... | |
virtual void | AddDependents (CloneSet &pSet, const FbxObject *pObject, const CloneSetElement &pCloneOptions=CloneSetElement(), FbxCriteria pTypes=FbxCriteria::ObjectType(FbxObject::ClassId), int pDepth=sMaximumCloneDepth) const |
Add all dependents of the given object to the CloneSet. More... | |
Static Public Member Functions | |
static FbxObject * | Clone (const FbxObject *pObject, FbxObject *pContainer=((void *) 0)) |
This function simplifies the process of cloning one object and all its depedency graph by automatically preparing the CloneSet and calling the Clone method using the code below. More... | |
Static Public Attributes | |
static const int | sMaximumCloneDepth |
Maximum depth to clone dependents. More... | |
static const int | sConnectToOriginal |
Connect to objects that are connected to original object. More... | |
static const int | sConnectToClone |
Connect to clones of objects that are connected to original object. More... | |
typedef FbxMap<FbxObject*,CloneSetElement> CloneSet |
The CloneSet is a collection of pointers to objects that will be cloned in Clone() Attached to each object is a CloneSetElement.
Its member variables dictate how the corresponding object will be cloned, and how it will inherit connections on the original object.
Definition at line 118 of file fbxclonemanager.h.
FbxCloneManager | ( | ) |
Constructor.
|
virtual |
Destructor.
This function simplifies the process of cloning one object and all its depedency graph by automatically preparing the CloneSet and calling the Clone method using the code below.
pObject | Object to clone. |
pContainer | This object (typically a scene or document) will contain the new clones. |
NULL
the cloned objects only exists in the FbxSdkManager and need to be manually connected to the scene in order to be saved to disk.Example:
Clone all objects in the set using the given policies for duplication of connections.
Each CloneSetElement in the set will have its mObjectClone pointer set to the newly created clone. The following code shows how to access the cloned objects:
pSet | Set of objects to clone |
pContainer | This object (typically a scene or document) will contain the new clones |
NULL
the cloned objects only exists in the FbxSdkManager and need to be manually connected to the scene in order to be saved to disk.
|
virtual |
Add all dependents of the given object to the CloneSet.
Dependents of items already in the set are ignored to prevent infinite recursion on cyclic dependencies.
pSet | The set to add items. |
pObject | Object to add dependents to |
pCloneOptions | |
pTypes | Types of dependent objects to consider |
pDepth | Maximum recursive depth. Valid range is [0,sMaximumCloneDepth] |
The following example shows how to perform multiple calls to AddDependents() to collect several subgraphs to be cloned:
|
static |
Maximum depth to clone dependents.
Definition at line 55 of file fbxclonemanager.h.
|
static |
Connect to objects that are connected to original object.
This is a flag to mSrcPolicy or mExternalDstPolicy.
Definition at line 60 of file fbxclonemanager.h.
|
static |
Connect to clones of objects that are connected to original object.
(only if those original objects are also in the clone set) This is a flag to mSrcPolicy.
Definition at line 66 of file fbxclonemanager.h.