diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementTypes.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementTypes.h index 417ffbd3fd0..ec9e20b6c98 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementTypes.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementTypes.h @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt index 4299322e38c..33d5252ec89 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt @@ -390,7 +390,7 @@ the `Arrangement_2` class template; their description follows.
    -
  • The `Traits` template-parameter should be instantiated with a +
  • The `Traits` template-parameter should be substituted with a model of the `ArrangementBasicTraits_2` concept and optionally additional geometry traits concepts. A model of the `ArrangementBasicTraits_2` concept defines the types of @@ -415,14 +415,15 @@ the `Arrangement_2` class template; their description follows. rational functions. We exemplify the usage of these traits classes in Section \ref aos_sec-geom_traits. -
  • The `Dcel` template-parameter should be instantiated with a class +
  • The `Dcel` template-parameter should be substituted with a class that models the `ArrangementDcel` concept, which is used to represent the topological layout of the arrangement. This parameter is substituted with `Arr_default_dcel` by default, and we use this default value in this and in the following three - sections. However, in many applications it is necessary to - extend the \dcel features. This is done by substituting the - `Dcel` parameter with a different type; see Section \ref arr_ssecex_dcel + sections. However, in many applications it is necessary to extend the + \dcel features. This is done by substituting the `Dcel` parameter with + a different type (typically, a different instance of the + `Arr_dcel<>` class template); see Section \ref arr_ssecex_dcel for further explanations and examples.
@@ -5877,12 +5878,12 @@ applications. All examples presented so far use the default \dcel; namely, they employ the `Arr_default_dcel` instance. This is done -implicitly, as an instance of this class template serves as the -default parameter for the `Arrangement_2` class template; see Section -\ref aos_ssec-basic-arr_class. The default \dcel class associates -points with vertices and \f$x\f$-monotone curves with halfedges, but -nothing more. In this section we show how to use alternative -\dcel types to extend the desired \dcel records. +implicitly, as this instance of the `Arr_default_dcel` class template +serves as the default parameter for the `Arrangement_2` class +template; see Section \ref aos_ssec-basic-arr_class. The default \dcel +class associates points with vertices and \f$x\f$-monotone curves with +halfedges, but nothing more. In this section we show how to use +alternative \dcel types to extend the desired \dcel records. \subsubsection arr_sssecex_dcel_face Extending the DCEL Faces @@ -6111,17 +6112,17 @@ of arrangements derive from a common ancestor that models the geometry-traits concept.} Typically, all three arrangements use the same geometry-traits class. -The `overlay()` function template is suitable for -arrangements that do not store any additional data with their -\dcel records; namely, arrangements defined using an instance of -the default \dcel class-template `Arr_default_dcel`. Typically, -the overlay arrangement in this case does not store extra data with -its \dcel records as well (or if it does, the additional -data-fields cannot be computed by the overlay operation). The overlay -arrangement is equivalent to the arrangement induced by all curves of -`arr_r` and `arr_b`. Indeed, it is possible to obtain the same result -using the standard insertion-operations instead, but, as mentioned -above, this is less efficient. +The `overlay()` function template is suitable for arrangements that do +not store any additional data with their \dcel records; namely, +arrangements defined using the default \dcel, which is the instance +`Arr_default_dcel`. Typically, the overlay arrangement in this +case does not store extra data with its \dcel records as well. (If it +does, the additional data-fields cannot be computed by the overlay +operation in this case.) The overlay arrangement is equivalent to the +arrangement induced by all curves of `arr_r` and `arr_b`. Indeed, it +is possible to obtain the same result using the standard +insertion-operations instead, but, as mentioned above, this is less +efficient. \cgalFigureBegin{aos_figex_overlay,overlay.png} @@ -6663,15 +6664,15 @@ a file. \subsection arr_ssecarr_io_aux_data Arrangements with Auxiliary Data -\cgalAdvancedBegin -The inserter and extractor both ignore any auxiliary data stored with -the arrangement features. Thus, they are ideal for arrangements -instantiated using the `Arr_default_dcel` class. -However, as explained in Section \ref arr_ssecex_dcel, one can easily -extend the arrangement faces by using the `Arr_face_extended_dcel` -template, or extend all \dcel records by using the `Arr_extended_dcel` -template. In such cases, it might be crucial that the auxiliary data fields -are written to the file and read from there. +\cgalAdvancedBegin The inserter and extractor both ignore any +auxiliary data stored with the arrangement features. Thus, they are +ideal for arrangements instantiated using the default \dcel, which is +the instance `Arr_default_dcel`. However, as explained in +Section \ref arr_ssecex_dcel, one can easily extend the arrangement +faces by using the `Arr_face_extended_dcel` template, extend all \dcel +records by using the `Arr_extended_dcel` template, or use the +`Arr_dcel` template. In such cases, it might be crucial that the +auxiliary data fields are written to the file and read from there. The arrangement package includes the free functions `write(arr, os, formatter)`, which writes the arrangement `arr` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_bounded_planar_topology_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_bounded_planar_topology_traits_2.h index f839b4967ef..ea05170d37f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_bounded_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_bounded_planar_topology_traits_2.h @@ -9,13 +9,13 @@ namespace CGAL { * * The `Arr_bounded_planar_topology_traits_2` template has two parameters: *
    - *
  • The `GeometryTraits_2` template-parameter should be instantiated with + *
  • The `GeometryTraits_2` template-parameter should be substituted with * a model of the `ArrangementBasicTraits_2` concept. The traits * class defines the types of \f$x\f$-monotone curves and two-dimensional * points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and * `ArrangementBasicTraits_2::Point_2`, * respectively, and supports basic geometric predicates on them. - *
  • The `Dcel` template-parameter should be instantiated with + *
  • The `Dcel` template-parameter should be substituted with * a class that is a model of the `ArrangementDcel` concept. The * value of this parameter is by default * `Arr_default_dcel`. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h index afe365a3da4..c8b960c6324 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h @@ -57,17 +57,17 @@ namespace CGAL { * algebraic number of degree \f$d\f$ if there exist a polynomial \f$ p\f$ with * integer coefficient of degree \f$d\f$ such that \f$p(\alpha) = 0\f$). * We therefore require separate representations of the curve - * coefficients and the point coordinates. The `NtTraits` should be instantiated + * coefficients and the point coordinates. The `NtTraits` should be substituted * with a class that defines nested `Integer`, `Rational`, and `Algebraic` number * types and supports various operations on them, yielding certified computation * results (for example, it can convert rational numbers to algebraic numbers * and can compute roots of polynomials with integer coefficients). The other * template parameters, `RatKernel` and `AlgKernel` should be geometric kernels * instantiated with the `NtTraits::Rational` and `NtTraits::Algebraic` number - * types, respectively. It is recommended instantiating the - * `CORE_algebraic_number_traits` class as the `NtTraits` parameter, with - * `Cartesian` and `Cartesian` - * instantiating the two kernel types, respectively. The number types in this + * types, respectively. It is recommended substituting the + * `CORE_algebraic_number_traits` class for the `NtTraits` parameter, and + * the `Cartesian` and `Cartesian` + * instances for two kernel types, respectively. The number types in this * case are provided by the \core library, with its ability to exactly represent * simple algebraic numbers. * diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel.h new file mode 100644 index 00000000000..a86e1611695 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel.h @@ -0,0 +1,39 @@ +namespace CGAL { + +/*! \ingroup PkgArrangementOnSurface2DCEL + * + * The \dcel class used by the `Arrangement_2`, + * `Arr_bounded_planar_topology_traits_2`, `Arr_unb_planar_topology_traits_2` + * class templates and other templates. It is parameterized by a geometry + * traits type and optionaly by a vertex, halfedge, or face types. By default, + * the `Arr_dcel` class template uses the \link + * ArrangementBasicTraits_2::Point_2 `Point_2`\endlink and \link + * ArrangementBasicTraits_2::X_monotone_curve_2 `X_monotone_curve_2`\endlink + * types nested in the traits type to instantiate the vertex and base halfedge + * types, respectively. Thus, by default the \dcel only stores the topological + * incidence relations and the geometric data attached to vertices and + * edges. Any one of the vertex, halfedge, or face types can be + * overriden. Notice that if the vertex and halfedge types are overriden, the + * traits type is ignored. + * + * \cgalModels{ArrangementDcelWithRebind} + * + * \tparam Traits a geometry traits type, which is a model of the + * `ArrangementBasicTraits_2` concept. + * \tparam V the vertex type, which is a model of the `ArrangementDcelVertex` + * concept. + * \tparam H the halfedge type, which is a model of the + * `ArrangementDcelHalfedge` concept. + * \tparam F the face type, which is a model of the `ArrangementDcelFace` + * concept. + * + * \sa `Arr_dcel_base` + */ +template , + typename H = Arr_halfedge_base, + typename F = Arr_face_base> +class Arr_dcel : public Arr_dcel_base { +}; + +} /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h index 453a7f05092..b2dba1ca39e 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h @@ -1,26 +1,25 @@ - namespace CGAL { -/*! -\ingroup PkgArrangementOnSurface2DCEL +/*! \ingroup PkgArrangementOnSurface2DCEL + * + * The default \dcel class used by the `Arrangement_2`, + * `Arr_bounded_planar_topology_traits_2`, `Arr_unb_planar_topology_traits_2` + * class templates and other templates. It is parameterized by a geometry + * traits type. It uses the \link ArrangementBasicTraits_2::Point_2 + * `Point_2`\endlink and \link ArrangementBasicTraits_2::X_monotone_curve_2 + * `X_monotone_curve_2`\endlink types nested in the traits type to instantiate + * the vertex and base halfedge types, respectively. Thus, by default the \dcel + * only stores the topological incidence relations and the geometric data + * attached to vertices and edges. + * + * \cgalModels{ArrangementDcelWithRebind} + * + * \tparam Traits a geometry traits type, which is a model of the + * `ArrangementBasicTraits_2` concept. + * + * \sa `Arr_dcel` + * \sa `Arr_dcel_base` + */ +template using Arr_default_dcel = Arr_dcel; -The default \dcel class used by the `Arrangement_2` class-template -is parameterized by a traits class, which is a model of the -`ArrangementBasicTraits_2` concept. It simply uses the nested -`Traits::Point_2` and `Traits::X_monotone_curve_2` to instantiate -the base vertex and halfedge types, respectively. Thus, the default -\dcel records store no other information, except for the topological -incidence relations and the geometric data attached to vertices and edges. - -\cgalModels{ArrangementDcelWithRebind} - -\sa `Arr_dcel_base` -*/ -template< typename Traits > -class Arr_default_dcel : - public Arr_dcel_base< Arr_vertex_base, - Arr_halfedge_base, - Arr_face_base> -{ -}; /* end Arr_default_dcel */ } /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h index e85664bdb76..ab5cf747b7a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h @@ -16,7 +16,7 @@ that are not provided by the kernel. The kernel is parameterized with a number type, which should support the arithmetic operations \f$ +\f$, \f$ -\f$ and \f$ \times\f$ in an exact manner in order to avoid robustness problems. Using `Cartesian` or `Cartesian` are possible -instantiations for the kernel. Using other (inexact) number types +substitutions for the kernel. Using other (inexact) number types (for example, instantiating the template with `Simple_cartesian`) is also possible, at the user's own risk. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h index 9036308edaa..37a7a6c29bd 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h @@ -4,10 +4,10 @@ namespace CGAL { * * The traits class `Arr_segment_traits_2` is a model of the * `ArrangementTraits_2` concept, which allows the construction and maintenance - * of arrangements of line segments. It should be parameterized with a + * of arrangements of line segments. It is parameterized with a * \cgal-kernel model that is templated in turn with a number type. To avoid * numerical errors and robustness problems, the number type should support - * exact rational arithmetic - that is, the number type should support the + * exact rational arithmetic; that is, the number type should support the * arithmetic operations \f$ +\f$, \f$ -\f$, \f$ \times\f$ and \f$ \div\f$ * carried out without loss of precision. * diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_spherical_topology_traits_2.h index 5c1775e331f..680f51d0d49 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_spherical_topology_traits_2.h @@ -9,13 +9,13 @@ namespace CGAL { * * The `Arr_spherical_topology_traits_2` template has two parameters: *
      - *
    • The `GeometryTraits_2` template-parameter should be instantiated with + *
    • The `GeometryTraits_2` template-parameter should be substituted with * a model of the `ArrangementBasicTraits_2` concept. The traits * class defines the types of \f$x\f$-monotone curves and two-dimensional * points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and * `ArrangementBasicTraits_2::Point_2`, * respectively, and supports basic geometric predicates on them. - *
    • The `Dcel` template-parameter should be instantiated with + *
    • The `Dcel` template-parameter should be substituted with * a class that is a model of the `ArrangementDcel` concept. The * value of this parameter is by default * `Arr_default_dcel`. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_unb_planar_topology_traits_2.h index 06efe81c731..d8cc5bb046c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_unb_planar_topology_traits_2.h @@ -9,13 +9,13 @@ namespace CGAL { * * The `Arr_unb_planar_topology_traits_2` template has two parameters: *
        - *
      • The `GeometryTraits_2` template-parameter should be instantiated with + *
      • The `GeometryTraits_2` template-parameter should be substituted with * a model of the `ArrangementBasicTraits_2` concept. The traits * class defines the types of \f$x\f$-monotone curves and two-dimensional * points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and * `ArrangementBasicTraits_2::Point_2`, * respectively, and supports basic geometric predicates on them. - *
      • The `Dcel` template-parameter should be instantiated with + *
      • The `Dcel` template-parameter should be substituted with * a class that is a model of the `ArrangementDcel` concept. The * value of this parameter is by default * `Arr_default_dcel`. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h index 5886ce3f19d..8940d4d9377 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h @@ -16,14 +16,14 @@ namespace CGAL { * The `Arrangement_on_surface_2` template has two parameters: *
          - *
        • The `GeometryTraits` template-parameter should be instantiated with + *
        • The `GeometryTraits` template-parameter should be substituted with * a model of a geometry traits. The minimal requirements are defined by the * `ArrangementBasicTraits_2` concept. A model of this concept defines * the types of \f$ x\f$-monotone curves and two-dimensional points, namely * `ArrangementBasicTraits_2::X_monotone_curve_2` and * `ArrangementBasicTraits_2::Point_2`, respectively, and supports basic * geometric predicates on them. - *
        • The `TopologyTraits` template-parameter should be instantiated with a + *
        • The `TopologyTraits` template-parameter should be substituted with a * class that is a model of the `ArrangementTopologyTraits` concept. *
        * diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h index a01bb1b19cf..ba8847d2c60 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h @@ -25,16 +25,15 @@ namespace CGAL { * The `Arrangement_on_surface_with_history_2` template has two parameters: * *
          - *
        • The `GeometryTraits` template-parameter should be instantiated with a + *
        • The `GeometryTraits` template-parameter should be substituted with a * model of the `ArrangementTraits_2` concept. The traits class defines the * `Curve_2` type, which represents an input curve. It also defines the types * of \f$ x\f$-monotone curves and two-dimensional points, namely * `ArrangementTraits_2::X_monotone_curve_2` and * `ArrangementTraits_2::Point_2`, respectively, and supports basic * geometric predicates on them. - *
        • The `Dcel` template-parameter should be instantiated with a class that is - * a model of the `ArrangementDcelWithRebind` concept. The value of this - * parameter is by default `Arr_default_dcel`. + *
        • The `TopologyTraits` template-parameter should be substituted with a + * class that is a model of the `ArrangementTopologyTraits` concept. *
        * * \sa `Arrangement_with_history_2` diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h index 4c6e380b750..dbd72c15ea5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h @@ -23,13 +23,13 @@ namespace CGAL { * * The `Arrangement_with_history_2` template has two parameters: *
          - *
        • The `Traits` template-parameter should be instantiated with a model of + *
        • The `Traits` template-parameter should be substituted with a model of * the `ArrangementTraits_2` concept. The traits class defines the `Curve_2` * type, which represents an input curve. It also defines the types of \f$ * x\f$-monotone curves and two-dimensional points, namely * `ArrangementTraits_2::X_monotone_curve_2` and `ArrangementTraits_2::Point_2`, * respectively, and supports basic geometric predicates on them. - *
        • The `Dcel` template-parameter should be instantiated with a class that is + *
        • The `Dcel` template-parameter should be substituted with a class that is * a model of the `ArrangementDcelWithRebind` concept. The value of this * parameter is by default `Arr_default_dcel`. *
        diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h index f263a1aae0d..5d1c38474a6 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h @@ -12,6 +12,7 @@ Instantiate a dcel class with many different possible types without ad-hoc limit \cgalHasModelsBegin \cgalHasModels{CGAL::Arr_default_dcel} +\cgalHasModels{CGAL::Arr_dcel} \cgalHasModels{CGAL::Arr_face_extended_dcel} \cgalHasModels{CGAL::Arr_extended_dcel} \cgalHasModelsEnd @@ -48,4 +49,3 @@ Arr_dcel(); /// @} }; /* end ArrangementDcelWithRebind */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt index 20dc50a5795..f15213dcdeb 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt @@ -204,6 +204,7 @@ implemented as peripheral classes or as free (global) functions. - `CGAL::Arrangement_2::Halfedge` - `CGAL::Arrangement_2::Face` - `CGAL::Arr_dcel_base` +- `CGAL::Arr_dcel` - `CGAL::Arr_default_dcel` - `CGAL::Arr_face_extended_dcel` - `CGAL::Arr_extended_dcel` diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h index 4d0d46c8de1..105d379297d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h @@ -26,6 +26,7 @@ */ #include +#include #include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel.h new file mode 100644 index 00000000000..531bb32b245 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel.h @@ -0,0 +1,69 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Ron Wein +// Baruch Zukerman +// Efi Fogel + +#ifndef CGAL_ARR_DCEL_H +#define CGAL_ARR_DCEL_H + +#include + +#include + +/*! \file + * The definition of the Arr_dcel class. + */ + +#include + +namespace CGAL { + +/*! \class + * The arrangement DCEL class. + * The Traits parameters corresponds to a geometric traits class, which + * defines the Point_2 and X_monotone_curve_2 types. + */ +template , + typename H = Arr_halfedge_base, + typename F = Arr_face_base> +class Arr_dcel : public Arr_dcel_base { +public: + /*! \struct + * An auxiliary structure for rebinding the DCEL with a new traits class. + */ + template + struct rebind { + private: + using Pnt = typename T::Point_2; + using Xcv = typename T::X_monotone_curve_2; + using Rebind_v = typename V::template rebind; + using V_other = typename Rebind_v::other; + using Rebind_h = typename H::template rebind; + using H_other = typename Rebind_h::other; + + public: + using other = Arr_dcel; + }; + + /*! Default constructor. */ + Arr_dcel() {} + + /*! Destructor. */ + virtual ~Arr_dcel() {} +}; + +} //namespace CGAL + +#include + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h index af2ea182fa7..b0627f38eae 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h @@ -8,8 +8,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Ron Wein -// (based on old version by: Iddo Hanniel and Oren Nechushtan) +// Author(s): Ron Wein +// Efi Fogel +// (based on old version by: Iddo Hanniel and Oren Nechushtan) #ifndef CGAL_ARR_DCEL_BASE_H #define CGAL_ARR_DCEL_BASE_H @@ -23,11 +24,12 @@ * peripheral records. */ -#include -#include #include #include -#include + +#include +#include +#include #include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h index ca98dc7ec5f..feb23717d41 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_default_dcel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// Copyright (c) 2023 Tel-Aviv University (Israel). // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -8,8 +8,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Ron Wein -// Baruch Zukerman +// Author(s): Efi Fogel #ifndef CGAL_ARR_DEFAULT_DCEL_H #define CGAL_ARR_DEFAULT_DCEL_H @@ -19,46 +18,19 @@ #include /*! \file - * The definition of the Arr_default_dcel class. + * The definition of the Arr_default_dcel type. */ -#include +#include namespace CGAL { -/*! \class - * The default arrangement DCEL class. +/*! The default arrangement DCEL type. * The Traits parameters corresponds to a geometric traits class, which * defines the Point_2 and X_monotone_curve_2 types. */ -template -class Arr_default_dcel : - public Arr_dcel_base, - Arr_halfedge_base, - Arr_face_base> -{ -public: - - /*! \struct - * An auxiliary structure for rebinding the DCEL with a new traits class. - */ - template - struct rebind - { - typedef Arr_default_dcel other; - }; - - /*! Default constructor. */ - Arr_default_dcel() - {} - - /*! Destructor. */ - virtual ~Arr_default_dcel() - {} -}; +template using Arr_default_dcel = Arr_dcel; } //namespace CGAL -#include - #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h index f70b4dcb1fb..56efabb2a44 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_default_overlay_traits.h @@ -8,8 +8,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Ron Wein -// Baruch Zukerman +// Author(s): Ron Wein +// Baruch Zukerman +// Efi Fogel #ifndef CGAL_ARR_DEFAULT_OVERLAY_TRAITS_H #define CGAL_ARR_DEFAULT_OVERLAY_TRAITS_H @@ -23,7 +24,6 @@ * Definition of default overlay-traits classes. */ -#include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h index dc863fe57e8..fd958718c69 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h @@ -8,8 +8,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Ron Wein -// Efi Fogel +// Author(s): Ron Wein +// Efi Fogel #ifndef CGAL_ARR_EXTENDED_DCEL_H #define CGAL_ARR_EXTENDED_DCEL_H @@ -26,142 +26,115 @@ namespace CGAL { -/*! - * \class +/*! \class * An extended DCEL vertex with auxiliary data field. */ -template -class Arr_extended_vertex : public VertexBase_ -{ - typedef Arr_extended_vertex Self; - typedef VertexBase_ Base; +template +class Arr_extended_vertex : public VertexBase { + using Vertex_base = VertexBase; + using Vertex_data = VertexData; + + using Self = Arr_extended_vertex; public: - typedef VertexData_ Data; + typedef Vertex_data Data; private: - - Data m_data; // The auxiliary data field. + Data m_data; // The auxiliary data field. public: - /*! Get the auxiliary data (const version). */ - const Data& data () const - { - return (m_data); - } + const Data& data() const { return m_data; } /*! Get the auxiliary data (non-const version). */ - Data& data () - { - return (m_data); - } + Data& data() { return m_data; } /*! Set the auxiliary data. */ - void set_data (const Data& data) - { - m_data = data; - } + void set_data(const Data& data) { m_data = data; } /*! Assign from another vertex. */ - virtual void assign (const Base& v) - { - Base::assign (v); - - const Self& ex_v = static_cast(v); + virtual void assign(const Vertex_base& v) { + Vertex_base::assign(v); + const Self& ex_v = static_cast(v); m_data = ex_v.m_data; } + + template + struct rebind { + using Point_2 = Point_; + using other = typename Vertex_base::template rebind; + }; }; -/*! - * \class +/*! \class * An extended DCEL halfedge with auxiliary data field. */ -template -class Arr_extended_halfedge : public HalfedgeBase_ -{ - typedef Arr_extended_halfedge Self; - typedef HalfedgeBase_ Base; +template +class Arr_extended_halfedge : public HalfedgeBase { + using Halfedge_base = HalfedgeBase; + using Halfedge_data = HalfedgeData; + + using Self = Arr_extended_halfedge; public: - typedef HalfedgeData_ Data; + typedef Halfedge_data Data; private: - - Data m_data; // The auxiliary data field. + Data m_data; // The auxiliary data field. public: - /*! Get the auxiliary data (const version). */ - const Data& data () const - { - return (m_data); - } + const Data& data() const { return m_data; } /*! Get the auxiliary data (non-const version). */ - Data& data () - { - return (m_data); - } + Data& data() { return m_data; } /*! Set the auxiliary data. */ - void set_data (const Data& data) - { - m_data = data; - } + void set_data(const Data& data) { m_data = data; } - /*! Assign from another vertex. */ - virtual void assign (const Base& he) - { - Base::assign (he); - - const Self& ex_he = static_cast(he); + /*! Assign from another halfedge. */ + virtual void assign(const Halfedge_base& he) { + Halfedge_base::assign(he); + const Self& ex_he = static_cast(he); m_data = ex_he.m_data; } + + template + struct rebind { + using X_monotonote_curve_2 = XMonotoneCurve; + using other = typename Halfedge_base::template rebind; + }; }; -/*! - * \class +/*! \class * An extended DCEL face with auxiliary data field. */ -template -class Arr_extended_face : public FaceBase_ -{ - typedef Arr_extended_face Self; - typedef FaceBase_ Base; +template +class Arr_extended_face : public FaceBase { + using Face_base = FaceBase; + using Face_data = FaceData; + + using Self = Arr_extended_face; public: - typedef FaceData_ Data; + typedef Face_data Data; private: - - Data m_data; // The auxiliary data field. + Data m_data; // The auxiliary data field. public: - /*! Get the auxiliary data (const version). */ - const Data& data () const - { - return (m_data); - } + const Data& data() const { return m_data; } /*! Get the auxiliary data (non-const version). */ - Data& data () - { - return (m_data); - } + Data& data() { return m_data; } /*! Set the auxiliary data. */ - void set_data (const Data& data) - { - m_data = data; - } - - /*! Assign from another vertex. */ - virtual void assign (const Base& f) - { - Base::assign (f); + void set_data(const Data& data) { m_data = data; } + /*! Assign from another face. */ + virtual void assign(const Face_base& f) { + Face_base::assign(f); const Self& ex_f = static_cast(f); m_data = ex_f.m_data; } @@ -173,49 +146,41 @@ public: * defines the Point_2 and X_monotone_curve_2 types. * The FaceData parameter specifies the object type stored with each face. */ -template , - class HalfedgeBase_ = - Arr_halfedge_base, - class FaceBase_ = Arr_face_base> +template , + typename HalfedgeBase = + Arr_halfedge_base, + typename FaceBase = Arr_face_base> class Arr_face_extended_dcel : - public Arr_dcel_base > -{ + public Arr_dcel_base> { public: - - typedef FaceData_ Face_data; + using Face_base = FaceBase; + using Face_data = FaceData; /*! \struct * An auxiliary structure for rebinding the DCEL with a new traits class. */ - template - class rebind - { - typedef typename VertexBase_::template rebind - Rebind_vertex; - typedef typename Rebind_vertex::other Vertex_base; - typedef typename HalfedgeBase_::template rebind - Rebind_halfedge; - typedef typename Rebind_halfedge::other Halfedge_base; + template + class rebind { + private: + using Pnt = typename T::Point_2; + using Xcv = typename T::X_monotone_curve_2; + using Rebind_vertex = typename VertexBase::template rebind; + using Vertex_other = typename Rebind_vertex::other; + using Rebind_halfedge = typename HalfedgeBase::template rebind; + using Halfedge_other = typename Rebind_halfedge::other; public: - - typedef Arr_face_extended_dcel other; + using other = Arr_face_extended_dcel; }; /*! Default constructor. */ - Arr_face_extended_dcel () - {} + Arr_face_extended_dcel() {} /*! Destructor. */ - virtual ~Arr_face_extended_dcel () - {} + virtual ~Arr_face_extended_dcel() {} }; /*! \class @@ -225,54 +190,48 @@ public: * The VertexData, HalfedgeData and FaceData parameter specify the object types * stored with each vertex, halfedge and face, respectively. */ -template , - class HalfedgeBase_ = - Arr_halfedge_base, - class FaceBase_ = Arr_face_base> +template , + typename HalfedgeBase = + Arr_halfedge_base, + typename FaceBase = Arr_face_base> class Arr_extended_dcel : - public Arr_dcel_base, - Arr_extended_halfedge, - Arr_extended_face > -{ + public Arr_dcel_base, + Arr_extended_halfedge, + Arr_extended_face> { public: - - typedef VertexData_ Vertex_data; - typedef HalfedgeData_ Halfedge_data; - typedef FaceData_ Face_data; + using Vertex_data = VertexData; + using Halfedge_data = HalfedgeData; + using Face_data = FaceData; + using Vertex_base = VertexBase; + using Halfedge_base = HalfedgeBase; + using Face_base = FaceBase; /*! \struct * An auxiliary structure for rebinding the DCEL with a new traits class. */ - template - class rebind - { - typedef typename VertexBase_::template rebind - Rebind_vertex; - typedef typename Rebind_vertex::other Vertex_base; - typedef typename HalfedgeBase_::template rebind - Rebind_halfedge; - typedef typename Rebind_halfedge::other Halfedge_base; + template + struct rebind { + private: + using Pnt = typename T::Point_2; + using Xcv = typename T::X_monotone_curve_2; + using Rebind_vertex = typename VertexBase::template rebind; + using Vertex_other = typename Rebind_vertex::other; + using Rebind_halfedge = typename HalfedgeBase::template rebind; + using Halfedge_other = typename Rebind_halfedge::other; public: - - typedef Arr_extended_dcel other; + using other = Arr_extended_dcel; }; /*! Default constructor. */ - Arr_extended_dcel () - {} + Arr_extended_dcel() {} /*! Destructor. */ - virtual ~Arr_extended_dcel () - {} + virtual ~Arr_extended_dcel() {} }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h index 58558968882..664aa1a4864 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h index 5ff66d78b30..0b0e1769f80 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace CGAL { diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index ae87c8ddb28..8df2b6cde58 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -39,11 +39,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h index 134c2f0c20e..7e421c6ce54 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h @@ -9,6 +9,7 @@ // // // Author(s): Ron Wein +// Efi Fogel #ifndef CGAL_ARRANGEMENT_WITH_HISTORY_2_H #define CGAL_ARRANGEMENT_WITH_HISTORY_2_H @@ -23,6 +24,7 @@ #include #include +#include namespace CGAL {