Go to the documentation of this file.
13 #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
14 #include <OpenMesh/Core/IO/MeshIO.hh>
16 #include <CGAL/boost/graph/Euler_operations.h>
19 #define CGAL_USE_OM_POINTS
20 #include <CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h>
21 #include <CGAL/boost/graph/properties_PolyMesh_ArrayKernelT.h>
39 typedef OpenMesh::PolyMesh_ArrayKernelT<>
Mesh;
46 std::cout <<
"failed to open file " << filename <<
"\n";
52 typedef boost::graph_traits< Mesh > GraphTraits;
53 typedef typename GraphTraits::halfedge_descriptor halfedge_descriptor;
54 typedef typename GraphTraits::face_descriptor face_descriptor;
56 face_descriptor f = *(
faces(m).begin());
57 halfedge_descriptor h =
halfedge(f, m);
58 if(h == GraphTraits::null_halfedge())
60 std::cout <<
"Failed to retrieve the first face halfedge. Exiting."
65 std::cout <<
"Adding center vertex..." << std::endl;
66 halfedge_descriptor hnew = CGAL::Euler::add_center_vertex(h, m);
75 put(
get(boost::vertex_point, m), vnew,
Point(4.0f, 3.0f, 0.0f));
79 m.garbage_collection();
88 main(
int narg,
char **argv)
92 std::cout <<
"Usage: " << argv[0] <<
" mesh_file [reference_result_file]"
94 std::cout <<
"Example: " << argv[0] <<
" airplane.off" << std::endl;
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
bool are_meshes_equal(std::string filename_a, std::string filename_b, bool verbose)
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
Interfaces for plugins These interfaces will be used for different plugins.
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator > faces(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns an iterator range over all faces of the mesh.
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor halfedge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns a halfedge with target v.
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor target(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the target vertex of e.
void read_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps, bool=false)
Load mesh from file.
FEVV::DataStructures::AIF::AIFMesh Mesh
void write_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps)
Write mesh to file.
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
void put(FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key, const FEVV::PCLPointCloudPointMap::value_type &value)
Specialization of put(point_map, key, value) for PCLPointCloud.
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
int main(int narg, char **argv)
const char * outputFileName
void test_euler_add_center_vertex_open_mesh(std::string filename)