Go to the documentation of this file.
11 #include <CGAL/Cartesian.h>
12 #include <CGAL/Polyhedron_3.h>
13 #include <CGAL/Polyhedron_items_with_id_3.h>
14 #include <CGAL/IO/Polyhedron_iostream.h>
20 #ifdef USE_GENERIC_READER_WRITER
21 #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
24 #include "FEVV/Wrappings/properties_cgal.h"
45 typedef CGAL::Cartesian< double >
Kernel;
46 typedef CGAL::Polyhedron_3< Kernel, CGAL::Polyhedron_items_with_id_3 >
Mesh;
48 typedef boost::graph_traits< Mesh > GraphTraits;
50 typedef typename GraphTraits::vertex_iterator vertex_iterator;
54 typedef boost::vector_property_map<
56 typename boost::property_map< Mesh, boost::vertex_index_t >::const_type >
60 #ifdef USE_GENERIC_READER_WRITER
64 std::ifstream in(filename);
67 std::cerr <<
"Unable to read file " << filename << std::endl;
73 vertex_iterator vb, ve;
82 auto pos_pm =
get(boost::vertex_point, m);
84 BarycenterMap barycenters_pm(
get(boost::vertex_index, m));
86 m, pos_pm, barycenters_pm, 0.2f);
90 m, pos_pm, barycenters_pm, 0.2f);
94 m, pos_pm, barycenters_pm, 0.2f);
97 #ifdef USE_GENERIC_READER_WRITER
104 std::ofstream smoothed_off(
"smoothed_poly_" +
108 smoothed_off.close();
111 std::cout <<
"Done." << std::endl;
119 std::cout <<
"Usage: " << argv[0]
120 <<
" filename; filename being an off file." << std::endl;
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator > vertices(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the iterator range of the vertices of the mesh.
void test_smoothing_polyhedron(std::string filename)
void calculate_vertices_one_ring_geometric_laplacian(const FaceGraph &g, const PointMap &pm, CentroidMap geom_laplacians_pm, const typename GeometryTraits::Scalar smoothing_factor, const GeometryTraits >)
Compute geometric laplacians for all vertices and store them in geom_laplacians_pm.
int main(int narg, char **argv)
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
std::map< std::string, boost::any > PMapsContainer
std::string get_file_name(const std::string &file_name)
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 reposition_vertices(const PropertyGraph &g, PointMap pm, const NewPointMap &smoothed_pm, const GeometryTraits &)
Apply new vertex positions to vertex position property map.
Interfaces for plugins These interfaces will be used for different plugins.
void read_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps, bool=false)
Load mesh from file.
std::string get_file_extension(const std::string &file_name)
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
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
void calculate_vertices_one_ring_angles_based_centroid(const FaceGraph &g, const PointMap &pm, CentroidMap angles_based_centroids_pm, const typename GeometryTraits::Scalar smoothing_factor, const GeometryTraits >)
Compute angle-based centroids for all vertices and store them in bangles_based_centroids_pm.
void calculate_vertices_one_ring_barycenter(const FaceGraph &g, const PointMap &pm, CentroidMap barycenters_pm, const typename GeometryTraits::Scalar smoothing_factor, const GeometryTraits >)
Compute barycenters for all vertices and store them in barycenters_pm.