diff --git a/apps/sample/trimesh_allocate/trimesh_allocate.cpp b/apps/sample/trimesh_allocate/trimesh_allocate.cpp index 81dcdb36..ca540491 100644 --- a/apps/sample/trimesh_allocate/trimesh_allocate.cpp +++ b/apps/sample/trimesh_allocate/trimesh_allocate.cpp @@ -95,6 +95,8 @@ int main() } } - + // finally lets copy this mesh onto another one. + MyMesh m2; + vcg::tri::Append::MeshCopy(m2,m); } diff --git a/apps/sample/trimesh_split_vertex/trimesh_split_vertex.cpp b/apps/sample/trimesh_split_vertex/trimesh_split_vertex.cpp index d71bffc4..b1cb09f6 100644 --- a/apps/sample/trimesh_split_vertex/trimesh_split_vertex.cpp +++ b/apps/sample/trimesh_split_vertex/trimesh_split_vertex.cpp @@ -1,9 +1,3 @@ -#include - -#include -#include -#include -#include #include #include diff --git a/docs/Doxygen/allocation.dxy b/docs/Doxygen/allocation.dxy index a436ea95..49262169 100644 --- a/docs/Doxygen/allocation.dxy +++ b/docs/Doxygen/allocation.dxy @@ -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 +\dontinclude trimesh_allocate.cpp +\skip m2 +\until Append -MyMesh ml,mr; -... -tri::Append::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. */ diff --git a/vcg/complex/append.h b/vcg/complex/append.h index 039d7d87..e7e02329 100644 --- a/vcg/complex/append.h +++ b/vcg/complex/append.h @@ -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 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() */