From a0427ec7560c59f5e7b6e6620b72628d37e752d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 26 Apr 2018 13:06:21 +0200 Subject: [PATCH] Fixed abusing Triangulation_cell_base_3 for Delaunay triangulations TriangulationCellBase_3 does not request a circumcenter; DelaunayTriangulationCellBase_3 does. Delaunay_triangulation_3 only compiled because Triangulation_cell_base_3 (and Triangulation_ds_cell_base_3 !) provided circumcenter() operators and DT3 inherited T3's TDS. - The circumcenter() functions are removed where they shouldn't exist - DT3 uses DT_cell_base_3 as cell base instead of T_cell_base_3 - Concepts/Classes that supposedly only required TriangulationCellBase_3 and then built Delaunay triangulations with that (Alpha Shapes, etc.) are upgraded to request DelaunayTriangulationCellBase_3 (anyway, it wouldn't compile if you actually provided a model of TriangulationCellBase_3) - Fixed various wrong templates in classes/concepts such as MeshVertexBase_3 not refining RegularTriangulationVertexBase_3 and (only in the doc) defaulting to Triangulation_vertex_base_3 - Removed the deprecated class (for 4+ years) T_cell_base_with_circumcenter --- ...front_surface_reconstruction_cell_base_3.h | 7 ++- .../CGAL/Alpha_shape_cell_base_3.h | 4 +- .../CGAL/Fixed_alpha_shape_cell_base_3.h | 4 +- .../Concepts/AlphaShapeCell_3.h | 2 +- .../Concepts/FixedAlphaShapeCell_3.h | 2 +- .../include/CGAL/Alpha_shape_cell_base_3.h | 6 +-- .../CGAL/Fixed_alpha_shape_cell_base_3.h | 4 +- Hash_map/test/Hash_map/Hash.cpp | 3 +- Mesh_3/doc/Mesh_3/CGAL/Mesh_vertex_base_3.h | 4 +- Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h | 5 +- .../CGAL/Mesh_3/Triangulation_sizing_field.h | 12 +++-- .../CGAL/Periodic_3_mesh_triangulation_3.h | 4 +- .../CGAL/Reconstruction_triangulation_3.h | 9 +++- .../Hole_filling/Triangulate_hole_polyline.h | 4 +- .../Classification/Cluster_classification.cpp | 6 ++- .../Plugins/Point_set/Alpha_shape_plugin.cpp | 4 +- .../Shape_construction_3.h | 25 +++++----- .../Mean_curvature_flow_skeletonization.h | 4 +- Surface_mesher/demo/Surface_mesher/volume.h | 7 ++- .../CGAL/Surface_mesh_cell_base_3.h | 18 +++---- .../Concepts/SurfaceMeshCellBase_3.h | 3 +- .../Complex_2_in_triangulation_cell_base_3.h | 6 +-- ...Complex_2_in_triangulation_vertex_base_3.h | 2 +- .../include/CGAL/Surface_mesh_cell_base_3.h | 4 +- .../CGAL/Triangulation_ds_cell_base_3.h | 13 ----- .../Triangulation_benchmark_3.cpp | 2 +- .../demo/Triangulation_3/typedefs.h | 10 ++-- .../Triangulation_3_color_demo.cpp | 3 +- ...angulation_cell_base_with_circumcenter_3.h | 4 +- .../doc/Triangulation_3/Triangulation_3.txt | 2 +- .../Triangulation_3/adding_handles_3.cpp | 11 +++-- .../examples/Triangulation_3/color.cpp | 10 ++-- .../Triangulation_3/fast_location_3.cpp | 6 +-- .../info_insert_with_pair_iterator.cpp | 5 +- .../info_insert_with_transform_iterator.cpp | 6 ++- .../info_insert_with_zip_iterator.cpp | 8 +++- .../parallel_insertion_in_delaunay_3.cpp | 15 +++--- .../Triangulation_3/regular_with_info_3.cpp | 4 ++ .../Triangulation_3/sequential_parallel.cpp | 11 +++-- .../include/CGAL/Delaunay_triangulation_3.h | 38 +++++++++------ .../CGAL/Delaunay_triangulation_cell_base_3.h | 47 ++++++++++++++----- ...angulation_cell_base_with_circumcenter_3.h | 4 +- .../CGAL/Regular_triangulation_cell_base_3.h | 31 ++---------- .../include/CGAL/Triangulation_cell_base_3.h | 33 ------------- .../Delaunay_triangulation_hierarchy_3.h | 14 +++--- ...cell_base_with_weighted_circumcenter_3.cpp | 19 ++++---- .../test/Triangulation_3/test_delaunay_3.cpp | 6 +-- .../test_delaunay_hierarchy_3_old.cpp | 3 +- 48 files changed, 234 insertions(+), 220 deletions(-) diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h index c83eb1d9290..99cfa924cdf 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h @@ -23,8 +23,7 @@ #include - -#include +#include namespace CGAL { @@ -36,9 +35,9 @@ namespace CGAL { \tparam Traits has to be a model of `DelaunayTriangulationTraits_3`. - \tparam Cb has to be a model of `TriangulationCellBase_3`. + \tparam Cb has to be a model of `DelaunayTriangulationCellBase_3`. */ - template < typename Traits, typename Cb = Triangulation_cell_base_3 > + template < typename Traits, typename Cb = Delaunay_triangulation_cell_base_3 > class Advancing_front_surface_reconstruction_cell_base_3 : public Cb { diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h index 894644e3246..f733d1a9a8c 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h @@ -10,7 +10,7 @@ The class `Alpha_shape_cell_base_3` is the default model for the concept \tparam Traits is the geometric traits class that is provided to the `Alpha_shape_3` class. \tparam Cb must be a cell base class adapted to the type of triangulation that is being used. - By default, it is instantiated with `Triangulation_cell_base_3`, + By default, it is instantiated with `Delaunay_triangulation_cell_base_3`, which is appropriate for basic alpha shapes. \tparam ExactAlphaComparisonTag is a tag that, when set to \link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description @@ -21,7 +21,7 @@ and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_fals \cgalModels `AlphaShapeCell_3` -\sa `Triangulation_cell_base_3` +\sa `Delaunay_triangulation_cell_base_3` \sa `Regular_triangulation_cell_base_3` \sa `Periodic_3_triangulation_ds_cell_base_3` */ diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h index 535e9ac482b..776e787b20c 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h @@ -10,13 +10,13 @@ The class `Fixed_alpha_shape_cell_base_3` is the default model for the concept \tparam Traits is the geometric traits class that is provided to the `Alpha_shape_3` class. \tparam Cb must be a cell base class adapted to the type of triangulation that is being used. - By default, it is instantiated with `Triangulation_cell_base_3`, + By default, it is instantiated with `Delaunay_triangulation_cell_base_3`, which is appropriate for basic alpha shapes. \cgalModels `FixedAlphaShapeCell_3` \sa `Alpha_shape_cell_base_3` -\sa `Triangulation_cell_base_3` +\sa `Delaunay_triangulation_cell_base_3` \sa `Regular_triangulation_cell_base_3` \sa `Periodic_3_triangulation_ds_cell_base_3` */ diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h index c2baca24db6..cfc43489b6e 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/AlphaShapeCell_3.h @@ -5,7 +5,7 @@ The concept `AlphaShapeCell_3` describes the requirements for the base cell of an alpha shape. -\cgalRefines `TriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation. +\cgalRefines `DelaunayTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation. \cgalRefines `RegularTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a regular triangulation. \cgalRefines `Periodic_3TriangulationDSCellBase_3`, if the underlying triangulation of the alpha shape is a periodic triangulation. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h index 597b596551d..95b29d94909 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Concepts/FixedAlphaShapeCell_3.h @@ -5,7 +5,7 @@ The concept `FixedAlphaShapeCell_3` describes the requirements for the base cell of a alpha shape with a fixed value alpha. -\cgalRefines `TriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation. +\cgalRefines `DelaunayTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation. \cgalRefines `RegularTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a regular triangulation. \cgalRefines `Periodic_3TriangulationDSCellBase_3`, if the underlying triangulation of the alpha shape is a periodic triangulation. diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h index 63ea592bc55..11938e61453 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_cell_base_3.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -61,9 +61,9 @@ template < class Gt, class ExactAlphaComparisonTag = Tag_false, class Weighted_tag = Tag_false > class Alpha_shape_cell_base_3 - : public Default::Get >::type + : public Default::Get >::type { - typedef typename Default::Get >::type Cb; + typedef typename Default::Get >::type Cb; public: typedef typename Cb::Vertex_handle Vertex_handle; typedef typename Cb::Cell_handle Cell_handle; diff --git a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h index d991b618b14..72caaa45e44 100644 --- a/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/include/CGAL/Fixed_alpha_shape_cell_base_3.h @@ -28,12 +28,12 @@ #include #include -#include +#include #include namespace CGAL { -template < class Gt, class Cb = Triangulation_cell_base_3 > +template < class Gt, class Cb = Delaunay_triangulation_cell_base_3 > class Fixed_alpha_shape_cell_base_3 : public Cb { diff --git a/Hash_map/test/Hash_map/Hash.cpp b/Hash_map/test/Hash_map/Hash.cpp index fd558a42659..d0b30b0352c 100644 --- a/Hash_map/test/Hash_map/Hash.cpp +++ b/Hash_map/test/Hash_map/Hash.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,7 @@ typedef CGAL::Triangulation_2 Triangulation_2; #ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Triangulation_data_structure_3< CGAL::Triangulation_vertex_base_3, - CGAL::Triangulation_cell_base_3, + CGAL::Delaunay_triangulation_cell_base_3, CGAL::Parallel_tag> Tds; typedef CGAL::Delaunay_triangulation_3 Triangulation_3; #endif diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_vertex_base_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_vertex_base_3.h index 718e8e057e8..45ebab05e42 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_vertex_base_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_vertex_base_3.h @@ -16,8 +16,8 @@ the faces of the input complex. It must be a model of the concept `MeshDomain_3`. \tparam Vb is the vertex base class. It has to be a model -of the concept `TriangulationVertexBase_3` and defaults to -`Triangulation_vertex_base_3`. +of the concept `RegularTriangulationVertexBase_3` and defaults to +`Regular_triangulation_vertex_base_3`. \cgalModels `MeshVertexBase_3` diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h index ef505627f58..a681cdb4be7 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h @@ -4,9 +4,8 @@ The concept `MeshVertexBase_3` describes the requirements for the `Vertex` type of the triangulation -used by a 3D mesh generation process. The type `MeshVertexBase_3` refines both the concept `TriangulationVertexBase_3` -and -the concept `SurfaceMeshVertexBase_3`. +used by a 3D mesh generation process. The type `MeshVertexBase_3` refines both +the concept `RegularTriangulationVertexBase_3` and the concept `SurfaceMeshVertexBase_3`. It provides additional members to store and retrieve information about the location of the vertex with respect to the input domain describing the domain to be discretized. diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h index 9db4d0c7cba..c20c3ebf070 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h @@ -29,10 +29,11 @@ #include - -#include #include #include +#include +#include +#include #include #include @@ -54,8 +55,11 @@ class Triangulation_sizing_field typedef typename Tr::Weighted_point Weighted_point; typedef typename Gt::FT FT; - typedef Triangulation_vertex_base_with_info_3 Vb; - typedef Triangulation_cell_base_3 Cb; + typedef Triangulation_vertex_base_with_info_3 Vbb; + typedef Regular_triangulation_vertex_base_3 Vb; + typedef Triangulation_cell_base_3 Cbb; + typedef Regular_triangulation_cell_base_3< + Gt, Cbb, Discard_hidden_points> Cb; typedef Triangulation_data_structure_3 Tds; typedef Regular_triangulation_3 Compact_triangulation; typedef Compact_triangulation Ctr; diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h index 036fbf6ff20..0a19e4eb108 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h @@ -12,10 +12,10 @@ the triangulation type to be used for the 3D periodic triangulation embedding th `Default` may be used, with default value `Kernel_traits::%Kernel`. \tparam Vertex_base must be a model of `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`. -`Default` may be used, with default value `Mesh_vertex_base_3 >`. +`Default` may be used, with default value `Mesh_vertex_base_3 >`. \tparam Cell_base must be a model of `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`. -`Default` may be used, with default value `Mesh_cell_base_3 > >`. +`Default` may be used, with default value `Mesh_cell_base_3 > >`. \warning The input traits `Gt` are wrapped multiple times to handle periodicity and to improve the robustness of the meshing process: for example, diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h index 24485798fb3..ff8acb482b3 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -173,8 +174,12 @@ struct Reconstruction_triangulation_default_geom_traits_3 : public BaseGt template , - class Tds_ = Triangulation_data_structure_3, Triangulation_cell_base_with_info_3 > > -class Reconstruction_triangulation_3 : public Delaunay_triangulation_3 + class Tds_ = Triangulation_data_structure_3< + Reconstruction_vertex_base_3, + Delaunay_triangulation_cell_base_3< + Gt, Triangulation_cell_base_with_info_3 > > > +class Reconstruction_triangulation_3 + : public Delaunay_triangulation_3 { // Private types private: diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h index 3a1c7c1503d..a893b035e3d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -755,7 +756,8 @@ public: typedef std::vector Polyline_3; typedef Triangulation_vertex_base_with_info_3 VB_with_id; - typedef Triangulation_data_structure_3 TDS; + typedef Delaunay_triangulation_cell_base_3 CB; + typedef Triangulation_data_structure_3 TDS; typedef Delaunay_triangulation_3 Triangulation; typedef typename Triangulation::Finite_edges_iterator Finite_edges_iterator; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp index 601dbe7c33d..db1228fbbad 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp @@ -7,6 +7,7 @@ #include "Color_ramp.h" #include +#include #include #include #include @@ -245,8 +246,9 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po #endif // Compute neighborhood - typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; - typedef CGAL::Triangulation_data_structure_3 Tds; + typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; + typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; + typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; Delaunay dt (boost::make_transform_iterator diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp index bdea82e9c05..c66c5c40beb 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp @@ -38,8 +38,8 @@ typedef K::Triangle_3 Triangle_3; typedef K::Iso_cuboid_3 Iso_cuboid_3; typedef CGAL::Triangulation_vertex_base_with_info_3 Vb1; -typedef CGAL::Alpha_shape_vertex_base_3 Vb; -typedef CGAL::Alpha_shape_cell_base_3 Fb; +typedef CGAL::Alpha_shape_vertex_base_3 Vb; +typedef CGAL::Alpha_shape_cell_base_3 Fb; typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Triangulation_3; diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h index b6bacc5e4f4..7520f6815f7 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h @@ -72,12 +72,14 @@ namespace CGAL { * scale. It must be a Boolean_tag type. */ template < class GeomTraits, class FixedSurface > -class Shape_construction_3 { +class Shape_construction_3 +{ typedef Triangulation_vertex_base_with_info_3< unsigned int, GeomTraits > Vb; - typedef Alpha_shape_vertex_base_3< GeomTraits, Vb > aVb; - typedef Triangulation_cell_base_with_info_3< unsigned int, GeomTraits > Cb; - typedef Alpha_shape_cell_base_3< GeomTraits, Cb > aCb; - typedef Triangulation_data_structure_3 Tds; + typedef Alpha_shape_vertex_base_3< GeomTraits, Vb > aVb; + typedef Triangulation_cell_base_with_info_3< unsigned int, GeomTraits > Cbb; + typedef Delaunay_triangulation_cell_base_3< GeomTraits, Cbb > Cb; + typedef Alpha_shape_cell_base_3< GeomTraits, Cb > aCb; + typedef Triangulation_data_structure_3 Tds; public: /// \name Types @@ -157,14 +159,15 @@ public: // The type for the shape of a set of points with fixed scale. template < class GeomTraits > -class Shape_construction_3 < GeomTraits, Tag_true > { - +class Shape_construction_3 < GeomTraits, Tag_true > +{ typedef Triangulation_vertex_base_with_info_3< unsigned int, GeomTraits > Vb; - typedef Fixed_alpha_shape_vertex_base_3< GeomTraits, Vb > aVb; - typedef Triangulation_cell_base_with_info_3< unsigned int, GeomTraits > Cb; - typedef Fixed_alpha_shape_cell_base_3< GeomTraits, Cb > aCb; + typedef Fixed_alpha_shape_vertex_base_3< GeomTraits, Vb > aVb; + typedef Triangulation_cell_base_with_info_3< unsigned int, GeomTraits > Cbb; + typedef Delaunay_triangulation_cell_base_3< GeomTraits, Cbb > Cb; + typedef Fixed_alpha_shape_cell_base_3< GeomTraits, Cb > aCb; - typedef Triangulation_data_structure_3 Tds; + typedef Triangulation_data_structure_3 Tds; public: typedef Tds Triangulation_data_structure; diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index ae2f5d77a0e..df8246dd8b6 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -59,6 +59,7 @@ // For Voronoi diagram #include #include +#include #include // For debugging macro @@ -247,7 +248,8 @@ public: typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; - typedef CGAL::Triangulation_data_structure_3 Tds; + typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; + typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; typedef typename Delaunay::Point Exact_point; typedef typename Delaunay::Cell_handle Cell_handle; diff --git a/Surface_mesher/demo/Surface_mesher/volume.h b/Surface_mesher/demo/Surface_mesher/volume.h index 408cb6d71ee..9ba033af9d0 100644 --- a/Surface_mesher/demo/Surface_mesher/volume.h +++ b/Surface_mesher/demo/Surface_mesher/volume.h @@ -62,16 +62,19 @@ class QTreeWidgetItem; #include #include #include +#include #include #include #include #include #include #include + typedef CGAL::Surface_mesh_vertex_base_3 Vb; typedef CGAL::Triangulation_cell_base_with_info_3 Cb1; -typedef CGAL::Surface_mesh_cell_base_3 Cb2; -typedef CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3 Cb; +typedef CGAL::Delaunay_triangulation_cell_base_3 Cb2; +typedef CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3 Cb3; +typedef CGAL::Surface_mesh_cell_base_3 Cb; typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Tr; typedef CGAL::Surface_mesh_complex_2_in_triangulation_3 C2t3; diff --git a/Surface_mesher/doc/Surface_mesher/CGAL/Surface_mesh_cell_base_3.h b/Surface_mesher/doc/Surface_mesher/CGAL/Surface_mesh_cell_base_3.h index 7da5adea48e..ec2e8868eea 100644 --- a/Surface_mesher/doc/Surface_mesher/CGAL/Surface_mesh_cell_base_3.h +++ b/Surface_mesher/doc/Surface_mesher/CGAL/Surface_mesh_cell_base_3.h @@ -4,17 +4,17 @@ namespace CGAL { /*! \ingroup PkgSurfaceMesher3Classes -The class `Surface_mesh_cell_base_3` is a model of the concept -`SurfaceMeshCellBase_3`. -It is designed to serve as vertex base class -in a triangulation class `Tr` -plugged in a `Surface_mesh_complex_2_in_triangulation_3` -class. +The class `Surface_mesh_cell_base_3` is a model of the concept +`SurfaceMeshCellBase_3`. +It is designed to serve as cell base class +in a triangulation class `Tr` +plugged in a `Surface_mesh_complex_2_in_triangulation_3` +class. -\tparam Gt is the geometric traits class. +\tparam Gt is the geometric traits class. -\tparam Cb must be a model of the concept `TriangulationCellBase_3` -and defaults to `Triangulation_cell_base_3 `. +\tparam Cb must be a model of the concept `DelaunayTriangulationCellBase_3` +and defaults to `Delaunay_triangulation_cell_base_3`. \cgalModels `SurfaceMeshCellBase_3` diff --git a/Surface_mesher/doc/Surface_mesher/Concepts/SurfaceMeshCellBase_3.h b/Surface_mesher/doc/Surface_mesher/Concepts/SurfaceMeshCellBase_3.h index 3b3335ab1a8..e35a14f78c8 100644 --- a/Surface_mesher/doc/Surface_mesher/Concepts/SurfaceMeshCellBase_3.h +++ b/Surface_mesher/doc/Surface_mesher/Concepts/SurfaceMeshCellBase_3.h @@ -21,7 +21,8 @@ a three dimensional triangulation type The concept `SurfaceMeshCellBase_3` describes the cell base type required in this triangulation type. -\cgalRefines `TriangulationCellBase_3` +\cgalRefines `DelaunayTriangulationCellBase_3` + The concept `SurfaceMeshCellBase_3` adds four markers to mark the facets of the triangulation that belong to the two dimensional complex, and four markers that are helpers used in some operations to diff --git a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h index 2a402e9ab9d..2a93edf86af 100644 --- a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h +++ b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h @@ -26,9 +26,7 @@ #include - - -#include +#include #include #include @@ -36,7 +34,7 @@ namespace CGAL { - template < class GT, class Cb = Triangulation_cell_base_3 > + template < class GT, class Cb = Delaunay_triangulation_cell_base_3 > class Complex_2_in_triangulation_cell_base_3 : public Cb { public: diff --git a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_vertex_base_3.h b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_vertex_base_3.h index 3c60d20750c..2d14aa4483e 100644 --- a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_vertex_base_3.h +++ b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_vertex_base_3.h @@ -105,4 +105,4 @@ namespace CGAL { } // namespace CGAL -#endif // CGAL_COMPLEX_2_IN_TRIANGULATION_CELL_BASE_3_H +#endif // CGAL_COMPLEX_2_IN_TRIANGULATION_VERTEX_BASE_3_H diff --git a/Surface_mesher/include/CGAL/Surface_mesh_cell_base_3.h b/Surface_mesher/include/CGAL/Surface_mesh_cell_base_3.h index e197cf464a4..d26f5acaf98 100644 --- a/Surface_mesher/include/CGAL/Surface_mesh_cell_base_3.h +++ b/Surface_mesher/include/CGAL/Surface_mesh_cell_base_3.h @@ -23,8 +23,8 @@ #include - #include +#include #ifdef CGAL_MESH_3_IO_H #include @@ -36,7 +36,7 @@ namespace CGAL { - template < class GT, class Cb=Triangulation_cell_base_3 > + template < class GT, class Cb = Delaunay_triangulation_cell_base_3 > class Surface_mesh_cell_base_3 : public Complex_2_in_triangulation_cell_base_3 { diff --git a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h index d808f291cba..b8046fa77af 100644 --- a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h +++ b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h @@ -208,19 +208,6 @@ public: bool is_valid(bool = false, int = 0) const { return true; } - // This is here in the *ds*_cell_base to ease its use as default - // template parameter, so that the .dual() functions of Delaunay_3 - // still work. - template < typename Traits > - typename Traits::Point_3 - circumcenter(const Traits& gt) const - { - return gt.construct_circumcenter_3_object()(this->vertex(0)->point(), - this->vertex(1)->point(), - this->vertex(2)->point(), - this->vertex(3)->point()); - } - // For use by Compact_container. void * for_compact_container() const { return N[0].for_compact_container(); } void * & for_compact_container() { return N[0].for_compact_container(); } diff --git a/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp b/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp index fd291a5e60b..23f6b6f11a8 100644 --- a/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp +++ b/Triangulation_3/benchmark/Triangulation_3/Triangulation_benchmark_3.cpp @@ -95,7 +95,7 @@ typedef CGAL::Spatial_lock_grid_3 Lock_ds; // Delaunay T3 typedef CGAL::Triangulation_data_structure_3< CGAL::Triangulation_vertex_base_3, - CGAL::Triangulation_cell_base_3, + CGAL::Delaunay_triangulation_cell_base_3, CGAL::Parallel_tag > DT_Tds; typedef CGAL::Delaunay_triangulation_3< K, DT_Tds, CGAL::Default, Lock_ds> DT3; diff --git a/Triangulation_3/demo/Triangulation_3/typedefs.h b/Triangulation_3/demo/Triangulation_3/typedefs.h index b9eacbb64cf..9331908d5a4 100644 --- a/Triangulation_3/demo/Triangulation_3/typedefs.h +++ b/Triangulation_3/demo/Triangulation_3/typedefs.h @@ -89,14 +89,16 @@ private: typedef CGAL::Spatial_lock_grid_3< CGAL::Tag_priority_blocking> Lock_ds; typedef CGAL::Triangulation_data_structure_3< - Vertex_base, - CGAL::Triangulation_ds_cell_base_3<>, - CGAL::Parallel_tag > Tds; + Vertex_base, + CGAL::Delaunay_triangulation_cell_base_3, + CGAL::Parallel_tag > Tds; typedef CGAL::Delaunay_triangulation_3< Kernel, Tds, CGAL::Default, Lock_ds> DT3; #else -typedef CGAL::Triangulation_data_structure_3< Vertex_base > Tds; +typedef CGAL::Triangulation_data_structure_3< + Vertex_base, + CGAL::Delaunay_triangulation_cell_base_3 > Tds; typedef CGAL::Delaunay_triangulation_3< Kernel, Tds/*, CGAL::Fast_location*/> DT3; #endif diff --git a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp index 1219985d721..c718b0bb087 100644 --- a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp +++ b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp @@ -41,7 +41,8 @@ int main() typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; -typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; +typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; typedef Delaunay::Point Point; diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h index c5f1dedfe98..269d0157e52 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h @@ -18,12 +18,10 @@ circumcenter. \tparam Cb is a cell base class from which `Delaunay_triangulation_cell_base_with_circumcenter_3` derives. Cb should be a model of `DelaunayTriangulationCellBase_3`. -It has the default value `Triangulation_cell_base_3`. +It has the default value `Delaunay_triangulation_cell_base_3`. \cgalModels `DelaunayTriangulationCellBase_3` -\sa `CGAL::Triangulation_cell_base_3` -\sa `CGAL::Triangulation_cell_base_with_info_3` \sa `CGAL::Delaunay_triangulation_cell_base_3` */ diff --git a/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt b/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt index 481610b3806..0214759f1ac 100644 --- a/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt +++ b/Triangulation_3/doc/Triangulation_3/Triangulation_3.txt @@ -563,7 +563,7 @@ We will use the following types of triangulations, using
  • Delaunay - %Fast location : `Delaunay_triangulation_3` with `Fast_location`
  • Regular : `Regular_triangulation_3` (default setting : memorize hidden points)
  • Regular - No hidden points : `Regular_triangulation_3` with hidden points discarded (using -`Triangulation_cell_base_3` instead of `Regular_triangulation_cell_base_3`). +the template parameter `CGAL::Discard_hidden_points` for the cell base class). \cgalFigureRef{Triangulation3figbenchmarks} shows, for all these types of diff --git a/Triangulation_3/examples/Triangulation_3/adding_handles_3.cpp b/Triangulation_3/examples/Triangulation_3/adding_handles_3.cpp index 91592697d08..51e2700e4cb 100644 --- a/Triangulation_3/examples/Triangulation_3/adding_handles_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/adding_handles_3.cpp @@ -1,5 +1,7 @@ #include + #include +#include #include template < class GT, class Vb = CGAL::Triangulation_vertex_base_3 > @@ -32,11 +34,12 @@ public: typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Triangulation_data_structure_3 > Tds; -typedef CGAL::Delaunay_triangulation_3 Delaunay; +typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; +typedef CGAL::Triangulation_data_structure_3, Cb> Tds; +typedef CGAL::Delaunay_triangulation_3 Delaunay; -typedef Delaunay::Vertex_handle Vertex_handle; -typedef Delaunay::Point Point; +typedef Delaunay::Vertex_handle Vertex_handle; +typedef Delaunay::Point Point; int main() { diff --git a/Triangulation_3/examples/Triangulation_3/color.cpp b/Triangulation_3/examples/Triangulation_3/color.cpp index 7bb190843b5..c1e769c8875 100644 --- a/Triangulation_3/examples/Triangulation_3/color.cpp +++ b/Triangulation_3/examples/Triangulation_3/color.cpp @@ -1,15 +1,19 @@ #include + #include +#include #include + #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; -typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; +typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; -typedef Delaunay::Point Point; +typedef Delaunay::Point Point; int main() { diff --git a/Triangulation_3/examples/Triangulation_3/fast_location_3.cpp b/Triangulation_3/examples/Triangulation_3/fast_location_3.cpp index b6a86304ba5..169f0ef6e03 100644 --- a/Triangulation_3/examples/Triangulation_3/fast_location_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/fast_location_3.cpp @@ -5,9 +5,9 @@ #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Delaunay_triangulation_3 Delaunay; -typedef Delaunay::Point Point; +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Delaunay_triangulation_3 Delaunay; +typedef Delaunay::Point Point; int main() { diff --git a/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp b/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp index e72cfefa1d4..f132ea91ccd 100644 --- a/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp +++ b/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp @@ -1,11 +1,14 @@ #include + #include +#include #include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; -typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; +typedef CGAL::Triangulation_data_structure_3 Tds; //Use the Fast_location tag. Default or Compact_location works too. typedef CGAL::Delaunay_triangulation_3 Delaunay; typedef Delaunay::Point Point; diff --git a/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp b/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp index 9b84be9b8af..907f50bebba 100644 --- a/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp +++ b/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp @@ -1,12 +1,16 @@ #include + #include +#include #include #include + #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; -typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; +typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; typedef Delaunay::Point Point; diff --git a/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp b/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp index 44c4b51baf4..22b3c564e20 100644 --- a/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp +++ b/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp @@ -1,12 +1,18 @@ #include + #include +#include #include + #include + +#include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; -typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; +typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; typedef Delaunay::Point Point; diff --git a/Triangulation_3/examples/Triangulation_3/parallel_insertion_in_delaunay_3.cpp b/Triangulation_3/examples/Triangulation_3/parallel_insertion_in_delaunay_3.cpp index 0ae7f893285..bd4a660786a 100644 --- a/Triangulation_3/examples/Triangulation_3/parallel_insertion_in_delaunay_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/parallel_insertion_in_delaunay_3.cpp @@ -1,6 +1,9 @@ #include + #include +#include #include +#include #include #include @@ -13,13 +16,13 @@ int main() // Delaunay T3 typedef CGAL::Triangulation_data_structure_3< - CGAL::Triangulation_vertex_base_3, - CGAL::Triangulation_cell_base_3, - CGAL::Parallel_tag> Tds; - typedef CGAL::Delaunay_triangulation_3 Triangulation; + CGAL::Triangulation_vertex_base_3, + CGAL::Delaunay_triangulation_cell_base_3, + CGAL::Parallel_tag> Tds; + typedef CGAL::Delaunay_triangulation_3 Triangulation; + + typedef Triangulation::Point Point; - typedef Triangulation::Point Point; - const int NUM_INSERTED_POINTS = 5000; CGAL::Random_points_in_cube_3 rnd(1.); diff --git a/Triangulation_3/examples/Triangulation_3/regular_with_info_3.cpp b/Triangulation_3/examples/Triangulation_3/regular_with_info_3.cpp index f5ae6ef7750..9099b740e1e 100644 --- a/Triangulation_3/examples/Triangulation_3/regular_with_info_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/regular_with_info_3.cpp @@ -1,6 +1,10 @@ #include + #include +#include +#include #include + #include #include diff --git a/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp b/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp index 0215718630c..993692647d7 100644 --- a/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp +++ b/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp @@ -1,7 +1,10 @@ #include + #include +#include #include #include +#include #include #include @@ -34,10 +37,10 @@ int main() // Parallel Delaunay T3 #ifdef CGAL_LINKED_WITH_TBB - typedef CGAL::Triangulation_data_structure_3< - CGAL::Triangulation_vertex_base_3, - CGAL::Triangulation_cell_base_3, - CGAL::Parallel_tag> ParallelTds; + typedef CGAL::Triangulation_data_structure_3< + CGAL::Triangulation_vertex_base_3, + CGAL::Delaunay_triangulation_cell_base_3, + CGAL::Parallel_tag> ParallelTds; typedef CGAL::Delaunay_triangulation_3 ParallelTriangulation; t.reset(); diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 9394041ba89..d0c64337728 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -28,20 +28,18 @@ #include #include - #include +#include +#include + +#include +#include + #ifdef CGAL_CONCURRENT_TRIANGULATION_3_PROFILING # define CGAL_PROFILE # include #endif - -#include -#include - -#include -#include -#include #ifdef CGAL_TRIANGULATION_3_PROFILING # include #endif @@ -70,6 +68,9 @@ #include #endif +#include +#include + namespace CGAL { // Here is the declaration of a class template with three arguments, one @@ -83,19 +84,28 @@ class Delaunay_triangulation_3; // There is a specialization Delaunay_triangulation_3 // defined in . -// Here is the specialization Delaunay_triangulation_3, with two +// Here is the specialization Delaunay_triangulation_3, with three // arguments, that is if Location_policy being the default value 'Default'. -template < class Gt, class Tds_, - class Lock_data_structure_ > +template < class Gt, class Tds_, class Lock_data_structure_ > class Delaunay_triangulation_3 - : public Triangulation_3 + : public Triangulation_3, + Delaunay_triangulation_cell_base_3 > >::type, + Lock_data_structure_> { + typedef typename Default::Get, + Delaunay_triangulation_cell_base_3 > >::type Tds; + typedef Delaunay_triangulation_3 Self; public: - typedef Triangulation_3 Tr_Base; + typedef Triangulation_3 Tr_Base; - typedef typename Tr_Base::Triangulation_data_structure Triangulation_data_structure; + typedef Tds Triangulation_data_structure; typedef Gt Geom_traits; typedef Compact_location Location_policy; diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h index b6bcb3785d0..8d5646126b5 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h @@ -30,33 +30,54 @@ #include #include #include -#include #include #include namespace CGAL { -template < typename GT, typename Cb = Triangulation_ds_cell_base_3<> > +template < typename GT, + typename Cb = Triangulation_cell_base_3 > class Delaunay_triangulation_cell_base_3 - : public Triangulation_cell_base_3 + : public Cb { public: - typedef GT Geom_traits; - typedef typename Geom_traits::Point_3 Point; + typedef typename Cb::Vertex_handle Vertex_handle; + typedef typename Cb::Cell_handle Cell_handle; + + typedef GT Geom_traits; + typedef typename Geom_traits::Point_3 Point_3; + typedef typename Geom_traits::Point_3 Point; + + template < typename TDS2 > + struct Rebind_TDS { + typedef typename Cb::template Rebind_TDS::Other Cb2; + typedef Delaunay_triangulation_cell_base_3 Other; + }; + + Delaunay_triangulation_cell_base_3() + : Cb() {} + + Delaunay_triangulation_cell_base_3(Vertex_handle v0, Vertex_handle v1, + Vertex_handle v2, Vertex_handle v3) + : Cb(v0, v1, v2, v3) {} + + Delaunay_triangulation_cell_base_3(Vertex_handle v0, Vertex_handle v1, + Vertex_handle v2, Vertex_handle v3, + Cell_handle n0, Cell_handle n1, + Cell_handle n2, Cell_handle n3) + : Cb(v0, v1, v2, v3, n0, n1, n2, n3) {} template - Point circumcenter(const GT_& gt) const + Point_3 circumcenter(const GT_& gt) const { - CGAL_static_assertion((boost::is_same::value)); - return gt.construct_circumcenter_3_object()(this->vertex(0)->point(), - this->vertex(1)->point(), - this->vertex(2)->point(), - this->vertex(3)->point()); + return gt.construct_circumcenter_3_object()(this->vertex(0)->point(), + this->vertex(1)->point(), + this->vertex(2)->point(), + this->vertex(3)->point()); } - Point circumcenter() const + Point_3 circumcenter() const { return circumcenter(Geom_traits()); } diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h index 97068d2bd68..0ab0d2d2a65 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h @@ -31,11 +31,11 @@ #include #include -#include +#include namespace CGAL { -template < typename GT, typename Cb = Triangulation_cell_base_3 > +template < typename GT, typename Cb = Delaunay_triangulation_cell_base_3 > class Delaunay_triangulation_cell_base_with_circumcenter_3 : public Cb { diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h index a9a2f8f85cf..7a3b6571616 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h @@ -143,36 +143,13 @@ public: void unhide_point_internal(const Point_iterator, typename boost::disable_if_c::type* = NULL) { } - //note this function is not requested by the RegularTriangulationCellBase_3 - //it should be replaced everywhere by weighted_circumcenter() - // but remains here for backward compatibility - template - Point_3 circumcenter(const GT_& gt) const - { - CGAL_static_assertion((boost::is_same::value)); - return gt.construct_weighted_circumcenter_3_object() - (this->vertex(0)->point(), - this->vertex(1)->point(), - this->vertex(2)->point(), - this->vertex(3)->point()); - } - - Point_3 circumcenter() const - { - return circumcenter(Geom_traits()); - } - template Point_3 weighted_circumcenter(const GT_& gt) const { - CGAL_static_assertion((boost::is_same::value)); - return gt.construct_weighted_circumcenter_3_object() - (this->vertex(0)->point(), - this->vertex(1)->point(), - this->vertex(2)->point(), - this->vertex(3)->point()); + return gt.construct_weighted_circumcenter_3_object()(this->vertex(0)->point(), + this->vertex(1)->point(), + this->vertex(2)->point(), + this->vertex(3)->point()); } Point_3 weighted_circumcenter() const diff --git a/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h index 62f6dbecffb..50bb8cd8051 100644 --- a/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h @@ -67,41 +67,8 @@ public: Cell_handle n2, Cell_handle n3) : Cb(v0, v1, v2, v3, n0, n1, n2, n3) {} - // note the circumcenter() function is not part of the concept TriangulationCellBase_3 - // it is requested only by DelaunayTriangulartionCellBase_3 - // we keep it here for backward compatibility - typename Geom_traits::Point_3 - circumcenter(const Geom_traits& gt = Geom_traits()) const - { - return gt.construct_circumcenter_3_object()(this->vertex(0)->point(), - this->vertex(1)->point(), - this->vertex(2)->point(), - this->vertex(3)->point()); - } - }; -// The following should be useless. -#if 0 -template < class GT, class Cb > -inline -std::istream& -operator>>(std::istream &is, Triangulation_cell_base_3 &c) - // non combinatorial information. Default = nothing -{ - return is >> static_cast(c); -} - -template < class GT, class Cb > -inline -std::ostream& -operator<<(std::ostream &os, const Triangulation_cell_base_3 &c) - // non combinatorial information. Default = nothing -{ - return os << static_cast(c); -} -#endif - } //namespace CGAL #endif // CGAL_TRIANGULATION_CELL_BASE_3_H diff --git a/Triangulation_3/include/CGAL/internal/Delaunay_triangulation_hierarchy_3.h b/Triangulation_3/include/CGAL/internal/Delaunay_triangulation_hierarchy_3.h index 95d4378d562..75d03ec6c6e 100644 --- a/Triangulation_3/include/CGAL/internal/Delaunay_triangulation_hierarchy_3.h +++ b/Triangulation_3/include/CGAL/internal/Delaunay_triangulation_hierarchy_3.h @@ -37,8 +37,8 @@ namespace CGAL { #define CGAL_TDS_3 \ typename Default::Get,\ - Triangulation_cell_base_3 > >::type + Triangulation_vertex_base_3,\ + Delaunay_triangulation_cell_base_3 > >::type template < class Gt, class Tds_ > class Delaunay_triangulation_3 @@ -83,12 +83,14 @@ public: template < class Gt > class Delaunay_triangulation_3 : public Triangulation_hierarchy_3 >, - Triangulation_cell_base_3 > > > + Triangulation_data_structure_3< + Triangulation_hierarchy_vertex_base_3 >, + Delaunay_triangulation_cell_base_3 > > > { typedef Triangulation_hierarchy_3 >, - Triangulation_cell_base_3 > > > Base; + Triangulation_data_structure_3< + Triangulation_hierarchy_vertex_base_3 >, + Delaunay_triangulation_cell_base_3 > > > Base; public: diff --git a/Triangulation_3/test/Triangulation_3/test_RT_cell_base_with_weighted_circumcenter_3.cpp b/Triangulation_3/test/Triangulation_3/test_RT_cell_base_with_weighted_circumcenter_3.cpp index d882239fdb5..439b475dc86 100644 --- a/Triangulation_3/test/Triangulation_3/test_RT_cell_base_with_weighted_circumcenter_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_RT_cell_base_with_weighted_circumcenter_3.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -32,20 +31,20 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Regular_triangulation_vertex_base_3 Vb; -typedef CGAL::Triangulation_cell_base_3 Cb; -typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Regular_triangulation_vertex_base_3 Vb; +typedef CGAL::Regular_triangulation_cell_base_with_weighted_circumcenter_3 Cb; +typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Regular_triangulation_3 Regular_triangulation_3; typedef CGAL::Regular_triangulation_cell_base_with_weighted_circumcenter_3::Rebind_TDS::Other Cell_type; -typedef Cell_type::Vertex_handle Vertex_handle; -typedef Cell_type::Cell_handle Cell_handle; +typedef Regular_triangulation_3::Vertex_handle Vertex_handle; +typedef Regular_triangulation_3::Cell_handle Cell_handle; -typedef Regular_triangulation_3::Bare_point Bare_point; -typedef Regular_triangulation_3::Point Point; -typedef Regular_triangulation_3::Weighted_point Weighted_point; +typedef Regular_triangulation_3::Bare_point Bare_point; +typedef Regular_triangulation_3::Point Point; +typedef Regular_triangulation_3::Weighted_point Weighted_point; // Explicit instantiation of the whole class. template class @@ -53,7 +52,7 @@ CGAL::Regular_triangulation_cell_base_with_weighted_circumcenter_3< K, CGAL::Regular_triangulation_cell_base_3< K, CGAL::Triangulation_cell_base_3< K, CGAL::Triangulation_ds_cell_base_3 >, - CGAL::Keep_hidden_points, std::vector > >; + CGAL::Keep_hidden_points, std::vector > >; void test_default_constructor () { diff --git a/Triangulation_3/test/Triangulation_3/test_delaunay_3.cpp b/Triangulation_3/test/Triangulation_3/test_delaunay_3.cpp index e93bfa4a0f2..098e3172905 100644 --- a/Triangulation_3/test/Triangulation_3/test_delaunay_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_delaunay_3.cpp @@ -57,9 +57,9 @@ int main() #ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Spatial_lock_grid_3< CGAL::Tag_priority_blocking> Lock_ds; - typedef CGAL::Triangulation_data_structure_3< - CGAL::Triangulation_vertex_base_3, - CGAL::Triangulation_cell_base_3, + typedef CGAL::Triangulation_data_structure_3< + CGAL::Triangulation_vertex_base_3, + CGAL::Delaunay_triangulation_cell_base_3, CGAL::Parallel_tag > Tds_parallel; typedef CGAL::Delaunay_triangulation_3< EPIC, Tds_parallel, CGAL::Default, Lock_ds> Cls_parallel; diff --git a/Triangulation_3/test/Triangulation_3/test_delaunay_hierarchy_3_old.cpp b/Triangulation_3/test/Triangulation_3/test_delaunay_hierarchy_3_old.cpp index 8f688d91158..c5bcb2d5fa1 100644 --- a/Triangulation_3/test/Triangulation_3/test_delaunay_hierarchy_3_old.cpp +++ b/Triangulation_3/test/Triangulation_3/test_delaunay_hierarchy_3_old.cpp @@ -33,7 +33,8 @@ int main() { typedef CGAL::Triangulation_vertex_base_3 Vbb; typedef CGAL::Triangulation_hierarchy_vertex_base_3 Vb; - typedef CGAL::Triangulation_data_structure_3 Tds; + typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; + typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Dt; typedef CGAL::Triangulation_hierarchy_3
    Dh;