Go to the documentation of this file.
11 #include <CGAL/Surface_mesh.h>
12 #include <CGAL/Cartesian.h>
18 #include <CGAL/boost/graph/Euler_operations.h>
34 typedef CGAL::Cartesian< double >
Kernel;
35 typedef CGAL::Surface_mesh< Kernel::Point_3 >
Mesh;
39 std::ifstream in(filename);
45 typedef boost::graph_traits< Mesh > GraphTraits;
46 typedef typename GraphTraits::halfedge_descriptor halfedge_descriptor;
47 typedef typename GraphTraits::face_descriptor face_descriptor;
49 face_descriptor f = *(
faces(m).begin());
50 halfedge_descriptor h =
halfedge(f, m);
51 if(h == GraphTraits::null_halfedge())
53 std::cout <<
"Failed to retrieve the first face halfedge. Exiting."
58 std::cout <<
"Adding center vertex..." << std::endl;
59 halfedge_descriptor hnew = CGAL::Euler::add_center_vertex(h, m);
68 put(
get(boost::vertex_point, m), vnew,
Point(4.0f, 3.0f, 0.0f));
79 main(
int narg,
char **argv)
83 std::cout <<
"Usage: " << argv[0] <<
" mesh_file [reference_result_file]"
85 std::cout <<
"Example: " << argv[0] <<
" airplane.off" << std::endl;
int main(int narg, char **argv)
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)
CGAL::Cartesian< double > Kernel
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
void test_euler_add_center_vertex_surface_mesh(std::string filename)
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.
const char * outputFileName
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.
FEVV::DataStructures::AIF::AIFMesh Mesh
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...