From 39c27cb9db1a181f25716f1d795db87d9e5ea8bf Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 17 Oct 2016 14:59:06 +0200 Subject: [PATCH] Call approximate_dihedral_angle() from the Kernel --- .../demo/Polyhedron/Scene_c3t3_item.cpp | 13 ++++++------- .../edge_collapse_constrain_sharp_edges.cpp | 19 ++++++++----------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 511d178de0c..584d6650df9 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -562,32 +561,32 @@ create_histogram(const C3t3& c3t3, double& min_value, double& max_value) const Point_3& p2 = cit->vertex(2)->point(); const Point_3& p3 = cit->vertex(3)->point(); - double a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p0, p1, p2, p3))); + double a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p0, p1, p2, p3))); histo[static_cast(std::floor(a))] += 1; min_value = (std::min)(min_value, a); max_value = (std::max)(max_value, a); - a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p0, p2, p1, p3))); + a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p0, p2, p1, p3))); histo[static_cast(std::floor(a))] += 1; min_value = (std::min)(min_value, a); max_value = (std::max)(max_value, a); - a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p0, p3, p1, p2))); + a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p0, p3, p1, p2))); histo[static_cast(std::floor(a))] += 1; min_value = (std::min)(min_value, a); max_value = (std::max)(max_value, a); - a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p1, p2, p0, p3))); + a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p1, p2, p0, p3))); histo[static_cast(std::floor(a))] += 1; min_value = (std::min)(min_value, a); max_value = (std::max)(max_value, a); - a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p1, p3, p0, p2))); + a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p1, p3, p0, p2))); histo[static_cast(std::floor(a))] += 1; min_value = (std::min)(min_value, a); max_value = (std::max)(max_value, a); - a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p2, p3, p0, p1))); + a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p2, p3, p0, p1))); histo[static_cast(std::floor(a))] += 1; min_value = (std::min)(min_value, a); max_value = (std::max)(max_value, a); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp index 042458af7c0..39d8a1214db 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp @@ -1,8 +1,6 @@ #include #include - - #include #include #include @@ -13,7 +11,6 @@ #include #include #include -#include #include #include @@ -106,10 +103,10 @@ int main( int argc, char** argv ) point(target(hd,surface_mesh),surface_mesh)); } else{ - double angle = CGAL::Mesh_3::dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh), - point(target(hd,surface_mesh),surface_mesh), - point(target(next(hd,surface_mesh),surface_mesh),surface_mesh), - point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh)); + double angle = CGAL::approximate_dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh), + point(target(hd,surface_mesh),surface_mesh), + point(target(next(hd,surface_mesh),surface_mesh),surface_mesh), + point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh)); if ( CGAL::abs(angle)<100 ){ ++nb_sharp_edges; constraint_hmap[*eb]=true; @@ -152,10 +149,10 @@ int main( int argc, char** argv ) point(target(hd,surface_mesh),surface_mesh))); } else{ - double angle = CGAL::Mesh_3::dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh), - point(target(hd,surface_mesh),surface_mesh), - point(target(next(hd,surface_mesh),surface_mesh),surface_mesh), - point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh)); + double angle = approximate_dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh), + point(target(hd,surface_mesh),surface_mesh), + point(target(next(hd,surface_mesh),surface_mesh),surface_mesh), + point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh)); if ( CGAL::abs(angle)<100 ){ --nb_sharp_edges; assert(