mirror of https://github.com/CGAL/cgal
Revert "convert weighted points to bare points when needed"
This reverts commits19dadd6d58and137fe12b6bWe now use Kernel functors instead of Construct_point_3 converters, because they work with both Point_3 and Weighted_point_3
This commit is contained in:
parent
9405829e13
commit
9187318744
|
|
@ -185,8 +185,6 @@ polylines_to_protect(const CGAL::Image_3& cgal_image,
|
||||||
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
|
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
|
||||||
// typedef typename boost::graph_traits<Graph>::edge_iterator edge_iterator;
|
// typedef typename boost::graph_traits<Graph>::edge_iterator edge_iterator;
|
||||||
|
|
||||||
typename K::Construct_point_3 cp;
|
|
||||||
|
|
||||||
const int xdim = static_cast<int>(cgal_image.xdim());
|
const int xdim = static_cast<int>(cgal_image.xdim());
|
||||||
const int ydim = static_cast<int>(cgal_image.ydim());
|
const int ydim = static_cast<int>(cgal_image.ydim());
|
||||||
const int zdim = static_cast<int>(cgal_image.zdim());
|
const int zdim = static_cast<int>(cgal_image.zdim());
|
||||||
|
|
@ -204,6 +202,10 @@ polylines_to_protect(const CGAL::Image_3& cgal_image,
|
||||||
|
|
||||||
typename K::Construct_midpoint_3 midpoint =
|
typename K::Construct_midpoint_3 midpoint =
|
||||||
K().construct_midpoint_3_object();
|
K().construct_midpoint_3_object();
|
||||||
|
typename K::Construct_vector_3 vector =
|
||||||
|
K().construct_vector_3_object();
|
||||||
|
typename K::Construct_translated_point_3 translate =
|
||||||
|
K().construct_translated_point_3_object();
|
||||||
|
|
||||||
for(int axis = 0; axis < 3; ++axis)
|
for(int axis = 0; axis < 3; ++axis)
|
||||||
{
|
{
|
||||||
|
|
@ -344,13 +346,13 @@ case_4:
|
||||||
for(double x = 0.05; x < 0.5; x+= 0.05)
|
for(double x = 0.05; x < 0.5; x+= 0.05)
|
||||||
{
|
{
|
||||||
const Point_3 inter_left =
|
const Point_3 inter_left =
|
||||||
cp(p00)
|
translate(p00
|
||||||
+ x * (cp(p10) - cp(p00)) // x
|
, x * vector(p00, p10) // x
|
||||||
+ ((1.-2.*x)/(2.-3.*x)) * (cp(p01) - cp(p00)); // y
|
+ ((1.-2.*x)/(2.-3.*x)) * vector(p00, p01)); // y
|
||||||
const Point_3 inter_right =
|
const Point_3 inter_right =
|
||||||
cp(p11)
|
translate(p11
|
||||||
+ x * (cp(p01) - cp(p11)) // x
|
, x * vector(p11, p01) // x
|
||||||
+ ((1.-2.*x)/(2.-3.*x)) * (cp(p10) - cp(p11)); // y
|
+ ((1.-2.*x)/(2.-3.*x)) * vector(p11, p10)); // y
|
||||||
v_int_left = g_manip.get_vertex(inter_left);
|
v_int_left = g_manip.get_vertex(inter_left);
|
||||||
v_int_right = g_manip.get_vertex(inter_right);
|
v_int_right = g_manip.get_vertex(inter_right);
|
||||||
g_manip.try_add_edge(old_left, v_int_left);
|
g_manip.try_add_edge(old_left, v_int_left);
|
||||||
|
|
@ -382,7 +384,8 @@ case_4:
|
||||||
++case211;
|
++case211;
|
||||||
Point_3 midleft = midpoint(p00, p01);
|
Point_3 midleft = midpoint(p00, p01);
|
||||||
Point_3 midright = midpoint(p10, p11);
|
Point_3 midright = midpoint(p10, p11);
|
||||||
Point_3 inter = cp(midleft) + (2./3)*(cp(midright)-cp(midleft));
|
Point_3 inter = translate(midleft
|
||||||
|
, (2./3) * vector(midleft, midright));
|
||||||
vertex_descriptor v_inter = g_manip.get_vertex(inter);
|
vertex_descriptor v_inter = g_manip.get_vertex(inter);
|
||||||
vertex_descriptor right = g_manip.split(p10, p11, out10, out11);
|
vertex_descriptor right = g_manip.split(p10, p11, out10, out11);
|
||||||
vertex_descriptor top = g_manip.split(p01, p11, out01, out11);
|
vertex_descriptor top = g_manip.split(p01, p11, out01, out11);
|
||||||
|
|
@ -397,13 +400,13 @@ case_4:
|
||||||
for(double x = 0.51666; x < 0.66; x+= 0.016666)
|
for(double x = 0.51666; x < 0.66; x+= 0.016666)
|
||||||
{
|
{
|
||||||
const Point_3 inter_top =
|
const Point_3 inter_top =
|
||||||
cp(p00)
|
translate(p00
|
||||||
+ x * (cp(p10) - cp(p00)) // x
|
, x * vector(p00, p10) // x
|
||||||
+ ((1./x) - 1.) * (cp(p01) - cp(p00)); // y
|
+ ((1./x) - 1.) * vector(p00, p01)); // y
|
||||||
const Point_3 inter_bottom =
|
const Point_3 inter_bottom =
|
||||||
cp(p00)
|
translate(p00
|
||||||
+ x * (cp(p10) - cp(p00)) // x
|
, x * vector(p00, p10) // x
|
||||||
+ (2.-(1./x)) * (cp(p01) - cp(p00)); // y
|
+ (2.-(1./x)) * vector(p00, p01)); // y
|
||||||
v_int_top = g_manip.get_vertex(inter_top);
|
v_int_top = g_manip.get_vertex(inter_top);
|
||||||
v_int_bottom = g_manip.get_vertex(inter_bottom);
|
v_int_bottom = g_manip.get_vertex(inter_bottom);
|
||||||
g_manip.try_add_edge(old_top, v_int_top);
|
g_manip.try_add_edge(old_top, v_int_top);
|
||||||
|
|
@ -498,9 +501,9 @@ case_4:
|
||||||
for(double x = 0.55; x < 1.; x+= 0.05)
|
for(double x = 0.55; x < 1.; x+= 0.05)
|
||||||
{
|
{
|
||||||
const Point_3 inter =
|
const Point_3 inter =
|
||||||
cp(p00)
|
translate(p00
|
||||||
+ x * (cp(p10) - cp(p00)) // x
|
, x * vector(p00, p10) // x
|
||||||
+ (1.-1./(2.*x)) * (cp(p01) - cp(p00)); // y
|
+ (1.-1./(2.*x)) * vector(p00, p01)); // y
|
||||||
v_int = g_manip.get_vertex(inter);
|
v_int = g_manip.get_vertex(inter);
|
||||||
g_manip.try_add_edge(old, v_int);
|
g_manip.try_add_edge(old, v_int);
|
||||||
old = v_int;
|
old = v_int;
|
||||||
|
|
|
||||||
|
|
@ -987,11 +987,12 @@ private:
|
||||||
const int k3,
|
const int k3,
|
||||||
const Cell_handle& cell) const
|
const Cell_handle& cell) const
|
||||||
{
|
{
|
||||||
Construct_point_3 cp;
|
typename Gt::Compute_approximate_dihedral_angle_3 approx_dihedral_angle
|
||||||
return CGAL::abs(CGAL::approximate_dihedral_angle(cp(p),
|
= Gt().compute_approximate_dihedral_angle_3_object();
|
||||||
cp(cell->vertex(k1)->point()),
|
return CGAL::abs(approx_dihedral_angle(p,
|
||||||
cp(cell->vertex(k2)->point()),
|
cell->vertex(k1)->point(),
|
||||||
cp(cell->vertex(k3)->point())));
|
cell->vertex(k2)->point(),
|
||||||
|
cell->vertex(k3)->point()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,11 @@ struct Graph_manipulations
|
||||||
<< std::boolalpha << a_is_outside << ", "
|
<< std::boolalpha << a_is_outside << ", "
|
||||||
<< std::boolalpha << b_is_outside << ")\n";
|
<< std::boolalpha << b_is_outside << ")\n";
|
||||||
#endif // CGAL_MESH_3_DEBUG_GRAPH_MANIPULATION
|
#endif // CGAL_MESH_3_DEBUG_GRAPH_MANIPULATION
|
||||||
typedef typename CGAL::Kernel_traits<Point_3>::Kernel K;
|
|
||||||
typename K::Construct_point_3 cp;
|
|
||||||
|
|
||||||
const Point_3 mid = (a < b) ? midpoint(cp(a), cp(b)) : midpoint(cp(b), cp(a));
|
typedef typename CGAL::Kernel_traits<Point_3>::Kernel K;
|
||||||
|
typename K::Construct_midpoint_3 midpt
|
||||||
|
= K().construct_midpoint_3_object();
|
||||||
|
const Point_3 mid = a < b ? midpt(a, b) : midpt(b, a);
|
||||||
vertex_descriptor vmid = get_vertex(mid);
|
vertex_descriptor vmid = get_vertex(mid);
|
||||||
typename std::map<Point_3, vertex_descriptor>::iterator
|
typename std::map<Point_3, vertex_descriptor>::iterator
|
||||||
it_a = p2v.find(a),
|
it_a = p2v.find(a),
|
||||||
|
|
|
||||||
|
|
@ -535,6 +535,8 @@ std::vector<int>
|
||||||
create_histogram(const C3t3& c3t3, double& min_value, double& max_value)
|
create_histogram(const C3t3& c3t3, double& min_value, double& max_value)
|
||||||
{
|
{
|
||||||
typedef typename C3t3::Triangulation::Point Point_3;
|
typedef typename C3t3::Triangulation::Point Point_3;
|
||||||
|
typename Kernel::Compute_approximate_dihedral_angle_3 approx_dihedral_angle
|
||||||
|
= Kernel().compute_approximate_dihedral_angle_3_object();
|
||||||
|
|
||||||
std::vector<int> histo(181, 0);
|
std::vector<int> histo(181, 0);
|
||||||
|
|
||||||
|
|
@ -561,39 +563,32 @@ create_histogram(const C3t3& c3t3, double& min_value, double& max_value)
|
||||||
const Point_3& p2 = cit->vertex(2)->point();
|
const Point_3& p2 = cit->vertex(2)->point();
|
||||||
const Point_3& p3 = cit->vertex(3)->point();
|
const Point_3& p3 = cit->vertex(3)->point();
|
||||||
|
|
||||||
typename Kernel::Construct_point_3 cp;
|
double a = CGAL::to_double(CGAL::abs(approx_dihedral_angle(p0, p1, p2, p3)));
|
||||||
double a = CGAL::to_double(CGAL::abs(
|
|
||||||
CGAL::approximate_dihedral_angle(cp(p0), cp(p1), cp(p2), cp(p3))));
|
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(
|
a = CGAL::to_double(CGAL::abs(approx_dihedral_angle(p0, p2, p1, p3)));
|
||||||
CGAL::approximate_dihedral_angle(cp(p0), cp(p2), cp(p1), cp(p3))));
|
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(
|
a = CGAL::to_double(CGAL::abs(approx_dihedral_angle(p0, p3, p1, p2)));
|
||||||
CGAL::approximate_dihedral_angle(cp(p0), cp(p3), cp(p1), cp(p2))));
|
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(
|
a = CGAL::to_double(CGAL::abs(approx_dihedral_angle(p1, p2, p0, p3)));
|
||||||
CGAL::approximate_dihedral_angle(cp(p1), cp(p2), cp(p0), cp(p3))));
|
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(
|
a = CGAL::to_double(CGAL::abs(approx_dihedral_angle(p1, p3, p0, p2)));
|
||||||
CGAL::approximate_dihedral_angle(cp(p1), cp(p3), cp(p0), cp(p2))));
|
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(
|
a = CGAL::to_double(CGAL::abs(approx_dihedral_angle(p2, p3, p0, p1)));
|
||||||
CGAL::approximate_dihedral_angle(cp(p2), cp(p3), cp(p0), cp(p1))));
|
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue