From bfdb4a52da13ae259be61a0ff0dbc465be2ec2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 15 Apr 2017 23:20:52 +0200 Subject: [PATCH] Fixed using Weighted_point_creator to construct weighted point This class is obsolete; kernel functors should be used. --- Mesh_3/benchmark/Mesh_3/StdAfx.h | 1 - Mesh_3/test/Mesh_3/test_c3t3.cpp | 19 +++++----- .../test/Mesh_3/test_c3t3_with_features.cpp | 37 +++++++++---------- Mesh_3/test/Mesh_3/test_criteria.cpp | 29 +++++++-------- .../test_robust_weighted_circumcenter.cpp | 24 +++++------- 5 files changed, 51 insertions(+), 59 deletions(-) diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index fd548f06dce..13ae5ebff04 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -214,7 +214,6 @@ //#include //#include //#include -//#include //#include //#include //#include diff --git a/Mesh_3/test/Mesh_3/test_c3t3.cpp b/Mesh_3/test/Mesh_3/test_c3t3.cpp index 893f399a0c6..1fcc90ced27 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3.cpp @@ -25,7 +25,6 @@ #include #include "test_utilities.h" -#include #include @@ -47,10 +46,11 @@ struct Tester typedef typename CGAL::Mesh_triangulation_3::type Tr; typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; + typedef typename Tr::Bare_point Bare_point; + typedef typename Tr::Weighted_point Weighted_point; + typedef typename Tr::Geom_traits Gt; typedef typename Gt::FT FT; - typedef typename Gt::Point_3 Point; - typedef CGAL::Mesh_3::Creator_weighted_point_3 Point_creator; typedef typename C3t3::Cell_handle Cell_handle; typedef typename C3t3::Facet Facet; @@ -79,11 +79,10 @@ struct Tester //------------------------------------------------------- // Data generation : fill a triangulation with 4 vertices //------------------------------------------------------- - Point_creator creator; - Point p1 = creator(0,0,0); - Point p2 = creator(1,0,0); - Point p3 = creator(0,1,0); - Point p4 = creator(0,0,1); + Weighted_point p1(0,0,0); + Weighted_point p2(1,0,0); + Weighted_point p3(0,1,0); + Weighted_point p4(0,0,1); tr.insert(p1); tr.insert(p2); @@ -234,8 +233,8 @@ struct Tester input >> polyhedron; input.close(); Mesh_domain domain(polyhedron); - - typedef std::vector > Initial_points_vector; + + typedef std::vector > Initial_points_vector; Initial_points_vector initial_points; domain.construct_initial_points_object()(std::back_inserter(initial_points), 6); 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 6e478fb018a..92c1d86f91b 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_with_features.cpp @@ -25,7 +25,6 @@ #include #include "test_utilities.h" -#include #include #include @@ -48,10 +47,11 @@ struct Tester typedef CGAL::Mesh_complex_3_in_triangulation_3< Tr, typename Md::Corner_index, typename Md::Curve_segment_index> C3t3; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Tr::Weighted_point Point; - typedef CGAL::Mesh_3::Creator_weighted_point_3 Point_creator; + typedef typename Tr::Bare_point Bare_point; + typedef typename Tr::Weighted_point Weighted_point; + + typedef typename Tr::Geom_traits Gt; + typedef typename Gt::FT FT; typedef typename C3t3::Cell_handle Cell_handle; typedef typename C3t3::Facet Facet; @@ -83,15 +83,14 @@ struct Tester assert(c3t3.number_of_facets_in_complex() == 0); assert(c3t3.number_of_edges_in_complex() == 0); assert(c3t3.number_of_vertices_in_complex() == 0); - + //------------------------------------------------------- // Data generation : fill a triangulation with 4 vertices //------------------------------------------------------- - Point_creator creator; - Point p1 = creator(0,0,0); - Point p2 = creator(1,0,0); - Point p3 = creator(0,1,0); - Point p4 = creator(0,0,1); + Weighted_point p1(0,0,0); + Weighted_point p2(1,0,0); + Weighted_point p3(0,1,0); + Weighted_point p4(0,0,1); Vertex_handle vp1 = tr.insert(p1); Vertex_handle vp2 = tr.insert(p2); @@ -248,14 +247,14 @@ struct Tester //------------------------------------------------------- std::cout << "Insert 6 points in c3t3_bis, add 1 corner and 1 edge to c3t3_bis\n"; - std::vector points; - points.push_back(creator(10,11,12)); - points.push_back(creator(11,13,10)); - points.push_back(creator(7,4,6)); - points.push_back(creator(5,2,14)); - points.push_back(creator(1,2,3)); - points.push_back(creator(3,9,13)); - + std::vector points; + points.push_back(Weighted_point(10,11,12)); + points.push_back(Weighted_point(11,13,10)); + points.push_back(Weighted_point(7,4,6)); + points.push_back(Weighted_point(5,2,14)); + points.push_back(Weighted_point(1,2,3)); + points.push_back(Weighted_point(3,9,13)); + C3t3 c3t3_bis; c3t3_bis.triangulation().insert(points.begin(),points.end()); diff --git a/Mesh_3/test/Mesh_3/test_criteria.cpp b/Mesh_3/test/Mesh_3/test_criteria.cpp index 004b710bfed..df4adf310d4 100644 --- a/Mesh_3/test/Mesh_3/test_criteria.cpp +++ b/Mesh_3/test/Mesh_3/test_criteria.cpp @@ -28,7 +28,6 @@ #include "test_utilities.h" #include -#include #include #include @@ -55,16 +54,17 @@ struct Tester typedef typename C3t3::Facet Facet; typedef typename C3t3::Surface_patch_index Surface_patch_index; - typedef typename Tr::Geom_traits Gt; - typedef typename Gt::FT FT; - typedef typename Gt::Point_3 Point; - typedef CGAL::Mesh_3::Creator_weighted_point_3 Point_creator; + typedef typename Tr::Bare_point Bare_point; + typedef typename Tr::Weighted_point Weighted_point; + + typedef typename Tr::Geom_traits Gt; + typedef typename Gt::FT FT; C3t3 c3t3_; // Cells & facets int c1_,c2_,f1_,f2_; // Facets center - Point p1_,p2_; + Bare_point p1_,p2_; Tester() : c3t3_() @@ -75,15 +75,14 @@ struct Tester { Tr& tr = c3t3_.triangulation(); - Point_creator creator; - Point p1 = creator(0,0,0); - Point p2 = creator(1,0,0); - Point p3 = creator(0,1,0); - Point p4 = creator(0,0,100); - Point p5 = creator(0,0,-1); + Weighted_point p1(0,0,0); + Weighted_point p2(1,0,0); + Weighted_point p3(0,1,0); + Weighted_point p4(0,0,100); + Weighted_point p5(0,0,-1); - p1_ = creator(0,.5,50); - p2_ = creator(1,1,-1); + p1_ = Bare_point(0,.5,50); + p2_ = Bare_point(1,1,-1); tr.insert(p1); tr.insert(p2); @@ -92,7 +91,7 @@ struct Tester tr.insert(p5); } - void init_facet(const Facet& f, const Point& p) const + void init_facet(const Facet& f, const Bare_point& p) const { f.first->set_surface_patch_index(f.second,Surface_patch_index(0,1)); f.first->set_facet_surface_center(f.second,p); 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 096bc1a78ae..d05d70dd852 100644 --- a/Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter.cpp +++ b/Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter.cpp @@ -24,7 +24,6 @@ //****************************************************************************** #include "test_utilities.h" -#include #include #include #include @@ -36,32 +35,29 @@ struct Tester typedef CGAL::Polyhedral_mesh_domain_3 Mesh_traits; 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 CGAL::Mesh_3::Creator_weighted_point_3 Point_creator; + typedef typename Tr::Geom_traits Gt; + typedef typename Gt::FT FT; typedef CGAL::Regular_triangulation_3 Triangulation; void operator()() const { - typename Gt::Construct_weighted_point_3 p2wp; //------------------------------------------------------- // Data generation : get 4 nearly coplanar points //------------------------------------------------------- - Point_creator creator; FT little(1e-10); FT tiny(1e-25); - - 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)); + + Weighted_point p1(little,1,tiny); + Weighted_point p2(1,little,0); + Weighted_point p3(-1*little,1,0); + Weighted_point p4(1,-1*little,0); + Weighted_point p5(0,0,1); + Weighted_point p6(0,1,0); std::cerr << "Using points: p1[" << p1 << "]\tp2[" << p2 << "]\tp3[" << p3 << "]\tp4[" << p4 << "]\tp5[" << p5