Assimp  v3.1.1 (June 2014)
Assimp::SceneCombiner Class Reference

Static helper class providing various utilities to merge two scenes. More...

Static Public Member Functions

static void AddNodePrefixes (aiNode *node, const char *prefix, unsigned int len)
 Add a name prefix to all nodes in a scene. More...
 
static void AttachToGraph (aiScene *master, std::vector< NodeAttachmentInfo > &srcList)
 Attach a list of node graphs to well-defined nodes in a master graph. More...
 
static void AttachToGraph (aiNode *attach, std::vector< NodeAttachmentInfo > &srcList)
 
static void BuildUniqueBoneList (std::list< BoneWithHash > &asBones, std::vector< aiMesh * >::const_iterator it, std::vector< aiMesh * >::const_iterator end)
 Builds a list of uniquely named bones in a mesh list. More...
 
static void Copy (aiMesh **dest, const aiMesh *src)
 Get a deep copy of a mesh. More...
 
static void Copy (aiMaterial **dest, const aiMaterial *src)
 
static void Copy (aiTexture **dest, const aiTexture *src)
 
static void Copy (aiAnimation **dest, const aiAnimation *src)
 
static void Copy (aiCamera **dest, const aiCamera *src)
 
static void Copy (aiBone **dest, const aiBone *src)
 
static void Copy (aiLight **dest, const aiLight *src)
 
static void Copy (aiNodeAnim **dest, const aiNodeAnim *src)
 
static void Copy (aiMetadata **dest, const aiMetadata *src)
 
static void Copy (aiNode **dest, const aiNode *src)
 
static void CopyScene (aiScene **dest, const aiScene *source, bool allocate=true)
 Get a deep copy of a scene. More...
 
static void CopySceneFlat (aiScene **dest, const aiScene *source)
 Get a flat copy of a scene. More...
 
static void MergeBones (aiMesh *out, std::vector< aiMesh * >::const_iterator it, std::vector< aiMesh * >::const_iterator end)
 Merges two or more bones. More...
 
static void MergeMaterials (aiMaterial **dest, std::vector< aiMaterial * >::const_iterator begin, std::vector< aiMaterial * >::const_iterator end)
 Merges two or more materials. More...
 
static void MergeMeshes (aiMesh **dest, unsigned int flags, std::vector< aiMesh * >::const_iterator begin, std::vector< aiMesh * >::const_iterator end)
 Merges two or more meshes. More...
 
static void MergeScenes (aiScene **dest, std::vector< aiScene * > &src, unsigned int flags=0)
 Merges two or more scenes. More...
 
static void MergeScenes (aiScene **dest, aiScene *master, std::vector< AttachmentInfo > &src, unsigned int flags=0)
 Merges two or more scenes and attaches all sceenes to a specific position in the node graph of the masteer scene. More...
 
static void OffsetNodeMeshIndices (aiNode *node, unsigned int offset)
 Add an offset to all mesh indices in a node graph. More...
 

Detailed Description

Static helper class providing various utilities to merge two scenes.

It is intended as internal utility and NOT for use by applications.

The class is currently being used by various postprocessing steps and loaders (ie. LWS).

Member Function Documentation

void Assimp::SceneCombiner::AddNodePrefixes ( aiNode node,
const char *  prefix,
unsigned int  len 
)
static

Add a name prefix to all nodes in a scene.

Parameters
Currentnode. This function is called recursively.
prefixPrefix to be added to all nodes
lenSTring length
void Assimp::SceneCombiner::AttachToGraph ( aiScene master,
std::vector< NodeAttachmentInfo > &  srcList 
)
static

Attach a list of node graphs to well-defined nodes in a master graph.

This is a helper for MergeScenes()

Parameters
masterMaster scene
srcListList of source scenes along with their attachment points. If an attachment point is NULL (or does not exist in the master graph), a scene is attached to the root of the master graph (as an additional child node) List of duplicates. If elem[n] == n the scene is not a duplicate. Otherwise elem[n] links scene n to its first occurrence.
void Assimp::SceneCombiner::AttachToGraph ( aiNode attach,
std::vector< NodeAttachmentInfo > &  srcList 
)
static
void Assimp::SceneCombiner::BuildUniqueBoneList ( std::list< BoneWithHash > &  asBones,
std::vector< aiMesh * >::const_iterator  it,
std::vector< aiMesh * >::const_iterator  end 
)
static

Builds a list of uniquely named bones in a mesh list.

Parameters
asBonesReceives the output list
itFirst mesh to be processed
endLast mesh to be processed
void Assimp::SceneCombiner::Copy ( aiMesh **  dest,
const aiMesh src 
)
static

Get a deep copy of a mesh.

