From d624271315a90b74ff7567a86a9bf37c33e65fe9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 21 Nov 2016 16:43:40 +0100 Subject: [PATCH] Remove usage of Regular_triangulation_euclidean_traits_3 --- .../test/Alpha_shapes_2/test_weight.cpp | 3 +- .../test/Alpha_shapes_3/bench_walpha.cpp | 40 +++++++++---------- .../test_fixed_alpha_shape_3.cpp | 6 +-- .../CGAL/regular_neighbor_coordinates_2.h | 2 +- .../CGAL/_test_regular_neighbors_2.cpp | 4 +- .../test_regular_neighbors_2.cpp | 7 +--- .../test/Skin_surface_3/anchor_test.cpp | 8 ++-- .../include/CGAL/Regular_triangulation_2.h | 17 ++++++-- .../test_regular_hierarchy_2.cpp | 7 +--- .../test_regular_triangulation_2.cpp | 12 +----- .../test/Triangulation_3/test_regular_3.cpp | 3 -- .../test_regular_as_delaunay_3.cpp | 6 +-- .../test_regular_insert_range_with_info.cpp | 1 - .../Triangulation_3/test_regular_remove_3.cpp | 3 -- .../Triangulation_3/test_regular_traits_3.cpp | 2 + .../Triangulation_3/test_static_filters.cpp | 11 +++-- .../test/Voronoi_diagram_2/vda_rt.cpp | 4 +- 17 files changed, 55 insertions(+), 81 deletions(-) diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp b/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp index 7326ef8cea9..52032b24b03 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp +++ b/Alpha_shapes_2/test/Alpha_shapes_2/test_weight.cpp @@ -14,7 +14,6 @@ the weighted Alpha Shape. #include #include -#include #include #include @@ -29,7 +28,7 @@ typedef K::Segment_2 Segment; typedef K::Line_2 Line; typedef K::Triangle_2 Triangle; -typedef CGAL::Regular_triangulation_euclidean_traits_2 Gt; +typedef K Gt; typedef CGAL::Regular_triangulation_vertex_base_2 Rvb; typedef CGAL::Regular_triangulation_face_base_2 Rf; diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp b/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp index 9f49cdec3a9..fed67b8139d 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp +++ b/Alpha_shapes_3/test/Alpha_shapes_3/bench_walpha.cpp @@ -3,11 +3,7 @@ #include #include #include -#ifndef CGAL_NO_DEPRECATED_CODE -# include -#endif #include -#include #include #include #include @@ -18,31 +14,33 @@ #include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Regular_triangulation_euclidean_traits_3 EPIC_traits; +typedef Kernel EPIC_traits; -typedef CGAL::Weighted_point_3 Weighted_point; -typedef CGAL::Fixed_alpha_shape_vertex_base_3 WFixed_Vb; +typedef Kernel::Weighted_point_3 Weighted_point; +typedef CGAL::Regular_triangulation_vertex_base_3 Vbb; +typedef CGAL::Fixed_alpha_shape_vertex_base_3 WFixed_Vb; typedef CGAL::Fixed_alpha_shape_cell_base_3 WFixed_Cb; typedef CGAL::Triangulation_data_structure_3 WFixed_TDS; typedef CGAL::Regular_triangulation_3 WFixed_DT; typedef CGAL::Fixed_alpha_shape_3< WFixed_DT > WFixed_AS; -typedef CGAL::Alpha_shape_vertex_base_3 WVb; +typedef CGAL::Alpha_shape_vertex_base_3 WVb; typedef CGAL::Alpha_shape_cell_base_3 WCb; typedef CGAL::Triangulation_data_structure_3 WTDS; typedef CGAL::Regular_triangulation_3 WDT; typedef CGAL::Alpha_shape_3< WDT > WAS; -typedef CGAL::Alpha_shape_vertex_base_3 WVb_f; +typedef CGAL::Alpha_shape_vertex_base_3 WVb_f; typedef CGAL::Alpha_shape_cell_base_3 WCb_f; typedef CGAL::Triangulation_data_structure_3 WTDS_f; typedef CGAL::Regular_triangulation_3 WDT_f; -typedef CGAL::Alpha_shape_3< WDT_f,CGAL::Tag_true > WAS_f; +typedef CGAL::Alpha_shape_3< WDT_f,CGAL::Tag_true > WAS_f; typedef CGAL::Exact_predicates_exact_constructions_kernel EKernel; -typedef CGAL::Regular_triangulation_euclidean_traits_3 EPEC_traits; -typedef CGAL::Alpha_shape_vertex_base_3 EVb; +typedef CGAL::Regular_triangulation_vertex_base_3 EVbb; +typedef EKernel EPEC_traits; +typedef CGAL::Alpha_shape_vertex_base_3 EVb; typedef CGAL::Alpha_shape_cell_base_3 ECb; typedef CGAL::Triangulation_data_structure_3 ETDS; typedef CGAL::Regular_triangulation_3 EDT; @@ -89,32 +87,32 @@ void make_one_run(const char* filename){ time.reset(); -//copy triangulation for familly alpha-shape +//copy triangulation for family alpha-shape WDT T1; T1.set_infinite_vertex( T1.tds().copy_tds( wfixed_as.tds(), wfixed_as.infinite_vertex() ) ); - std::cout << "Build familly weighted alpha complex" << std::endl; + std::cout << "Build family weighted alpha complex" << std::endl; time.start(); WAS w_as(T1,0,WAS::GENERAL); time.stop(); - std::cout << "Familly "<< time.time() << std::endl; + std::cout << "Family "<< time.time() << std::endl; time.reset(); - //copy triangulation for familly alpha-shape + //copy triangulation for family alpha-shape WDT_f T1f; T1f.set_infinite_vertex( T1f.tds().copy_tds(wfixed_as.tds(),wfixed_as.infinite_vertex()) ); - std::cout << "Build familly filtered weighted alpha complex" << std::endl; + std::cout << "Build family filtered weighted alpha complex" << std::endl; time.start(); WAS_f w_asf(T1f,0,WAS_f::GENERAL); time.stop(); - std::cout << "Familly filtered "<< time.time() << std::endl; + std::cout << "Family filtered "<< time.time() << std::endl; time.reset(); - std::list elst; + std::list elst; fill_wp_lists(filename,elst,1.4); //recreate the triangulation time.start(); @@ -122,11 +120,11 @@ void make_one_run(const char* filename){ time.stop(); std::cout << "Building exact regular triangulation: " << time.time() << std::endl;; time.reset(); - std::cout << "Build exact familly weighted alpha complex" << std::endl; + std::cout << "Build exact family weighted alpha complex" << std::endl; time.start(); EAS ase(edt,0,EAS::GENERAL); time.stop(); - std::cout << "Familly exact "<< time.time() << std::endl; + std::cout << "Family exact "<< time.time() << std::endl; } diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp b/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp index c7c5067fe83..3f0a649ffff 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp +++ b/Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3.cpp @@ -2,11 +2,8 @@ #include #include #include -#ifndef CGAL_NO_DEPRECATED_CODE -# include -#endif + #include -#include #include #include #include @@ -16,7 +13,6 @@ #include #include -//#include "Filtered_weighted_alpha_shape_euclidean_traits_3.h" typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Regular_triangulation_vertex_base_3 Vbb; diff --git a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h index 2f206dfc346..0bc452ceea4 100644 --- a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h +++ b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h @@ -171,7 +171,7 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt, typedef typename Rt::Geom_traits Traits; typedef typename Traits::FT Coord_type; - typedef typename Traits::Bare_point Bare_point; + typedef typename Rt::Bare_point Bare_point; typedef typename Rt::Vertex_handle Vertex_handle; typedef typename Rt::Face_circulator Face_circulator; diff --git a/Interpolation/test/Interpolation/include/CGAL/_test_regular_neighbors_2.cpp b/Interpolation/test/Interpolation/include/CGAL/_test_regular_neighbors_2.cpp index b3780c7ad19..7af484aa9f9 100644 --- a/Interpolation/test/Interpolation/include/CGAL/_test_regular_neighbors_2.cpp +++ b/Interpolation/test/Interpolation/include/CGAL/_test_regular_neighbors_2.cpp @@ -68,8 +68,8 @@ _test_regular_neighbors_2( const Triangul & ) typedef typename Triangul::Geom_traits Gt; typedef typename Gt::Weighted_point_2 Weighted_point; - typedef typename Gt::Bare_point Bare_point; - typedef typename Gt::Rep::FT Coord_type; + typedef typename Gt::Point_2 Bare_point; + typedef typename Gt::FT Coord_type; typedef std::vector< std::pair< Weighted_point, Coord_type > > Point_coordinate_vector; diff --git a/Interpolation/test/Interpolation/test_regular_neighbors_2.cpp b/Interpolation/test/Interpolation/test_regular_neighbors_2.cpp index 638f7c74a6b..f82a9268c86 100644 --- a/Interpolation/test/Interpolation/test_regular_neighbors_2.cpp +++ b/Interpolation/test/Interpolation/test_regular_neighbors_2.cpp @@ -22,17 +22,14 @@ #include #include -#include #include #include -struct K : CGAL::Exact_predicates_exact_constructions_kernel {}; -typedef double W; +typedef CGAL::Exact_predicates_exact_constructions_kernel K; -typedef CGAL::Regular_triangulation_euclidean_traits_2 Gt1; -typedef CGAL::Regular_triangulation_2 Rt1; +typedef CGAL::Regular_triangulation_2 Rt1; int main() { diff --git a/Skin_surface_3/test/Skin_surface_3/anchor_test.cpp b/Skin_surface_3/test/Skin_surface_3/anchor_test.cpp index 04a9c025eb3..00ca5423511 100644 --- a/Skin_surface_3/test/Skin_surface_3/anchor_test.cpp +++ b/Skin_surface_3/test/Skin_surface_3/anchor_test.cpp @@ -5,11 +5,9 @@ // ********************* #include #include -#include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Regular_triangulation_euclidean_traits_3 Regular_traits; -typedef CGAL::Regular_triangulation_3 Regular; +typedef CGAL::Regular_triangulation_3 Regular; #include @@ -17,8 +15,8 @@ typedef CGAL::Regular_triangulation_3 Regular; #include typedef Regular_traits::RT Weight; -typedef Regular_traits::Bare_point Point; -typedef Regular_traits::Weighted_point Weighted_point; +typedef Regular_traits::Point_3 Point; +typedef Regular_traits::Weighted_point_3 Weighted_point; typedef Regular::Vertex_handle Vertex_handle; typedef Regular::Edge Edge; typedef Regular::Facet Facet; diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_2.h index a6362d9f889..ea6cace6d94 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -44,18 +44,27 @@ namespace CGAL { +template < typename K_ > +struct Weighted_point_mapper_2 + : public K_ +{ + typedef typename K_::Weighted_point_2 Point_2; + + Weighted_point_mapper_2() {} + Weighted_point_mapper_2(const K_& k) : K_(k) {} +}; + template < class Gt, class Tds = Triangulation_data_structure_2 < - Regular_triangulation_vertex_base_2< - Regular_triangulation_euclidean_traits_2 >, + Regular_triangulation_vertex_base_2, Regular_triangulation_face_base_2 > > class Regular_triangulation_2 : public Triangulation_2< - Regular_triangulation_euclidean_traits_2, + Weighted_point_mapper_2, Tds> { typedef Regular_triangulation_2 Self; - typedef Regular_triangulation_euclidean_traits_2 RT_traits; + typedef Weighted_point_mapper_2 RT_traits; typedef Triangulation_2 Base; public: typedef Tds Triangulation_data_structure; diff --git a/Triangulation_2/test/Triangulation_2/test_regular_hierarchy_2.cpp b/Triangulation_2/test/Triangulation_2/test_regular_hierarchy_2.cpp index bb75eaf22c9..ca9437f286c 100644 --- a/Triangulation_2/test/Triangulation_2/test_regular_hierarchy_2.cpp +++ b/Triangulation_2/test/Triangulation_2/test_regular_hierarchy_2.cpp @@ -23,9 +23,7 @@ // ============================================================================ #include -#include -#include #include #include @@ -34,8 +32,7 @@ #include -typedef CGAL::Regular_triangulation_euclidean_traits_2 - RGt; +typedef CGAL::Exact_predicates_inexact_constructions_kernel RGt; typedef CGAL::Regular_triangulation_vertex_base_2 Vbb; typedef CGAL::Triangulation_hierarchy_vertex_base_2 Vb; @@ -52,8 +49,6 @@ int main() { std::cout << "Testing Triangulation_hierarchy_2" < -#include #include #include #include -typedef CGAL::Regular_triangulation_euclidean_traits_2 - RGt; +typedef CGAL::Exact_predicates_exact_constructions_kernel RGt; // Explicit instantiation of the whole class : template class CGAL::Regular_triangulation_2; @@ -39,19 +37,13 @@ template class CGAL::Regular_triangulation_2; int main() { std::cout << "Testing Regular_triangulation_2" < RCls; _test_cls_regular_triangulation_2( RCls() ); std::cout << "Testing Regular_triangulation_2" < RGt2; + typedef Test_rep_homogeneous RGt2; typedef CGAL::Regular_triangulation_2 RCls2; _test_cls_regular_triangulation_2( RCls2() ); diff --git a/Triangulation_3/test/Triangulation_3/test_regular_3.cpp b/Triangulation_3/test/Triangulation_3/test_regular_3.cpp index 92a421866c3..50a484300b1 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_3.cpp @@ -436,9 +436,6 @@ void test_RT() int main() { - std::cout << " with CGAL::Regular_triangulation_euclidean_traits_3: " - << std::endl; - test_RT >(); #ifdef CGAL_LINKED_WITH_TBB diff --git a/Triangulation_3/test/Triangulation_3/test_regular_as_delaunay_3.cpp b/Triangulation_3/test/Triangulation_3/test_regular_as_delaunay_3.cpp index 54dab06c6c2..94316e0601f 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_as_delaunay_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_as_delaunay_3.cpp @@ -19,7 +19,6 @@ // Author(s) : Sylvain Pion #include -#include bool del=true; @@ -27,11 +26,10 @@ bool del=true; #include "include/CGAL/_test_types.h" #include "include/CGAL/_test_cls_delaunay_3.h" -typedef CGAL::Regular_triangulation_euclidean_traits_3 Traits; int main() { - typedef CGAL::Regular_triangulation_3 Cls; + typedef CGAL::Regular_triangulation_3 Cls; _test_cls_delaunay_3( Cls() ); @@ -40,4 +38,4 @@ int main() // MipsPro prefers this after the other instantiations... // Explicit instantiation of the whole class : -template class CGAL::Regular_triangulation_3; +template class CGAL::Regular_triangulation_3; diff --git a/Triangulation_3/test/Triangulation_3/test_regular_insert_range_with_info.cpp b/Triangulation_3/test/Triangulation_3/test_regular_insert_range_with_info.cpp index efc87adc15e..49528c3a663 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_insert_range_with_info.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_insert_range_with_info.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include diff --git a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp index cae52bb324f..0860490b143 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp @@ -321,9 +321,6 @@ bool test_case (std::istream &is) int main(int argc, char **argv) { - std::cout << " with CGAL::Regular_triangulation_euclidean_traits_3: " - << std::endl; - // Test various data sets that crashed the code at some point in the past. // File format is: // number of points of first data set diff --git a/Triangulation_3/test/Triangulation_3/test_regular_traits_3.cpp b/Triangulation_3/test/Triangulation_3/test_regular_traits_3.cpp index 9e60bb74d33..e8cd5e606b3 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_traits_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_traits_3.cpp @@ -19,6 +19,8 @@ // // Author(s) : Mariette Yvinec +#define CGAL_NO_DEPRECATION_WARNINGS + #include #include #include diff --git a/Triangulation_3/test/Triangulation_3/test_static_filters.cpp b/Triangulation_3/test/Triangulation_3/test_static_filters.cpp index 59c0b31d56e..92d73e8e999 100644 --- a/Triangulation_3/test/Triangulation_3/test_static_filters.cpp +++ b/Triangulation_3/test/Triangulation_3/test_static_filters.cpp @@ -9,16 +9,15 @@ #include #include #include -#include typedef CGAL::Simple_cartesian Double_kernel; typedef CGAL::Simple_cartesian > Exact_kernel; typedef CGAL::Filtered_kernel FK_with_SF; typedef CGAL::Filtered_kernel FK_without_SF; -typedef CGAL::Regular_triangulation_euclidean_traits_3 Exact_traits; -typedef CGAL::Regular_triangulation_euclidean_traits_3 FTr_without_SF; -typedef CGAL::Regular_triangulation_euclidean_traits_3 FTr_with_SF; +typedef Exact_kernel Exact_traits; +typedef FK_without_SF FTr_without_SF; +typedef FK_with_SF FTr_with_SF; typedef std::pair NT_pair; template < class K1, class K2, class Cmp = CGAL::dont_check_equal > @@ -77,7 +76,7 @@ double my_rand() Weighted_point_3 my_rand_wp3() { double x = my_rand(), y = my_rand(), z = my_rand(), r=my_rand(); - return Weighted_point_3( FTr_with_SF::Weighted_point_3(FTr_with_SF::Bare_point(x, y, z),r) , FTr_without_SF::Weighted_point_3(FTr_without_SF::Bare_point(x, y, z),r) ); + return Weighted_point_3( FTr_with_SF::Weighted_point_3(FTr_with_SF::Point_3(x, y, z),r) , FTr_without_SF::Weighted_point_3(FTr_without_SF::Point_3(x, y, z),r) ); } // Perturbation with given maximum relative epsilon. @@ -87,7 +86,7 @@ void perturb(Weighted_point_3 &p, double rel_eps) double y = CGAL_IA_FORCE_TO_DOUBLE(p.first.y()*(1+rand_base()*rel_eps)); double z = CGAL_IA_FORCE_TO_DOUBLE(p.first.z()*(1+rand_base()*rel_eps)); double r = CGAL_IA_FORCE_TO_DOUBLE(p.first.weight()*(1+rand_base()*rel_eps)); - p=Weighted_point_3( FTr_with_SF::Weighted_point_3(FTr_with_SF::Bare_point(x, y, z),r) , FTr_without_SF::Weighted_point_3(FTr_without_SF::Bare_point(x, y, z),r) ); + p=Weighted_point_3( FTr_with_SF::Weighted_point_3(FTr_with_SF::Point_3(x, y, z),r) , FTr_without_SF::Weighted_point_3(FTr_without_SF::Point_3(x, y, z),r) ); } void toto (int){} diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp index ef440b529cc..84c6dc763a3 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp @@ -29,12 +29,10 @@ #include #include -#include #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -struct Gt : public CGAL::Regular_triangulation_euclidean_traits_2 {}; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt; #if 1 // definitions for hierarchy