Still Improving the documentation.

This commit is contained in:
Paolo Cignoni 2012-10-25 23:52:48 +00:00
parent a90b24dca5
commit 6c3d86d448
4 changed files with 10 additions and 17 deletions

View File

@ -95,6 +95,8 @@ int main()
}
}
// finally lets copy this mesh onto another one.
MyMesh m2;
vcg::tri::Append<MyMesh,MyMesh>::MeshCopy(m2,m);
}

View File

@ -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/algorithms/attribute_seam.h>

View File

@ -62,14 +62,10 @@ m.face.size() == m.FN()
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:
\code
#include<vcg/complex/trimesh/append.h>
\dontinclude trimesh_allocate.cpp
\skip m2
\until Append
MyMesh ml,mr;
...
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.
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.
*/

View File

@ -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.
This class provide the only safe methods to add elements of a mesh to another one.
\sa \ref allocation
*/
template<class MeshLeft, class ConstMeshRight>
class Append
@ -176,7 +177,7 @@ public:
// Append Right Mesh to the Left Mesh
// Append::Mesh(ml, mr) is equivalent to ml += mr.
// 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.
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);
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()
*/