Now also the examples compile

This commit is contained in:
Andreas Fabri 2017-03-02 18:57:51 +01:00 committed by Mael Rouxel-Labbé
parent 780e01dc90
commit c68bd75b6b
4 changed files with 27 additions and 19 deletions

View File

@ -150,7 +150,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3,
construct_intersection(Segment_3(it->first, test));
if (CGAL::cpp11::get<2>(intersect) != 0)
{
Bare_point pi = CGAL::cpp11::get<0>(intersect);
Weighted_point pi = tr.geom_traits().construct_weighted_point_3_object()(CGAL::cpp11::get<0>(intersect));
// This would cause trouble to optimizers
// check pi will not be hidden
@ -196,7 +196,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3,
{
if (cv->point().weight() == 0.)
continue;
if (CGAL::compare_squared_distance(pi, cv->point().point(), cv->point().weight())
if (CGAL::compare_squared_distance(pi.point(), cv->point().point(), cv->point().weight())
!= CGAL::LARGER)
{
pi_inside_protecting_sphere = true;

View File

@ -196,6 +196,7 @@ protected:
typedef typename Tr::Geom_traits Gt;
typedef typename Tr::Weighted_point Weighted_point;
typedef typename Tr::Bare_point Bare_point;
typename Gt::Compute_squared_distance_3 distance =
Gt().compute_squared_distance_3_object();
@ -206,7 +207,7 @@ protected:
const Weighted_point& p2 = f.first->vertex((f.second+2)&3)->point();
const Weighted_point& p3 = f.first->vertex((f.second+3)&3)->point();
const Weighted_point c = circumcenter(p1,p2,p3);
const Bare_point c = circumcenter(p1,p2,p3);
const FT sq_dist = distance(c, f.first->get_facet_surface_center(f.second));
@ -267,6 +268,7 @@ protected:
typedef typename Tr::Geom_traits Gt;
typedef typename Tr::Weighted_point Weighted_point;
typedef typename Tr::Bare_point Bare_point;
typename Gt::Compute_squared_distance_3 distance =
Gt().compute_squared_distance_3_object();
@ -277,14 +279,14 @@ protected:
const Weighted_point& p2 = f.first->vertex((f.second+2)&3)->point();
const Weighted_point& p3 = f.first->vertex((f.second+3)&3)->point();
const Weighted_point c = circumcenter(p1,p2,p3);
const Weighted_point& ball_center = f.first->get_facet_surface_center(f.second);
const Bare_point c = circumcenter(p1,p2,p3);
const Bare_point& ball_center = f.first->get_facet_surface_center(f.second);
const FT sq_dist = distance(c, ball_center);
const Index& index = f.first->get_facet_surface_center_index(f.second);
const FT sq_bound = CGAL::square(size_(ball_center.point(), 2, index));
const FT sq_bound = CGAL::square(size_(ball_center, 2, index));
CGAL_assertion(sq_bound > FT(0));
if ( sq_dist > sq_bound )
@ -351,16 +353,19 @@ protected:
typedef typename Tr::Geom_traits Gt;
typedef typename Tr::Weighted_point Weighted_point;
typedef typename Tr::Bare_point Bare_point;
typename Gt::Compute_squared_distance_3 distance =
Gt().compute_squared_distance_3_object();
const Weighted_point& p1 = f.first->vertex((f.second+1)&3)->point();
const Weighted_point& ball_center = f.first->get_facet_surface_center(f.second);
typename Gt::Construct_point_3 wp2p = Gt().construct_point_3_object();
const Bare_point& p1 = wp2p(f.first->vertex((f.second+1)&3)->point());
const Bare_point& ball_center = f.first->get_facet_surface_center(f.second);
const Index& index = f.first->get_facet_surface_center_index(f.second);
const FT sq_radius = distance(p1,ball_center);
const FT sq_bound = CGAL::square(size_(ball_center.point(), 2, index));
const FT sq_bound = CGAL::square(size_(ball_center, 2, index));
CGAL_assertion(sq_bound > FT(0));
if ( sq_radius > sq_bound )

View File

@ -50,7 +50,7 @@ struct Tester
typedef typename Tr::Geom_traits Gt;
typedef typename Gt::FT FT;
typedef typename Gt::Point_3 Point;
typedef typename Tr::Weighted_point Point;
typedef CGAL::Mesh_3::Creator_weighted_point_3<FT, Point> Point_creator;
typedef typename C3t3::Cell_handle Cell_handle;

View File

@ -38,14 +38,17 @@ struct Tester
typedef typename CGAL::Mesh_triangulation_3<Mesh_traits>::type Tr;
typedef typename Tr::Geom_traits Gt;
typedef typename Tr::Bare_point Bare_point;
typedef typename Tr::Weighted_point Weighted_point;
typedef typename Gt::FT FT;
typedef typename Gt::Point_3 Point;
typedef CGAL::Mesh_3::Creator_weighted_point_3<FT, Point> Point_creator;
typedef CGAL::Mesh_3::Creator_weighted_point_3<FT, Bare_point> Point_creator;
typedef CGAL::Regular_triangulation_3<Gt> Triangulation;
void operator()() const
{
typename Gt::Construct_weighted_point_3 p2wp;
//-------------------------------------------------------
// Data generation : get 4 nearly coplanar points
//-------------------------------------------------------
@ -53,12 +56,12 @@ struct Tester
FT little(1e-10);
FT tiny(1e-25);
Point p1 = creator(little,1,tiny);
Point p2 = creator(1,little,0);
Point p3 = creator(-1*little,1,0);
Point p4 = creator(1,-1*little,0);
Point p5 = creator(0,0,1);
Point p6 = creator(0,1,0);
Weighted_point p1 = p2wp(creator(little,1,tiny));
Weighted_point p2 = p2wp(creator(1,little,0));
Weighted_point p3 = p2wp(creator(-1*little,1,0));
Weighted_point p4 = p2wp(creator(1,-1*little,0));
Weighted_point p5 = p2wp(creator(0,0,1));
Weighted_point p6 = p2wp(creator(0,1,0));
std::cerr << "Using points: p1[" << p1 << "]\tp2[" << p2
<< "]\tp3[" << p3 << "]\tp4[" << p4 << "]\tp5[" << p5
@ -70,7 +73,7 @@ struct Tester
typename Gt::Construct_weighted_circumcenter_3 circumcenter =
Gt().construct_weighted_circumcenter_3_object();
Point center = circumcenter(p1,p2);
Bare_point center = circumcenter(p1,p2);
std::cerr << "\tcircumcenter(p1,p2)=[" << center << "]\n";
center = circumcenter(p1,p3,p6);