Go to the documentation of this file.
23 main(
int narg,
char **argv)
26 std::string input_original;
27 std::string input_degraded;
29 std::string output_file_path =
"msdm2.output.obj";
33 std::string reader = std::string(argv[1]);
34 input_original = reader;
35 std::string reader2 = std::string(argv[2]);
36 input_degraded = reader2;
40 std::cout <<
"Use of " << argv[0] <<
" is :\n";
41 std::cout <<
"\t" << argv[0]
42 <<
" path/to/original_mesh path/to/degraged_mesh" << std::endl;
44 <<
" will compute the MSDM2 value between the degraded mesh and "
63 auto pm_degrad =
get(boost::vertex_point, m_degraded);
64 auto pm_original =
get(boost::vertex_point, m_original);
69 FaceNormalMap fnm_degrad;
72 std::cout <<
"use existing face-normal map for degraded mesh" << std::endl;
78 std::cout <<
"create face-normal map for degraded mesh" << std::endl;
86 FaceNormalMap fnm_original;
89 std::cout <<
"use existing face-normal map for original mesh" << std::endl;
95 std::cout <<
"create face-normal map for original mesh" << std::endl;
101 m_original, pm_original, fnm_original);
107 VertexMSDM2Map msdm2_pmap;
109 if(
FEVV::has_map(pmaps_bag_degraded, std::string(
"v:msdm2")))
112 boost::any_cast< VertexMSDM2Map >(pmaps_bag_degraded.at(
"v:msdm2"));
117 FEVV::make_vertex_property_map< FEVV::MeshSurface, double >(m_degraded);
118 pmaps_bag_degraded[
"v:msdm2"] = msdm2_pmap;
136 std::cout <<
"Calculated MSDM2 : " <<
msdm2 << std::endl;
138 using VertexColorMap =
144 std::cout <<
"use existing vertex-color map" << std::endl;
149 std::cout <<
"create vertex-color map" << std::endl;
155 double max_msdm2, min_msdm2;
158 m_degraded, msdm2_pmap, min_msdm2, max_msdm2);
161 m_degraded, msdm2_pmap, v_cm, min_msdm2, max_msdm2, lut_courbure_clust);
void put_property_map(PropertyT p, const MeshT &, PMapsContainer &pmaps, const typename PMap_traits< PropertyT, MeshT >::pmap_type &pmap)
void compute_min_max_vertices(const HalfedgeGraph &g, const PropertyMap &prop_map, MapType &min_metric, MapType &max_metric)
Compute min and max value of a numerical property map for the vertices of a mesh.
PMap_traits< PropertyT, MeshT >::pmap_type get_property_map(PropertyT p, const MeshT &, const PMapsContainer &pmaps)
bool has_map(const PMapsContainer &pmaps, const std::string &map_name)
(refer to Property Maps API)
CGAL::Surface_mesh< CGALPoint > MeshSurface
std::map< std::string, boost::any > PMapsContainer
void color_vertices_from_map(const HalfedgeGraph &g, const PropertyMap &prop_map, ColorMap &color_pmap, const MapType min_metric, const MapType max_metric, const ColorMeshLUT &colors=make_LUT())
Fill the color map for the vertices of a mesh using a numerical property map.
ColorMeshLUT make_LUT(bool color_in_0_255=true, unsigned int colors_nbr=256, float h1=240, float h2=0)
Create a RGB LUT based on an HSV range. Default range creates a blue-cyan-green-yellow-red gradient.
std::vector< float > ColorMeshLUT
void read_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps, bool=false)
Load mesh from file.
void calculate_face_normals(const HalfedgeGraph &g, const PointMap &pm, FaceNormalMap fnm, const GeometryTraits >)
Calculate "some" normal of all the faces of the considered mesh and populate the argument provided Fa...
typename Vertex_pmap_traits< MeshT, ValueT >::pmap_type Vertex_pmap
double process_msdm2_multires(const HalfedgeGraph &m_poly_degrad, const PointMap &pm_degrad, const FaceNormalMap &fnm_degrad, FEVV::PMapsContainer &pmaps_degrad, const GeometryTraits >_degrad, const HalfedgeGraph &m_poly_original, const PointMap &pm_original, const FaceNormalMap &fnm_original, FEVV::PMapsContainer &, const GeometryTraits &, const int nb_level, VertexMSDM2Map &msdm2_pmap, const double maxdim, double &msdm2_value)
void write_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps)
Write mesh to file.
boost::property_map< FEVV::DataStructures::AIF::AIFMesh, boost::vertex_index_t >::const_type get(const boost::vertex_index_t &, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the vertex index property map of the mesh.
int main(int narg, char **argv)
PMap_traits< PropertyT, MeshT >::pmap_type make_property_map(PropertyT, const MeshT &m)