44 #include "MergePlugin.hh" 45 #include <OpenMesh/Core/Utils/Property.hh> 50 template<
class MeshT >
53 typename MeshT::VertexHandle vhB;
59 template<
class MeshT >
63 for (uint i=0; i < _meshes.size(); i++)
64 if ( _meshes[i] == 0) {
65 emit log(
LOGERR,
"Unable to get Meshes.");
69 typename MeshT::VertexHandle tmp;
71 for (uint i=1; i < _meshes.size(); i++){
77 _meshes[i]->add_property(vertexID,
"Vertex ID Property" );
79 typename MeshT::VertexIter v_it;
80 typename MeshT::VertexIter v_end = _meshes[i]->vertices_end();
83 for (v_it = _meshes[i]->vertices_begin(); v_it != v_end; ++v_it){
85 typename MeshT::VertexHandle vh = _meshes[0]->add_vertex( _meshes[i]->point(*v_it) );
86 _meshes[i]->property(vertexID, *v_it) = vh;
95 typename MeshT::FaceIter f_it;
96 typename MeshT::FaceIter f_end = _meshes[i]->faces_end();
99 for (f_it = _meshes[i]->faces_begin(); f_it != f_end; ++f_it){
101 typename MeshT::FaceVertexIter fv_it;
103 std::vector< typename MeshT::VertexHandle > vHandles;
105 for (fv_it=_meshes[i]->fv_iter(*f_it); fv_it.is_valid(); ++fv_it)
106 vHandles.push_back( _meshes[i]->property(vertexID, *fv_it) );
109 _meshes[0]->add_face(vHandles);
112 _meshes[i]->remove_property( vertexID );
void mergeMeshes(const std::vector< MeshT * > &_meshes)
merges Meshes into the first mesh