Parameters
destReceives a pointer to the destination mesh
srcSource mesh - remains unmodified.
void Assimp::SceneCombiner::Copy ( aiMaterial **  dest,
const aiMaterial src 
)
static
void Assimp::SceneCombiner::Copy ( aiTexture **  dest,
const aiTexture src 
)
static
void Assimp::SceneCombiner::Copy ( aiAnimation **  dest,
const aiAnimation src 
)
static
void Assimp::SceneCombiner::Copy ( aiCamera **  dest,
const aiCamera src 
)
static
void Assimp::SceneCombiner::Copy ( aiBone **  dest,
const aiBone src 
)
static
void Assimp::SceneCombiner::Copy ( aiLight **  dest,
const aiLight src 
)
static
void Assimp::SceneCombiner::Copy ( aiNodeAnim **  dest,
const aiNodeAnim src 
)
static
void Assimp::SceneCombiner::Copy ( aiMetadata **  dest,
const aiMetadata src 
)
static
void Assimp::SceneCombiner::Copy ( aiNode **  dest,
const aiNode src 
)
static
void Assimp::SceneCombiner::CopyScene ( aiScene **  dest,
const aiScene source,
bool  allocate = true 
)
static

Get a deep copy of a scene.

Parameters
destReceives a pointer to the destination scene
srcSource scene - remains unmodified.
void Assimp::SceneCombiner::CopySceneFlat ( aiScene **  dest,
const aiScene source 
)
static

Get a flat copy of a scene.

Only the first hierarchy layer is copied. All pointer members of aiScene are shared by source and destination scene. If the pointer doesn't point to NULL when the function is called, the existing scene is cleared and refilled.

Parameters
destReceives a pointer to the destination scene
srcSource scene - remains unmodified.
void Assimp::SceneCombiner::MergeBones ( aiMesh out,
std::vector< aiMesh * >::const_iterator  it,
std::vector< aiMesh * >::const_iterator  end 
)
static

Merges two or more bones.

Parameters
outMesh to receive the output bone list
flagsCurrently no parameters
beginFirst mesh to be processed
endPoints to the mesh after the last mesh to be processed
void Assimp::SceneCombiner::MergeMaterials ( aiMaterial **  dest,
std::vector< aiMaterial * >::const_iterator  begin,
std::vector< aiMaterial * >::const_iterator  end 
)
static

Merges two or more materials.

The materials should be complementary as much as possible. In case of a property present in different materials, the first occurrence is used.

Parameters
destDestination material. Must be empty.
beginFirst material to be processed
endPoints to the material after the last material to be processed
void Assimp::SceneCombiner::MergeMeshes ( aiMesh **  dest,
unsigned int  flags,
std::vector< aiMesh * >::const_iterator  begin,
std::vector< aiMesh * >::const_iterator  end 
)
static

Merges two or more meshes.

The meshes should have equal vertex formats. Only components that are provided by ALL meshes will be present in the output mesh. An exception is made for VColors - they are set to black. The meshes should have the same material indices, too. The output material index is always the material index of the first mesh.

Parameters
destDestination mesh. Must be empty.
flagsCurrently no parameters
beginFirst mesh to be processed
endPoints to the mesh after the last mesh to be processed
void Assimp::SceneCombiner::MergeScenes ( aiScene **  dest,
std::vector< aiScene * > &  src,
unsigned int  flags = 0 
)
static

Merges two or more scenes.

Parameters
destReceives a pointer to the destination scene. If the pointer doesn't point to NULL when the function is called, the existing scene is cleared and refilled.
srcNon-empty list of scenes to be merged. The function deletes the input scenes afterwards. There may be duplicate scenes.
flagsCombination of the AI_INT_MERGE_SCENE flags defined above
void Assimp::SceneCombiner::MergeScenes ( aiScene **  dest,
aiScene master,
std::vector< AttachmentInfo > &  src,
unsigned int  flags = 0 
)
static

Merges two or more scenes and attaches all sceenes to a specific position in the node graph of the masteer scene.

Parameters
destReceives a pointer to the destination scene. If the pointer doesn't point to NULL when the function is called, the existing scene is cleared and refilled.
masterMaster scene. It will be deleted afterwards. All other scenes will be inserted in its node graph.
srcNon-empty list of scenes to be merged along with their corresponding attachment points in the master scene. The function deletes the input scenes afterwards. There may be duplicate scenes.
flagsCombination of the AI_INT_MERGE_SCENE flags defined above
void Assimp::SceneCombiner::OffsetNodeMeshIndices ( aiNode node,
unsigned int  offset 
)
static

Add an offset to all mesh indices in a node graph.

Parameters
Currentnode. This function is called recursively.
offsetOffset to be added to all mesh indices

The documentation for this class was generated from the following files: