Go to the documentation of this file.
11 #include <CGAL/Cartesian.h>
12 #include <CGAL/Surface_mesh.h>
13 #include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
19 #ifdef USE_GENERIC_READER_WRITER
21 #include "FEVV/Wrappings/properties_cgal.h"
42 typedef CGAL::Cartesian< double >
Kernel;
43 typedef CGAL::Surface_mesh< Kernel::Point_3 >
Mesh;
47 typedef boost::vector_property_map<
49 typename boost::property_map< Mesh, boost::vertex_index_t >::const_type >
53 #ifdef USE_GENERIC_READER_WRITER
57 std::ifstream in(filename);
60 std::cout <<
"Unable to read file " << filename << std::endl;
66 auto pos_pm =
get(boost::vertex_point, m);
68 BarycenterMap barycenters_pm(
get(boost::vertex_index, m));
70 m, pos_pm, barycenters_pm, 0.2f);
74 m, pos_pm, barycenters_pm, 0.2f);
78 m, pos_pm, barycenters_pm, 0.2f);
81 #ifdef USE_GENERIC_READER_WRITER
88 std::ofstream smoothed_off(
"smoothed_surf_" +
94 std::cout <<
"Done." << std::endl;
98 main(
int narg,
char **argv)
102 std::cout <<
"Usage: " << argv[0]
103 <<
" filename; filename being an off file." << std::endl;
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.
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.
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
void test_smoothing_surface_mesh(std::string filename)
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.
int main(int narg, char **argv)