From c68bd75b6b4db15f3b71a10f93b0b2a90fe0f697 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 2 Mar 2017 18:57:51 +0100 Subject: [PATCH] Now also the examples compile --- ...tialize_triangulation_from_labeled_image.h | 4 ++-- .../Mesh_3/mesh_standard_facet_criteria.h | 19 ++++++++++------- .../test/Mesh_3/test_c3t3_with_features.cpp | 2 +- .../test_robust_weighted_circumcenter.cpp | 21 +++++++++++-------- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 50d163b8973..d37643d0129 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -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; diff --git a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h index a48f1821311..efa8ef5d8e0 100644 --- a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h +++ b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h @@ -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 ) diff --git a/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp b/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp index 4f8d4a87831..6e478fb018a 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp @@ -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 Point_creator; typedef typename C3t3::Cell_handle Cell_handle; diff --git a/Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter.cpp b/Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter.cpp index bf075f80977..096bc1a78ae 100644 --- a/Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter.cpp +++ b/Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter.cpp @@ -38,14 +38,17 @@ struct Tester typedef typename CGAL::Mesh_triangulation_3::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 Point_creator; + + typedef CGAL::Mesh_3::Creator_weighted_point_3 Point_creator; typedef CGAL::Regular_triangulation_3 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);