Still Improving the documentation.
This commit is contained in:
parent
a90b24dca5
commit
6c3d86d448
|
@ -95,6 +95,8 @@ int main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// finally lets copy this mesh onto another one.
|
||||||
|
MyMesh m2;
|
||||||
|
vcg::tri::Append<MyMesh,MyMesh>::MeshCopy(m2,m);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <vcg/simplex/vertex/base.h>
|
|
||||||
#include <vcg/simplex/vertex/component_ocf.h>
|
|
||||||
#include <vcg/simplex/face/base.h>
|
|
||||||
#include <vcg/simplex/face/component_ocf.h>
|
|
||||||
#include <vcg/complex/complex.h>
|
#include <vcg/complex/complex.h>
|
||||||
#include <vcg/complex/algorithms/attribute_seam.h>
|
#include <vcg/complex/algorithms/attribute_seam.h>
|
||||||
|
|
||||||
|
|
|
@ -62,14 +62,10 @@ m.face.size() == m.FN()
|
||||||
How to copy a mesh
|
How to copy a mesh
|
||||||
------------
|
------------
|
||||||
Given the intricate nature of the mesh itself it is severely forbidden any attempt of copying meshes as simple object. To copy a mesh you have to use the Append utility class:
|
Given the intricate nature of the mesh itself it is severely forbidden any attempt of copying meshes as simple object. To copy a mesh you have to use the Append utility class:
|
||||||
\code
|
\dontinclude trimesh_allocate.cpp
|
||||||
#include<vcg/complex/trimesh/append.h>
|
\skip m2
|
||||||
|
\until Append
|
||||||
|
|
||||||
MyMesh ml,mr;
|
In the vcg::tri::Append utility class there are aslo functions for copying only a subset of the second mesh (the selected one) or to append the second mesh to the first one.
|
||||||
...
|
|
||||||
tri::Append<MyMesh>::Mesh(ml,mr);
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
This is equivalent to append the content of mr onto ml. If you want simple copy just clear ml before calling the above function.
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace tri {
|
||||||
|
|
||||||
Adding elements to a mesh, like faces and vertices can involve the reallocation of the vectors of the involved elements.
|
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.
|
This class provide the only safe methods to add elements of a mesh to another one.
|
||||||
|
\sa \ref allocation
|
||||||
*/
|
*/
|
||||||
template<class MeshLeft, class ConstMeshRight>
|
template<class MeshLeft, class ConstMeshRight>
|
||||||
class Append
|
class Append
|
||||||
|
@ -176,7 +177,7 @@ public:
|
||||||
// Append Right Mesh to the Left Mesh
|
// Append Right Mesh to the Left Mesh
|
||||||
// Append::Mesh(ml, mr) is equivalent to ml += mr.
|
// Append::Mesh(ml, mr) is equivalent to ml += mr.
|
||||||
// Note MeshRigth could be costant...
|
// Note MeshRigth could be costant...
|
||||||
/*! \brief @Append the second mesh to the first one.
|
/*! \brief %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.
|
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.
|
If requested only the selected elements are appended to the first one.
|
||||||
|
@ -390,7 +391,7 @@ static void MeshCopy(MeshLeft& ml, ConstMeshRight& mr, bool selected=false)
|
||||||
Mesh(ml,mr,selected);
|
Mesh(ml,mr,selected);
|
||||||
ml.bbox=mr.bbox;
|
ml.bbox=mr.bbox;
|
||||||
}
|
}
|
||||||
/*! \brief @Append only the selected elements of second mesh to the first one.
|
/*! \brief %Append only the selected elements of second mesh to the first one.
|
||||||
|
|
||||||
It is just a wrap of the main Append::Mesh()
|
It is just a wrap of the main Append::Mesh()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue