diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h index 6bd7df03707..aa31d95dd89 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -74,7 +74,8 @@ locate(const Arrangement_on_surface_2& arr, // Surface sweep types typedef Arr_batched_point_location_traits_2 Bgt2; typedef Ss2::No_overlap_event Bpl_event; - typedef Ss2::No_overlap_subcurve Bpl_curve; + typedef Ss2::No_overlap_subcurve + Bpl_curve; typedef typename Tt::template Batched_point_location_helper Bpl_helper; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h index a1f3c7182cd..e8fa7abe589 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h @@ -43,10 +43,13 @@ namespace CGAL { /*! Compute the overlay of two input arrangements. - * \param arr1 The first arrangement. - * \param arr2 The second arrangement. - * \param arr Output: The resulting arrangement. - * \param ovl_tr An overlay-traits class. As arr1, arr2 and res can be + * \tparam GeometryTraitsA_2 the geometry traits of the first arrangement. + * \tparam GeometryTraitsB_2 the geometry traits of the second arrangement. + * \tparam GeometryTraitsRes_2 the geometry traits of the resulting arrangement. + * \tparam TopologyTraitsA the topology traits of the first arrangement. + * \tparam TopologyTraitsB the topology traits of the second arrangement. + * \tparam TopologyTraitsRes the topology traits of the resulting arrangement. + * \tparam OverlayTraits An overlay-traits class. As arr1, arr2 and res can be * templated with different geometry-traits class and * different DCELs (encapsulated in the various topology-traits * classes). The geometry-traits of the result arrangement is diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h index 53cb6a9f008..4aff3cee3ff 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertical_decomposition_2.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -69,7 +69,8 @@ decompose(const Arrangement_on_surface_2& arr, // Surface sweep types: typedef Arr_batched_point_location_traits_2 Vgt2; typedef Ss2::No_overlap_event Vd_event; - typedef Ss2::No_overlap_subcurve Vd_curve; + typedef Ss2::No_overlap_subcurve + Vd_curve; typedef typename Tt::template Vertical_decomposition_helper Vd_helper; typedef Arr_vert_decomp_sl_visitor diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_event.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_event.h index 3fa0115a324..bd2ea6c9f85 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_event.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_event.h @@ -42,10 +42,13 @@ namespace Ss2 = Surface_sweep_2; * 2D arrangement. * * \tparam GeometryTraits_2 the geometry traits. + * \tparam Arrangement_ the type of the costructed arrangement. * \tparam Allocator_ a type of an element that is used to acquire/release * memory for elements of the event queue and the status * structure, and to construct/destroy the elements in that * memory. The type must meet the requirements of Allocator. + * \tparam SurfaceSweepBaseEvent the base class of the event. + * \tparam SurfaceSweepBaseCurve the base class of the subcurve. * * We exploit the curiously recurring template pattern (CRTP) idiom to establish * an interdependency between the curve and the event types, which are template @@ -64,7 +67,7 @@ template class SurfaceSweepBaseEvent = Ss2::Default_event_base, - template + template class SurfaceSweepBaseCurve = Ss2::Default_subcurve> class Arr_construction_event : public Arr_construction_event_base< diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_subcurve.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_subcurve.h index cc270bf9ebe..4c9838d94d2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_subcurve.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_construction_subcurve.h @@ -31,12 +31,12 @@ * instance types of Subcurve and Event must be available when the * surface-sweep template is instantiated. * - * Arr_construction_subcurve derives from an instance of the - * Surface_sweep_subcurve class template. The user is allowed to introduce new - * types that derive from an instance of the Arr_construction_subcurve class - * template. However, some of the fields of this template depends on the - * Subcurve type. We use the curiously recurring template pattern (CRTP) idiom - * to force the correct matching of these types. + * Arr_construction_subcurve derives from an instance of the Default_subcurve + * class template. The user is allowed to introduce new types that derive from + * an instance of the Arr_construction_subcurve class template. However, some of + * the fields of this template depends on the Subcurve type. We use the + * curiously recurring template pattern (CRTP) idiom to force the correct + * matching of these types. */ #include @@ -51,28 +51,35 @@ namespace Ss2 = Surface_sweep_2; * This is the base class of the Arr_construction_subcurve class template used * by the (CRTP) idiom. * \tparam GeometryTraits_2 the geometry traits. - * \tparam - * Subcurve_ the subcurve actual type. + * \tparam Event_ the event type. + * \tparam Allocator_ a type of an element that is used to acquire/release + * memory for elements of the event queue and the status + * structure, and to construct/destroy the elements in that + * memory. The type must meet the requirements of Allocator. + * \tparam Subcurve_ the subcurve actual type. * * The information contained in this class last: * - ishe event that was handled on the curve. * - The index for a subcurve that may represent a hole * - Indices of all halfedge below the curve that may represent a hole. */ -template class SurfaceSweepBaseCurve, +template + class SurfaceSweepBaseCurve, typename Subcurve_> class Arr_construction_subcurve_base : - public SurfaceSweepBaseCurve + public SurfaceSweepBaseCurve { public: typedef GeometryTraits_2 Geometry_traits_2; typedef Subcurve_ Subcurve; typedef Event_ Event; + typedef Allocator_ Allocator; private: typedef Geometry_traits_2 Gt2; - typedef SurfaceSweepBaseCurve Base; + typedef SurfaceSweepBaseCurve + Base; public: typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2; @@ -164,12 +171,12 @@ public: */ template + template class SurfaceSweepBaseCurve = Ss2::Default_subcurve, typename Subcurve_ = Default> class Arr_construction_subcurve : public Arr_construction_subcurve_base< - GeometryTraits_2, Event_, + GeometryTraits_2, Event_, Allocator_, SurfaceSweepBaseCurve, typename Default::Get Self; typedef typename Default::Get::type Subcurve; - typedef Arr_construction_subcurve_base Base; + typedef Arr_construction_subcurve_base + Base; public: typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2; diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h index b99c6d289c9..ef320db57d9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h @@ -41,8 +41,7 @@ namespace Ss2 = Surface_sweep_2; * in the proper place in the resulting arrangement. * * \tparam GeometryTraits_2 the geometry traits. - * \tparam Arrangement_ the type of the arrangement that is the resulting - * arrangement the overlay process. + * \tparam Event_ the event type. * \tparam Allocator_ a type of an element that is used to acquire/release * memory for elements of the event queue and the status * structure, and to construct/destroy the elements in that diff --git a/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h b/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h index 39ebaf1fb0d..d67b8dcb029 100644 --- a/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h +++ b/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h index 86f1306af64..dff494f2199 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include namespace CGAL { diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event.h index a76d087c521..a65a9ed5e6a 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event.h @@ -62,7 +62,8 @@ class Default_event : public Default_event_base > > + Allocator_>, + Allocator_> > { public: /*! Construct default. */ diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event_base.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event_base.h index ca82b49bbe5..33ed37a164a 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event_base.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_event_base.h @@ -50,7 +50,7 @@ namespace Surface_sweep_2 { */ template class Default_event_base : - public No_overlap_event_base + public No_overlap_event_base { public: typedef GeometryTraits_2 Geometry_traits_2; diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h index bb7c17dd623..93a31cd61bb 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h @@ -53,15 +53,21 @@ namespace Surface_sweep_2 { * This is the base class of the Default_subcurve class template used by * the (CRTP) idiom. * \tparam GeometryTraits_2 the geometry traits. + * \tparam Event_ the event type. + * \tparam Allocator_ a type of an element that is used to acquire/release + * memory for elements of the event queue and the status + * structure, and to construct/destroy the elements in that + * memory. The type must meet the requirements of Allocator. * \tparam Subcurve_ the subcurve actual type. * * The information contained in this class is: * - two pointers to subcurves that are the originating subcurves in case of * an overlap, otherwise thay are both NULL. */ -template +template class Default_subcurve_base : - public No_overlap_subcurve + public No_overlap_subcurve { public: typedef GeometryTraits_2 Geometry_traits_2; @@ -220,29 +226,40 @@ public: * X_monotone_curve_2. It contains data that is used when applying the sweep * algorithm on a set of x-monotone curves. This class derives from the * No_overlap_subcurve class template. + * * \tparam GeometryTraits_2 the geometry traits. + * \tparam Event_ the event type. + * \tparam Allocator_ a type of an element that is used to acquire/release + * memory for elements of the event queue and the status + * structure, and to construct/destroy the elements in that + * memory. The type must meet the requirements of Allocator. * \tparam Subcurve_ the type of the subcurve or Default. If the default is not * overriden it implies that the type is * No_overlap_subcurve */ template class Default_subcurve : - public Default_subcurve_base >::type> { public: typedef GeometryTraits_2 Geometry_traits_2; typedef Event_ Event; + typedef Allocator_ Allocator; private: typedef Geometry_traits_2 Gt2; - typedef Default_subcurve Self; + typedef Default_subcurve + Self; typedef typename Default::Get::type Subcurve; - typedef Default_subcurve_base Base; + typedef Default_subcurve_base + Base; public: typedef typename Gt2::X_monotone_curve_2 X_monotone_curve_2; @@ -266,8 +283,8 @@ public: }; #ifdef CGAL_SL_VERBOSE -template -void Default_subcurve::Print() const +template +void Default_subcurve::Print() const { std::cout << "Curve " << this << " (" << this->last_curve() << ") " diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor.h index ab3a968def0..9b50d932401 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor.h @@ -41,8 +41,9 @@ namespace Surface_sweep_2 { template , - typename Subcurve_ = Default_subcurve > + typename Event_ = Default_event, + typename Subcurve_ = Default_subcurve > class Default_visitor : public Default_visitor_base diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_event.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_event.h index a68ff08673d..793356867ad 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_event.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_event.h @@ -64,7 +64,8 @@ class No_overlap_event : No_overlap_subcurve > > + Allocator_>, + Allocator_> > { public: /*! Construct default. */ diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_subcurve.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_subcurve.h index 41556e2ec4c..3c2e0c89f98 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_subcurve.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_overlap_subcurve.h @@ -60,13 +60,14 @@ namespace Surface_sweep_2 { * curve. * - an iterator that points to the location of the subcurve in the status line. */ -template +template class No_overlap_subcurve_base { public: typedef GeometryTraits_2 Geometry_traits_2; typedef Subcurve_ Subcurve; typedef Event_ Event; - typedef CGAL_ALLOCATOR(int) Allocator; + typedef Allocator_ Allocator; private: typedef Geometry_traits_2 Gt2; @@ -123,28 +124,35 @@ public: * - the remaining x-monotone curve that is to the right of the current sweep * line. * \tparam GeometryTraits_2 the geometry traits. + * \tparam Event_ the event type. + * \tparam Allocator_ a type of an element that is used to acquire/release + * memory for elements of the event queue and the status + * structure, and to construct/destroy the elements in that + * memory. The type must meet the requirements of Allocator. * \tparam Subcurve_ the type of the subcurve or Default. If the default is not - * overriden it implies that the type is - * No_overlap_subcurve. + * overriden it implies that the type is No_overlap_subcurve. */ template class No_overlap_subcurve : public No_overlap_subcurve_base< - GeometryTraits_2, Event_, + GeometryTraits_2, Event_, Allocator_, typename Default::Get >::type> + Allocator_, Subcurve_> >::type> { public: typedef GeometryTraits_2 Geometry_traits_2; typedef Event_ Event; + typedef Allocator_ Allocator; private: typedef Geometry_traits_2 Gt2; - typedef No_overlap_subcurve Self; + typedef No_overlap_subcurve + Self; typedef typename Default::Get::type Subcurve; - typedef No_overlap_subcurve_base + typedef No_overlap_subcurve_base Base; public: @@ -191,11 +199,9 @@ public: }; #ifdef CGAL_SL_VERBOSE -template +template void No_overlap_subcurve::Print() const -{ - std::cout << "Curve " << this << " (" << last_curve() << ") "; -} +{ std::cout << "Curve " << this << " (" << last_curve() << ") "; } #endif } // namespace Surface_sweep_2