VCG Library
Static Public Member Functions | List of all members
vcg::tri::Append< MeshLeft, ConstMeshRight > Class Template Reference

Class to safely duplicate and append (portion of) meshes. More...

#include <append.h>

Static Public Member Functions

static void Mesh (MeshLeft &ml, ConstMeshRight &mr, const bool selected=false, const bool adjFlag=false)
 Append the second mesh to the first one.
 
static void MeshCopy (MeshLeft &ml, ConstMeshRight &mr, bool selected=false, const bool adjFlag=false)
 Copy the second mesh over the first one. The first mesh is destroyed. If requested only the selected elements are copied.
 
static void Selected (MeshLeft &ml, ConstMeshRight &mr)
 Append only the selected elements of second mesh to the first one.
 

Detailed Description

template<class MeshLeft, class ConstMeshRight>
class vcg::tri::Append< MeshLeft, ConstMeshRight >

Class to safely duplicate and append (portion of) meshes.

Adding elements to a mesh, like faces and vertices can involve the reallocation of the vectors of the involved elements. This class provide the only safe methods to add elements of a mesh to another one.

See Also
Allocating and Deleting mesh elements

Definition at line 40 of file append.h.

Member Function Documentation

template<class MeshLeft , class ConstMeshRight >
static void vcg::tri::Append< MeshLeft, ConstMeshRight >::Mesh ( MeshLeft &  ml,
ConstMeshRight &  mr,
const bool  selected = false,
const bool  adjFlag = false 
)
inlinestatic

Append the second mesh to the first one.

The first mesh is not destroyed and no attempt of avoid duplication of already present elements is done. If requested only the selected elements are appended to the first one. The second mesh is not changed at all (it could be constant) with the exception of the selection (see below note).

Note
If the the selection of the vertexes is not consistent with the face selection the append could build faces referencing non existent vertices so it is mandatory that the selection of the vertices reflects the loose selection from edges and faces (e.g. if a face is selected then all its vertices must be selected).
Attributes. This function will copy only those attributes that are present in both meshes. Two attributes in different meshes are considered the same iff they have the same name and the same type. This may be deceiving because they could in fact have different semantic, but this is up to the developer. If the left mesh has attributes that are not in the right mesh, their values for the elements of the right mesh will be uninitialized

Definition at line 203 of file append.h.

template<class MeshLeft , class ConstMeshRight >
static void vcg::tri::Append< MeshLeft, ConstMeshRight >::MeshCopy ( MeshLeft &  ml,
ConstMeshRight &  mr,
bool  selected = false,
const bool  adjFlag = false 
)
inlinestatic

Copy the second mesh over the first one. The first mesh is destroyed. If requested only the selected elements are copied.

Definition at line 398 of file append.h.

template<class MeshLeft , class ConstMeshRight >
static void vcg::tri::Append< MeshLeft, ConstMeshRight >::Selected ( MeshLeft &  ml,
ConstMeshRight &  mr 
)
inlinestatic

Append only the selected elements of second mesh to the first one.

It is just a wrap of the main Append::Mesh()

Definition at line 408 of file append.h.


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