Call approximate_dihedral_angle() from the Kernel

This commit is contained in:
Andreas Fabri 2016-10-17 14:59:06 +02:00
parent 6be3772654
commit 39c27cb9db
2 changed files with 14 additions and 18 deletions

View File

@ -13,7 +13,6 @@
#include <map>
#include <vector>
#include <CGAL/gl.h>
#include <CGAL/Mesh_3/dihedral_angle_3.h>
#include <CGAL/Three/Scene_interface.h>
#include <CGAL/Real_timer.h>
@ -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<int>(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<int>(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<int>(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<int>(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<int>(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<int>(std::floor(a))] += 1;
min_value = (std::min)(min_value, a);
max_value = (std::max)(max_value, a);

View File

@ -1,8 +1,6 @@
#include <iostream>
#include <fstream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
@ -13,7 +11,6 @@
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
#include <CGAL/Unique_hash_map.h>
#include <CGAL/Mesh_3/dihedral_angle_3.h>
#include <CGAL/property_map.h>
#include <cmath>
@ -106,7 +103,7 @@ 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),
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));
@ -152,7 +149,7 @@ 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),
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));