avoid using wp.point(), use Construct_point_3 instead

This commit is contained in:
Jane Tournois 2017-03-03 15:06:49 +01:00 committed by Mael Rouxel-Labbé
parent 9a087ffe6f
commit ea970f5aa5
3 changed files with 20 additions and 12 deletions

View File

@ -425,10 +425,13 @@ protected:
const Point& p,
const Index& index) const
{
typename Gt::Construct_point_3 cp =
r_tr_.geom_traits().construct_point_3_object();
const Facet mirror = mirror_facet(f);
f.first->set_facet_surface_center(f.second, p.point());
mirror.first->set_facet_surface_center(mirror.second, p.point());
f.first->set_facet_surface_center(f.second, cp(p));
mirror.first->set_facet_surface_center(mirror.second, cp(p));
f.first->set_facet_surface_center_index(f.second,index);
mirror.first->set_facet_surface_center_index(mirror.second,index);
@ -761,7 +764,7 @@ public:
typedef Container_ Container; // Because we need it in Mesher_level
typedef typename Container::Element Container_element;
typedef typename Tr::Point Point;
typedef typename Tr::Point Point;//Weighted_point
typedef typename Tr::Facet Facet;
typedef typename Tr::Vertex_handle Vertex_handle;
typedef typename Triangulation_mesher_level_traits_3<Tr>::Zone Zone;
@ -1818,6 +1821,8 @@ is_facet_encroached(const Facet& facet,
typename Gt::Compare_power_distance_3 compare_distance =
r_tr_.geom_traits().compare_power_distance_3_object();
typename Gt::Construct_point_3 cp =
r_tr_.geom_traits().construct_point_3_object();
const Cell_handle& cell = facet.first;
const int& facet_index = facet.second;
@ -1826,7 +1831,7 @@ is_facet_encroached(const Facet& facet,
// facet is encroached if the new point is near from center than
// one vertex of the facet
return ( compare_distance(center.point(), reference_point, point) != CGAL::SMALLER );
return ( compare_distance(cp(center), reference_point, point) != CGAL::SMALLER );
}
template<class Tr, class Cr, class MD, class C3T3_, class Ct, class C_>
@ -1843,8 +1848,6 @@ is_encroached_facet_refinable(Facet& facet) const
typename Gt::Compare_weighted_squared_radius_3 compare =
Gt().compare_weighted_squared_radius_3_object();
typename Gt::Construct_point_3 wp2p = Gt().construct_point_3_object();
const Cell_handle& c = facet.first;
const int& k = facet.second;

View File

@ -90,7 +90,8 @@ public:
const Weighted_point & r,
const Weighted_point & s ) const
{
return this->operator()(p.point(), q.point(), r.point(), s.point());
typename K::Construct_point_3 cp = K().construct_point_3_object();
return this->operator()(cp(p), cp(q), cp(r), cp(s));
}
FT operator() ( const Bare_point & p,
@ -182,7 +183,8 @@ public:
const Weighted_point & s,
bool force_exact = false) const
{
CGAL_precondition(Rt().orientation_3_object()(p.point(),q.point(),r.point(),s.point()) == CGAL::POSITIVE);
CGAL_precondition(Rt().orientation_3_object()(
wp2p(p), wp2p(q), wp2p(r), wp2p(s)) == CGAL::POSITIVE);
// We use power_side_of_power_sphere_3: it is static filtered and
// we know that p,q,r,s are positive oriented
@ -211,7 +213,7 @@ public:
Bare_point res(p.x() + num_x*inv, p.y() - num_y*inv, p.z() + num_z*inv);
if(unweighted){
if(side_of_oriented_sphere(p.point(),q.point(),r.point(),s.point(), res)
if (side_of_oriented_sphere(wp2p(p), wp2p(q), wp2p(r), wp2p(s), res)
== CGAL::ON_POSITIVE_SIDE )
return res;
} else {
@ -279,12 +281,14 @@ public:
typename Rt::Side_of_bounded_sphere_3 side_of_bounded_sphere =
Rt().side_of_bounded_sphere_3_object();
typename Rt::Construct_point_3 cp =
Rt().construct_point_3_object();
// No division here
result_type point = weighted_circumcenter(p,q);
// Fast output
if ( side_of_bounded_sphere(p.point(),q.point(),point) == CGAL::ON_BOUNDED_SIDE )
if ( side_of_bounded_sphere(cp(p), cp(q), point) == CGAL::ON_BOUNDED_SIDE )
return point;
// Switch to exact

View File

@ -1124,7 +1124,8 @@ pump_vertex(const Vertex_handle& pumped_vertex,
// If best_weight < pumped_vertex weight, nothing to do
if ( best_weight > pumped_vertex->point().weight() )
{
Weighted_point wp(pumped_vertex->point().point(), best_weight);
typename Gt::Construct_point_3 wp2p = Gt().construct_point_3_object();
Weighted_point wp(wp2p(pumped_vertex->point()), best_weight);
// Insert weighted point into mesh
// note it can fail if the mesh is non-manifold at pumped_vertex