Introduced Arr_dcel and fixed Arr_default_dcel

This commit is contained in:
Efi Fogel 2023-11-15 18:51:07 +02:00
parent a850c34460
commit 826f60c4be
25 changed files with 317 additions and 272 deletions

View File

@ -15,7 +15,6 @@
#include <CGAL/Arrangement_with_history_2.h> #include <CGAL/Arrangement_with_history_2.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Arr_default_dcel.h>
#include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arr_linear_traits_2.h> #include <CGAL/Arr_linear_traits_2.h>
#include <CGAL/Arr_polyline_traits_2.h> #include <CGAL/Arr_polyline_traits_2.h>

View File

@ -390,7 +390,7 @@ the `Arrangement_2` class template; their description follows.
<UL> <UL>
<LI>The `Traits` template-parameter should be instantiated with a <LI>The `Traits` template-parameter should be substituted with a
model of the `ArrangementBasicTraits_2` concept and optionally model of the `ArrangementBasicTraits_2` concept and optionally
additional geometry traits concepts. A model of the additional geometry traits concepts. A model of the
`ArrangementBasicTraits_2` concept defines the types of `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 rational functions. We exemplify the usage of these traits classes
in Section \ref aos_sec-geom_traits. in Section \ref aos_sec-geom_traits.
<LI>The `Dcel` template-parameter should be instantiated with a class <LI>The `Dcel` template-parameter should be substituted with a class
that models the `ArrangementDcel` concept, which is used to represent that models the `ArrangementDcel` concept, which is used to represent
the topological layout of the arrangement. This parameter is the topological layout of the arrangement. This parameter is
substituted with `Arr_default_dcel<Traits>` by default, and substituted with `Arr_default_dcel<Traits>` by default, and
we use this default value in this and in the following three we use this default value in this and in the following three
sections. However, in many applications it is necessary to sections. However, in many applications it is necessary to extend the
extend the \dcel features. This is done by substituting the \dcel features. This is done by substituting the `Dcel` parameter with
`Dcel` parameter with a different type; see Section \ref arr_ssecex_dcel a different type (typically, a different instance of the
`Arr_dcel<>` class template); see Section \ref arr_ssecex_dcel
for further explanations and examples. for further explanations and examples.
</UL> </UL>
@ -5877,12 +5878,12 @@ applications.
All examples presented so far use the default \dcel; namely, they All examples presented so far use the default \dcel; namely, they
employ the `Arr_default_dcel<Traits>` instance. This is done employ the `Arr_default_dcel<Traits>` instance. This is done
implicitly, as an instance of this class template serves as the implicitly, as this instance of the `Arr_default_dcel` class template
default parameter for the `Arrangement_2` class template; see Section serves as the default parameter for the `Arrangement_2` class
\ref aos_ssec-basic-arr_class. The default \dcel class associates template; see Section \ref aos_ssec-basic-arr_class. The default \dcel
points with vertices and \f$x\f$-monotone curves with halfedges, but class associates points with vertices and \f$x\f$-monotone curves with
nothing more. In this section we show how to use alternative halfedges, but nothing more. In this section we show how to use
\dcel types to extend the desired \dcel records. alternative \dcel types to extend the desired \dcel records.
<!-- ------------------------------------------------------------------------- --> <!-- ------------------------------------------------------------------------- -->
\subsubsection arr_sssecex_dcel_face Extending the DCEL Faces \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 geometry-traits concept.} Typically, all three arrangements use the
same geometry-traits class. same geometry-traits class.
The `overlay()` function template is suitable for The `overlay()` function template is suitable for arrangements that do
arrangements that do not store any additional data with their not store any additional data with their \dcel records; namely,
\dcel records; namely, arrangements defined using an instance of arrangements defined using the default \dcel, which is the instance
the default \dcel class-template `Arr_default_dcel`. Typically, `Arr_default_dcel<Traits>`. Typically, the overlay arrangement in this
the overlay arrangement in this case does not store extra data with case does not store extra data with its \dcel records as well. (If it
its \dcel records as well (or if it does, the additional does, the additional data-fields cannot be computed by the overlay
data-fields cannot be computed by the overlay operation). The overlay operation in this case.) The overlay arrangement is equivalent to the
arrangement is equivalent to the arrangement induced by all curves of arrangement induced by all curves of `arr_r` and `arr_b`. Indeed, it
`arr_r` and `arr_b`. Indeed, it is possible to obtain the same result is possible to obtain the same result using the standard
using the standard insertion-operations instead, but, as mentioned insertion-operations instead, but, as mentioned above, this is less
above, this is less efficient. efficient.
<!-- ------------------------------------------------------------------------- --> <!-- ------------------------------------------------------------------------- -->
\cgalFigureBegin{aos_figex_overlay,overlay.png} \cgalFigureBegin{aos_figex_overlay,overlay.png}
@ -6663,15 +6664,15 @@ a file.
\subsection arr_ssecarr_io_aux_data Arrangements with Auxiliary Data \subsection arr_ssecarr_io_aux_data Arrangements with Auxiliary Data
<!-- ------------------------------------------------------------------------- --> <!-- ------------------------------------------------------------------------- -->
\cgalAdvancedBegin \cgalAdvancedBegin The inserter and extractor both ignore any
The inserter and extractor both ignore any auxiliary data stored with auxiliary data stored with the arrangement features. Thus, they are
the arrangement features. Thus, they are ideal for arrangements ideal for arrangements instantiated using the default \dcel, which is
instantiated using the `Arr_default_dcel` class. the instance `Arr_default_dcel<Traits>`. However, as explained in
However, as explained in Section \ref arr_ssecex_dcel, one can easily Section \ref arr_ssecex_dcel, one can easily extend the arrangement
extend the arrangement faces by using the `Arr_face_extended_dcel` faces by using the `Arr_face_extended_dcel` template, extend all \dcel
template, or extend all \dcel records by using the `Arr_extended_dcel` records by using the `Arr_extended_dcel` template, or use the
template. In such cases, it might be crucial that the auxiliary data fields `Arr_dcel` template. In such cases, it might be crucial that the
are written to the file and read from there. auxiliary data fields are written to the file and read from there.
The arrangement package includes the free functions The arrangement package includes the free functions
`write(arr, os, formatter)`, which writes the arrangement `arr` `write(arr, os, formatter)`, which writes the arrangement `arr`

View File

@ -9,13 +9,13 @@ namespace CGAL {
* *
* The `Arr_bounded_planar_topology_traits_2` template has two parameters: * The `Arr_bounded_planar_topology_traits_2` template has two parameters:
* <UL> * <UL>
* <LI>The `GeometryTraits_2` template-parameter should be instantiated with * <LI>The `GeometryTraits_2` template-parameter should be substituted with
* a model of the `ArrangementBasicTraits_2` concept. The traits * a model of the `ArrangementBasicTraits_2` concept. The traits
* class defines the types of \f$x\f$-monotone curves and two-dimensional * class defines the types of \f$x\f$-monotone curves and two-dimensional
* points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and * points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and
* `ArrangementBasicTraits_2::Point_2`, * `ArrangementBasicTraits_2::Point_2`,
* respectively, and supports basic geometric predicates on them. * respectively, and supports basic geometric predicates on them.
* <LI>The `Dcel` template-parameter should be instantiated with * <LI>The `Dcel` template-parameter should be substituted with
* a class that is a model of the `ArrangementDcel` concept. The * a class that is a model of the `ArrangementDcel` concept. The
* value of this parameter is by default * value of this parameter is by default
* `Arr_default_dcel<Traits>`. * `Arr_default_dcel<Traits>`.

View File

@ -57,17 +57,17 @@ namespace CGAL {
* algebraic number of degree \f$d\f$ if there exist a polynomial \f$ p\f$ with * algebraic number of degree \f$d\f$ if there exist a polynomial \f$ p\f$ with
* <I>integer</I> coefficient of degree \f$d\f$ such that \f$p(\alpha) = 0\f$). * <I>integer</I> coefficient of degree \f$d\f$ such that \f$p(\alpha) = 0\f$).
* We therefore require separate representations of the curve * 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 * with a class that defines nested `Integer`, `Rational`, and `Algebraic` number
* types and supports various operations on them, yielding certified computation * types and supports various operations on them, yielding certified computation
* results (for example, it can convert rational numbers to algebraic numbers * results (for example, it can convert rational numbers to algebraic numbers
* and can compute roots of polynomials with integer coefficients). The other * and can compute roots of polynomials with integer coefficients). The other
* template parameters, `RatKernel` and `AlgKernel` should be geometric kernels * template parameters, `RatKernel` and `AlgKernel` should be geometric kernels
* instantiated with the `NtTraits::Rational` and `NtTraits::Algebraic` number * instantiated with the `NtTraits::Rational` and `NtTraits::Algebraic` number
* types, respectively. It is recommended instantiating the * types, respectively. It is recommended substituting the
* `CORE_algebraic_number_traits` class as the `NtTraits` parameter, with * `CORE_algebraic_number_traits` class for the `NtTraits` parameter, and
* `Cartesian<NtTraits::Rational>` and `Cartesian<NtTraits::Algebraic>` * the `Cartesian<NtTraits::Rational>` and `Cartesian<NtTraits::Algebraic>`
* instantiating the two kernel types, respectively. The number types in this * instances for two kernel types, respectively. The number types in this
* case are provided by the \core library, with its ability to exactly represent * case are provided by the \core library, with its ability to exactly represent
* simple algebraic numbers. * simple algebraic numbers.
* *

View File

@ -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<V, H, F>`
*/
template <typename Traits,
typename V = Arr_vertex_base<typename Traits::Point_2>,
typename H = Arr_halfedge_base<typename Traits::X_monotone_curve_2>,
typename F = Arr_face_base>
class Arr_dcel : public Arr_dcel_base<V, H, F> {
};
} /* end namespace CGAL */

View File

@ -1,26 +1,25 @@
namespace CGAL { namespace CGAL {
/*! /*! \ingroup PkgArrangementOnSurface2DCEL
\ingroup PkgArrangementOnSurface2DCEL *
* The default \dcel class used by the `Arrangement_2`,
The default \dcel class used by the `Arrangement_2` class-template * `Arr_bounded_planar_topology_traits_2`, `Arr_unb_planar_topology_traits_2`
is parameterized by a traits class, which is a model of the * class templates and other templates. It is parameterized by a geometry
`ArrangementBasicTraits_2` concept. It simply uses the nested * traits type. It uses the \link ArrangementBasicTraits_2::Point_2
`Traits::Point_2` and `Traits::X_monotone_curve_2` to instantiate * `Point_2`\endlink and \link ArrangementBasicTraits_2::X_monotone_curve_2
the base vertex and halfedge types, respectively. Thus, the default * `X_monotone_curve_2`\endlink types nested in the traits type to instantiate
\dcel records store no other information, except for the topological * the vertex and base halfedge types, respectively. Thus, by default the \dcel
incidence relations and the geometric data attached to vertices and edges. * only stores the topological incidence relations and the geometric data
* attached to vertices and edges.
\cgalModels{ArrangementDcelWithRebind} *
* \cgalModels{ArrangementDcelWithRebind}
\sa `Arr_dcel_base<V,H,F>` *
* \tparam Traits a geometry traits type, which is a model of the
* `ArrangementBasicTraits_2` concept.
*
* \sa `Arr_dcel<Traits, V, H, F>`
* \sa `Arr_dcel_base<V, H, F>`
*/ */
template< typename Traits > template <typename Traits> using Arr_default_dcel = Arr_dcel<Traits>;
class Arr_default_dcel :
public Arr_dcel_base< Arr_vertex_base<typename Traits_::Point_2>,
Arr_halfedge_base<typename Traits_::X_monotone_curve_2>,
Arr_face_base>
{
}; /* end Arr_default_dcel */
} /* end namespace CGAL */ } /* end namespace CGAL */

View File

@ -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 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. \f$ \times\f$ in an exact manner in order to avoid robustness problems.
Using `Cartesian<MP_Float>` or `Cartesian<Gmpz>` are possible Using `Cartesian<MP_Float>` or `Cartesian<Gmpz>` 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 (for example, instantiating the template with
`Simple_cartesian<double>`) is also possible, at the user's own `Simple_cartesian<double>`) is also possible, at the user's own
risk. risk.

View File

@ -4,10 +4,10 @@ namespace CGAL {
* *
* The traits class `Arr_segment_traits_2` is a model of the * The traits class `Arr_segment_traits_2` is a model of the
* `ArrangementTraits_2` concept, which allows the construction and maintenance * `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 * \cgal-kernel model that is templated in turn with a number type. To avoid
* numerical errors and robustness problems, the number type should support * 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$ * arithmetic operations \f$ +\f$, \f$ -\f$, \f$ \times\f$ and \f$ \div\f$
* carried out without loss of precision. * carried out without loss of precision.
* *

View File

@ -9,13 +9,13 @@ namespace CGAL {
* *
* The `Arr_spherical_topology_traits_2` template has two parameters: * The `Arr_spherical_topology_traits_2` template has two parameters:
* <UL> * <UL>
* <LI>The `GeometryTraits_2` template-parameter should be instantiated with * <LI>The `GeometryTraits_2` template-parameter should be substituted with
* a model of the `ArrangementBasicTraits_2` concept. The traits * a model of the `ArrangementBasicTraits_2` concept. The traits
* class defines the types of \f$x\f$-monotone curves and two-dimensional * class defines the types of \f$x\f$-monotone curves and two-dimensional
* points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and * points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and
* `ArrangementBasicTraits_2::Point_2`, * `ArrangementBasicTraits_2::Point_2`,
* respectively, and supports basic geometric predicates on them. * respectively, and supports basic geometric predicates on them.
* <LI>The `Dcel` template-parameter should be instantiated with * <LI>The `Dcel` template-parameter should be substituted with
* a class that is a model of the `ArrangementDcel` concept. The * a class that is a model of the `ArrangementDcel` concept. The
* value of this parameter is by default * value of this parameter is by default
* `Arr_default_dcel<Traits>`. * `Arr_default_dcel<Traits>`.

View File

@ -9,13 +9,13 @@ namespace CGAL {
* *
* The `Arr_unb_planar_topology_traits_2` template has two parameters: * The `Arr_unb_planar_topology_traits_2` template has two parameters:
* <UL> * <UL>
* <LI>The `GeometryTraits_2` template-parameter should be instantiated with * <LI>The `GeometryTraits_2` template-parameter should be substituted with
* a model of the `ArrangementBasicTraits_2` concept. The traits * a model of the `ArrangementBasicTraits_2` concept. The traits
* class defines the types of \f$x\f$-monotone curves and two-dimensional * class defines the types of \f$x\f$-monotone curves and two-dimensional
* points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and * points, namely `ArrangementBasicTraits_2::X_monotone_curve_2` and
* `ArrangementBasicTraits_2::Point_2`, * `ArrangementBasicTraits_2::Point_2`,
* respectively, and supports basic geometric predicates on them. * respectively, and supports basic geometric predicates on them.
* <LI>The `Dcel` template-parameter should be instantiated with * <LI>The `Dcel` template-parameter should be substituted with
* a class that is a model of the `ArrangementDcel` concept. The * a class that is a model of the `ArrangementDcel` concept. The
* value of this parameter is by default * value of this parameter is by default
* `Arr_default_dcel<Traits>`. * `Arr_default_dcel<Traits>`.

View File

@ -16,14 +16,14 @@ namespace CGAL {
* The `Arrangement_on_surface_2` template has two parameters: * The `Arrangement_on_surface_2` template has two parameters:
* <UL> * <UL>
* <LI>The `GeometryTraits` template-parameter should be instantiated with * <LI>The `GeometryTraits` template-parameter should be substituted with
* a model of a geometry traits. The minimal requirements are defined by the * a model of a geometry traits. The minimal requirements are defined by the
* `ArrangementBasicTraits_2` concept. A model of this concept defines * `ArrangementBasicTraits_2` concept. A model of this concept defines
* the types of \f$ x\f$-monotone curves and two-dimensional points, namely * the types of \f$ x\f$-monotone curves and two-dimensional points, namely
* `ArrangementBasicTraits_2::X_monotone_curve_2` and * `ArrangementBasicTraits_2::X_monotone_curve_2` and
* `ArrangementBasicTraits_2::Point_2`, respectively, and supports basic * `ArrangementBasicTraits_2::Point_2`, respectively, and supports basic
* geometric predicates on them. * geometric predicates on them.
* <LI>The `TopologyTraits` template-parameter should be instantiated with a * <LI>The `TopologyTraits` template-parameter should be substituted with a
* class that is a model of the `ArrangementTopologyTraits` concept. * class that is a model of the `ArrangementTopologyTraits` concept.
* </UL> * </UL>
* *

View File

@ -25,16 +25,15 @@ namespace CGAL {
* The `Arrangement_on_surface_with_history_2` template has two parameters: * The `Arrangement_on_surface_with_history_2` template has two parameters:
* *
* <UL> * <UL>
* <LI>The `GeometryTraits` template-parameter should be instantiated with a * <LI>The `GeometryTraits` template-parameter should be substituted with a
* model of the `ArrangementTraits_2` concept. The traits class defines the * model of the `ArrangementTraits_2` concept. The traits class defines the
* `Curve_2` type, which represents an input curve. It also defines the types * `Curve_2` type, which represents an input curve. It also defines the types
* of \f$ x\f$-monotone curves and two-dimensional points, namely * of \f$ x\f$-monotone curves and two-dimensional points, namely
* `ArrangementTraits_2::X_monotone_curve_2` and * `ArrangementTraits_2::X_monotone_curve_2` and
* `ArrangementTraits_2::Point_2`, respectively, and supports basic * `ArrangementTraits_2::Point_2`, respectively, and supports basic
* geometric predicates on them. * geometric predicates on them.
* <LI>The `Dcel` template-parameter should be instantiated with a class that is * <LI>The `TopologyTraits` template-parameter should be substituted with a
* a model of the `ArrangementDcelWithRebind` concept. The value of this * class that is a model of the `ArrangementTopologyTraits` concept.
* parameter is by default `Arr_default_dcel<Traits>`.
* </UL> * </UL>
* *
* \sa `Arrangement_with_history_2<GeometryTraits,Dcel>` * \sa `Arrangement_with_history_2<GeometryTraits,Dcel>`

View File

@ -23,13 +23,13 @@ namespace CGAL {
* *
* The `Arrangement_with_history_2` template has two parameters: * The `Arrangement_with_history_2` template has two parameters:
* <UL> * <UL>
* <LI>The `Traits` template-parameter should be instantiated with a model of * <LI>The `Traits` template-parameter should be substituted with a model of
* the `ArrangementTraits_2` concept. The traits class defines the `Curve_2` * the `ArrangementTraits_2` concept. The traits class defines the `Curve_2`
* type, which represents an input curve. It also defines the types of \f$ * type, which represents an input curve. It also defines the types of \f$
* x\f$-monotone curves and two-dimensional points, namely * x\f$-monotone curves and two-dimensional points, namely
* `ArrangementTraits_2::X_monotone_curve_2` and `ArrangementTraits_2::Point_2`, * `ArrangementTraits_2::X_monotone_curve_2` and `ArrangementTraits_2::Point_2`,
* respectively, and supports basic geometric predicates on them. * respectively, and supports basic geometric predicates on them.
* <LI>The `Dcel` template-parameter should be instantiated with a class that is * <LI>The `Dcel` template-parameter should be substituted with a class that is
* a model of the `ArrangementDcelWithRebind` concept. The value of this * a model of the `ArrangementDcelWithRebind` concept. The value of this
* parameter is by default `Arr_default_dcel<Traits>`. * parameter is by default `Arr_default_dcel<Traits>`.
* </UL> * </UL>

View File

@ -12,6 +12,7 @@ Instantiate a dcel class with many different possible types without ad-hoc limit
\cgalHasModelsBegin \cgalHasModelsBegin
\cgalHasModels{CGAL::Arr_default_dcel<Traits>} \cgalHasModels{CGAL::Arr_default_dcel<Traits>}
\cgalHasModels{CGAL::Arr_dcel<Traits,V,H,F>}
\cgalHasModels{CGAL::Arr_face_extended_dcel<Traits,FData,V,H,F>} \cgalHasModels{CGAL::Arr_face_extended_dcel<Traits,FData,V,H,F>}
\cgalHasModels{CGAL::Arr_extended_dcel<Traits,VData,HData,FData,V,H,F>} \cgalHasModels{CGAL::Arr_extended_dcel<Traits,VData,HData,FData,V,H,F>}
\cgalHasModelsEnd \cgalHasModelsEnd
@ -48,4 +49,3 @@ Arr_dcel();
/// @} /// @}
}; /* end ArrangementDcelWithRebind */ }; /* end ArrangementDcelWithRebind */

View File

@ -204,6 +204,7 @@ implemented as peripheral classes or as free (global) functions.
- `CGAL::Arrangement_2::Halfedge` - `CGAL::Arrangement_2::Halfedge`
- `CGAL::Arrangement_2::Face` - `CGAL::Arrangement_2::Face`
- `CGAL::Arr_dcel_base<V,H,F>` - `CGAL::Arr_dcel_base<V,H,F>`
- `CGAL::Arr_dcel<Traits,V,H,F>`
- `CGAL::Arr_default_dcel<Traits>` - `CGAL::Arr_default_dcel<Traits>`
- `CGAL::Arr_face_extended_dcel<Traits,FData,V,H,F>` - `CGAL::Arr_face_extended_dcel<Traits,FData,V,H,F>`
- `CGAL::Arr_extended_dcel<Traits,VData,HData,FData,V,H,F>` - `CGAL::Arr_extended_dcel<Traits,VData,HData,FData,V,H,F>`

View File

@ -26,6 +26,7 @@
*/ */
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
#include <CGAL/Arr_default_dcel.h>
#include <CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h> #include <CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h>
#include <CGAL/Arr_topology_traits/Arr_bounded_planar_construction_helper.h> #include <CGAL/Arr_topology_traits/Arr_bounded_planar_construction_helper.h>
#include <CGAL/Arr_topology_traits/Arr_bounded_planar_insertion_helper.h> #include <CGAL/Arr_topology_traits/Arr_bounded_planar_insertion_helper.h>

View File

@ -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 <wein@post.tau.ac.il>
// Baruch Zukerman <baruchzu@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_ARR_DCEL_H
#define CGAL_ARR_DCEL_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/disable_warnings.h>
/*! \file
* The definition of the Arr_dcel<Traits> class.
*/
#include <CGAL/Arr_dcel_base.h>
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 Traits,
typename V = Arr_vertex_base<typename Traits::Point_2>,
typename H = Arr_halfedge_base<typename Traits::X_monotone_curve_2>,
typename F = Arr_face_base>
class Arr_dcel : public Arr_dcel_base<V, H, F> {
public:
/*! \struct
* An auxiliary structure for rebinding the DCEL with a new traits class.
*/
template <typename T>
struct rebind {
private:
using Pnt = typename T::Point_2;
using Xcv = typename T::X_monotone_curve_2;
using Rebind_v = typename V::template rebind<Pnt>;
using V_other = typename Rebind_v::other;
using Rebind_h = typename H::template rebind<Xcv>;
using H_other = typename Rebind_h::other;
public:
using other = Arr_dcel<T, V_other, H_other, F>;
};
/*! Default constructor. */
Arr_dcel() {}
/*! Destructor. */
virtual ~Arr_dcel() {}
};
} //namespace CGAL
#include <CGAL/enable_warnings.h>
#endif

View File

@ -9,6 +9,7 @@
// //
// //
// Author(s): Ron Wein <wein@post.tau.ac.il> // Author(s): Ron Wein <wein@post.tau.ac.il>
// Efi Fogel <efif@post.tau.ac.il>
// (based on old version by: Iddo Hanniel and Oren Nechushtan) // (based on old version by: Iddo Hanniel and Oren Nechushtan)
#ifndef CGAL_ARR_DCEL_BASE_H #ifndef CGAL_ARR_DCEL_BASE_H
@ -23,11 +24,12 @@
* peripheral records. * peripheral records.
*/ */
#include <CGAL/basic.h>
#include <CGAL/Arr_enums.h>
#include <list> #include <list>
#include <map> #include <map>
#include <CGAL/N_step_adaptor_derived.h>
#include <CGAL/basic.h>
#include <CGAL/Arr_enums.h>
#include <CGAL/iterator.h>
#include <CGAL/In_place_list.h> #include <CGAL/In_place_list.h>
#include <CGAL/function_objects.h> #include <CGAL/function_objects.h>
#include <CGAL/Iterator_project.h> #include <CGAL/Iterator_project.h>

View File

@ -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. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org). // This file is part of CGAL (www.cgal.org).
@ -8,8 +8,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Ron Wein <wein@post.tau.ac.il> // Author(s): Efi Fogel <efifogel@gmail.com>
// Baruch Zukerman <baruchzu@post.tau.ac.il>
#ifndef CGAL_ARR_DEFAULT_DCEL_H #ifndef CGAL_ARR_DEFAULT_DCEL_H
#define CGAL_ARR_DEFAULT_DCEL_H #define CGAL_ARR_DEFAULT_DCEL_H
@ -19,46 +18,19 @@
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
/*! \file /*! \file
* The definition of the Arr_default_dcel<Traits> class. * The definition of the Arr_default_dcel<Traits> type.
*/ */
#include <CGAL/Arr_dcel_base.h> #include <CGAL/Arr_dcel.h>
namespace CGAL { namespace CGAL {
/*! \class /*! The default arrangement DCEL type.
* The default arrangement DCEL class.
* The Traits parameters corresponds to a geometric traits class, which * The Traits parameters corresponds to a geometric traits class, which
* defines the Point_2 and X_monotone_curve_2 types. * defines the Point_2 and X_monotone_curve_2 types.
*/ */
template <class Traits_> template <typename Traits> using Arr_default_dcel = Arr_dcel<Traits>;
class Arr_default_dcel :
public Arr_dcel_base<Arr_vertex_base<typename Traits_::Point_2>,
Arr_halfedge_base<typename Traits_::X_monotone_curve_2>,
Arr_face_base>
{
public:
/*! \struct
* An auxiliary structure for rebinding the DCEL with a new traits class.
*/
template<typename T>
struct rebind
{
typedef Arr_default_dcel<T> other;
};
/*! Default constructor. */
Arr_default_dcel()
{}
/*! Destructor. */
virtual ~Arr_default_dcel()
{}
};
} //namespace CGAL } //namespace CGAL
#include <CGAL/enable_warnings.h>
#endif #endif

View File

@ -10,6 +10,7 @@
// //
// Author(s): Ron Wein <wein@post.tau.ac.il> // Author(s): Ron Wein <wein@post.tau.ac.il>
// Baruch Zukerman <baruchzu@post.tau.ac.il> // Baruch Zukerman <baruchzu@post.tau.ac.il>
// Efi Fogel <efif@post.tau.ac.il>
#ifndef CGAL_ARR_DEFAULT_OVERLAY_TRAITS_H #ifndef CGAL_ARR_DEFAULT_OVERLAY_TRAITS_H
#define CGAL_ARR_DEFAULT_OVERLAY_TRAITS_H #define CGAL_ARR_DEFAULT_OVERLAY_TRAITS_H
@ -23,7 +24,6 @@
* Definition of default overlay-traits classes. * Definition of default overlay-traits classes.
*/ */
#include <CGAL/Arr_default_dcel.h>
#include <CGAL/Arr_extended_dcel.h> #include <CGAL/Arr_extended_dcel.h>
#include <CGAL/Surface_sweep_2/Arr_default_overlay_traits_base.h> #include <CGAL/Surface_sweep_2/Arr_default_overlay_traits_base.h>

View File

@ -26,142 +26,115 @@
namespace CGAL { namespace CGAL {
/*! /*! \class
* \class
* An extended DCEL vertex with auxiliary data field. * An extended DCEL vertex with auxiliary data field.
*/ */
template <class VertexBase_, typename VertexData_> template <typename VertexBase, typename VertexData>
class Arr_extended_vertex : public VertexBase_ class Arr_extended_vertex : public VertexBase {
{ using Vertex_base = VertexBase;
typedef Arr_extended_vertex<VertexBase_, VertexData_> Self; using Vertex_data = VertexData;
typedef VertexBase_ Base;
using Self = Arr_extended_vertex<Vertex_base, Vertex_data>;
public: public:
typedef VertexData_ Data; typedef Vertex_data Data;
private: private:
Data m_data; // The auxiliary data field. Data m_data; // The auxiliary data field.
public: public:
/*! Get the auxiliary data (const version). */ /*! Get the auxiliary data (const version). */
const Data& data () const const Data& data() const { return m_data; }
{
return (m_data);
}
/*! Get the auxiliary data (non-const version). */ /*! Get the auxiliary data (non-const version). */
Data& data () Data& data() { return m_data; }
{
return (m_data);
}
/*! Set the auxiliary data. */ /*! Set the auxiliary data. */
void set_data (const Data& data) void set_data(const Data& data) { m_data = data; }
{
m_data = data;
}
/*! Assign from another vertex. */ /*! Assign from another vertex. */
virtual void assign (const Base& v) virtual void assign(const Vertex_base& v) {
{ Vertex_base::assign(v);
Base::assign (v);
const Self& ex_v = static_cast<const Self&>(v); const Self& ex_v = static_cast<const Self&>(v);
m_data = ex_v.m_data; m_data = ex_v.m_data;
} }
template <typename Point_>
struct rebind {
using Point_2 = Point_;
using other = typename Vertex_base::template rebind<Point_2>;
};
}; };
/*! /*! \class
* \class
* An extended DCEL halfedge with auxiliary data field. * An extended DCEL halfedge with auxiliary data field.
*/ */
template <class HalfedgeBase_, typename HalfedgeData_> template <typename HalfedgeBase, typename HalfedgeData>
class Arr_extended_halfedge : public HalfedgeBase_ class Arr_extended_halfedge : public HalfedgeBase {
{ using Halfedge_base = HalfedgeBase;
typedef Arr_extended_halfedge<HalfedgeBase_, HalfedgeData_> Self; using Halfedge_data = HalfedgeData;
typedef HalfedgeBase_ Base;
using Self = Arr_extended_halfedge<Halfedge_base, Halfedge_data>;
public: public:
typedef HalfedgeData_ Data; typedef Halfedge_data Data;
private: private:
Data m_data; // The auxiliary data field. Data m_data; // The auxiliary data field.
public: public:
/*! Get the auxiliary data (const version). */ /*! Get the auxiliary data (const version). */
const Data& data () const const Data& data() const { return m_data; }
{
return (m_data);
}
/*! Get the auxiliary data (non-const version). */ /*! Get the auxiliary data (non-const version). */
Data& data () Data& data() { return m_data; }
{
return (m_data);
}
/*! Set the auxiliary data. */ /*! Set the auxiliary data. */
void set_data (const Data& data) void set_data(const Data& data) { m_data = data; }
{
m_data = data;
}
/*! Assign from another vertex. */
virtual void assign (const Base& he)
{
Base::assign (he);
/*! Assign from another halfedge. */
virtual void assign(const Halfedge_base& he) {
Halfedge_base::assign(he);
const Self& ex_he = static_cast<const Self&>(he); const Self& ex_he = static_cast<const Self&>(he);
m_data = ex_he.m_data; m_data = ex_he.m_data;
} }
template <typename XMonotoneCurve>
struct rebind {
using X_monotonote_curve_2 = XMonotoneCurve;
using other = typename Halfedge_base::template rebind<X_monotonote_curve_2>;
};
}; };
/*! /*! \class
* \class
* An extended DCEL face with auxiliary data field. * An extended DCEL face with auxiliary data field.
*/ */
template <class FaceBase_, typename FaceData_> template <typename FaceBase, typename FaceData>
class Arr_extended_face : public FaceBase_ class Arr_extended_face : public FaceBase {
{ using Face_base = FaceBase;
typedef Arr_extended_face<FaceBase_, FaceData_> Self; using Face_data = FaceData;
typedef FaceBase_ Base;
using Self = Arr_extended_face<Face_base, Face_data>;
public: public:
typedef FaceData_ Data; typedef Face_data Data;
private: private:
Data m_data; // The auxiliary data field. Data m_data; // The auxiliary data field.
public: public:
/*! Get the auxiliary data (const version). */ /*! Get the auxiliary data (const version). */
const Data& data () const const Data& data() const { return m_data; }
{
return (m_data);
}
/*! Get the auxiliary data (non-const version). */ /*! Get the auxiliary data (non-const version). */
Data& data () Data& data() { return m_data; }
{
return (m_data);
}
/*! Set the auxiliary data. */ /*! Set the auxiliary data. */
void set_data (const Data& data) void set_data(const Data& data) { m_data = data; }
{
m_data = data;
}
/*! Assign from another vertex. */
virtual void assign (const Base& f)
{
Base::assign (f);
/*! Assign from another face. */
virtual void assign(const Face_base& f) {
Face_base::assign(f);
const Self& ex_f = static_cast<const Self&>(f); const Self& ex_f = static_cast<const Self&>(f);
m_data = ex_f.m_data; m_data = ex_f.m_data;
} }
@ -173,49 +146,41 @@ public:
* defines the Point_2 and X_monotone_curve_2 types. * defines the Point_2 and X_monotone_curve_2 types.
* The FaceData parameter specifies the object type stored with each face. * The FaceData parameter specifies the object type stored with each face.
*/ */
template <class Traits_, typename FaceData_, template <typename Traits_, typename FaceData,
class VertexBase_ = Arr_vertex_base<typename Traits_::Point_2>, typename VertexBase = Arr_vertex_base<typename Traits_::Point_2>,
class HalfedgeBase_ = typename HalfedgeBase =
Arr_halfedge_base<typename Traits_::X_monotone_curve_2>, Arr_halfedge_base<typename Traits_::X_monotone_curve_2>,
class FaceBase_ = Arr_face_base> typename FaceBase = Arr_face_base>
class Arr_face_extended_dcel : class Arr_face_extended_dcel :
public Arr_dcel_base<VertexBase_, public Arr_dcel_base<VertexBase, HalfedgeBase,
HalfedgeBase_, Arr_extended_face<FaceBase, FaceData>> {
Arr_extended_face<FaceBase_, FaceData_> >
{
public: public:
using Face_base = FaceBase;
typedef FaceData_ Face_data; using Face_data = FaceData;
/*! \struct /*! \struct
* An auxiliary structure for rebinding the DCEL with a new traits class. * An auxiliary structure for rebinding the DCEL with a new traits class.
*/ */
template <typename T> template <typename T>
class rebind class rebind {
{ private:
typedef typename VertexBase_::template rebind using Pnt = typename T::Point_2;
<typename T::Point_2> Rebind_vertex; using Xcv = typename T::X_monotone_curve_2;
typedef typename Rebind_vertex::other Vertex_base; using Rebind_vertex = typename VertexBase::template rebind<Pnt>;
typedef typename HalfedgeBase_::template rebind using Vertex_other = typename Rebind_vertex::other;
<typename T::X_monotone_curve_2> Rebind_halfedge; using Rebind_halfedge = typename HalfedgeBase::template rebind<Xcv>;
typedef typename Rebind_halfedge::other Halfedge_base; using Halfedge_other = typename Rebind_halfedge::other;
public: public:
using other = Arr_face_extended_dcel<T, Face_data, Vertex_other,
typedef Arr_face_extended_dcel<T, Halfedge_other, Face_base>;
Face_data,
Vertex_base,
Halfedge_base,
FaceBase_> other;
}; };
/*! Default constructor. */ /*! Default constructor. */
Arr_face_extended_dcel () Arr_face_extended_dcel() {}
{}
/*! Destructor. */ /*! Destructor. */
virtual ~Arr_face_extended_dcel () virtual ~Arr_face_extended_dcel() {}
{}
}; };
/*! \class /*! \class
@ -225,54 +190,48 @@ public:
* The VertexData, HalfedgeData and FaceData parameter specify the object types * The VertexData, HalfedgeData and FaceData parameter specify the object types
* stored with each vertex, halfedge and face, respectively. * stored with each vertex, halfedge and face, respectively.
*/ */
template <class Traits_, template <typename Traits_,
typename VertexData_, typename HalfedgeData_, typename FaceData_, typename VertexData, typename HalfedgeData, typename FaceData,
class VertexBase_ = Arr_vertex_base<typename Traits_::Point_2>, typename VertexBase = Arr_vertex_base<typename Traits_::Point_2>,
class HalfedgeBase_ = typename HalfedgeBase =
Arr_halfedge_base<typename Traits_::X_monotone_curve_2>, Arr_halfedge_base<typename Traits_::X_monotone_curve_2>,
class FaceBase_ = Arr_face_base> typename FaceBase = Arr_face_base>
class Arr_extended_dcel : class Arr_extended_dcel :
public Arr_dcel_base<Arr_extended_vertex<VertexBase_, VertexData_>, public Arr_dcel_base<Arr_extended_vertex<VertexBase, VertexData>,
Arr_extended_halfedge<HalfedgeBase_, HalfedgeData_>, Arr_extended_halfedge<HalfedgeBase, HalfedgeData>,
Arr_extended_face<FaceBase_, FaceData_> > Arr_extended_face<FaceBase, FaceData>> {
{
public: public:
using Vertex_data = VertexData;
typedef VertexData_ Vertex_data; using Halfedge_data = HalfedgeData;
typedef HalfedgeData_ Halfedge_data; using Face_data = FaceData;
typedef FaceData_ Face_data; using Vertex_base = VertexBase;
using Halfedge_base = HalfedgeBase;
using Face_base = FaceBase;
/*! \struct /*! \struct
* An auxiliary structure for rebinding the DCEL with a new traits class. * An auxiliary structure for rebinding the DCEL with a new traits class.
*/ */
template <typename T> template <typename T>
class rebind struct rebind {
{ private:
typedef typename VertexBase_::template rebind using Pnt = typename T::Point_2;
<typename T::Point_2> Rebind_vertex; using Xcv = typename T::X_monotone_curve_2;
typedef typename Rebind_vertex::other Vertex_base; using Rebind_vertex = typename VertexBase::template rebind<Pnt>;
typedef typename HalfedgeBase_::template rebind using Vertex_other = typename Rebind_vertex::other;
<typename T::X_monotone_curve_2> Rebind_halfedge; using Rebind_halfedge = typename HalfedgeBase::template rebind<Xcv>;
typedef typename Rebind_halfedge::other Halfedge_base; using Halfedge_other = typename Rebind_halfedge::other;
public: public:
using other = Arr_extended_dcel<T,
typedef Arr_extended_dcel<T, Vertex_data, Halfedge_data, Face_data,
Vertex_data, Vertex_other, Halfedge_other, Face_base>;
Halfedge_data,
Face_data,
Vertex_base,
Halfedge_base,
FaceBase_> other;
}; };
/*! Default constructor. */ /*! Default constructor. */
Arr_extended_dcel () Arr_extended_dcel() {}
{}
/*! Destructor. */ /*! Destructor. */
virtual ~Arr_extended_dcel () virtual ~Arr_extended_dcel() {}
{}
}; };
} //namespace CGAL } //namespace CGAL

View File

@ -23,6 +23,7 @@
*/ */
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
#include <CGAL/Arr_default_dcel.h>
#include <CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h> #include <CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h>
#include <CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h> #include <CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h>
#include <CGAL/Arr_topology_traits/Arr_unb_planar_insertion_helper.h> #include <CGAL/Arr_topology_traits/Arr_unb_planar_insertion_helper.h>

View File

@ -25,6 +25,7 @@
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
#include <CGAL/Arrangement_on_surface_2.h> #include <CGAL/Arrangement_on_surface_2.h>
#include <CGAL/Arrangement_2/Arr_default_planar_topology.h> #include <CGAL/Arrangement_2/Arr_default_planar_topology.h>
#include <CGAL/Arr_default_dcel.h>
namespace CGAL { namespace CGAL {

View File

@ -39,11 +39,11 @@
#include <CGAL/HalfedgeDS_iterator.h> #include <CGAL/HalfedgeDS_iterator.h>
#include <CGAL/Arrangement_2/Arrangement_2_iterators.h> #include <CGAL/Arrangement_2/Arrangement_2_iterators.h>
#include <CGAL/In_place_list.h> #include <CGAL/In_place_list.h>
#include <CGAL/Arr_default_dcel.h>
#include <CGAL/Arr_observer.h> #include <CGAL/Arr_observer.h>
#include <CGAL/Arr_accessor.h> #include <CGAL/Arr_accessor.h>
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h> #include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
#include <CGAL/function_objects.h> #include <CGAL/function_objects.h>
#include <CGAL/iterator.h>
#include <CGAL/Iterator_project.h> #include <CGAL/Iterator_project.h>
#include <CGAL/Iterator_transform.h> #include <CGAL/Iterator_transform.h>
#include <CGAL/Arr_point_location_result.h> #include <CGAL/Arr_point_location_result.h>

View File

@ -9,6 +9,7 @@
// //
// //
// Author(s): Ron Wein <wein@post.tau.ac.il> // Author(s): Ron Wein <wein@post.tau.ac.il>
// Efi Fogel <efif@post.tau.ac.il>
#ifndef CGAL_ARRANGEMENT_WITH_HISTORY_2_H #ifndef CGAL_ARRANGEMENT_WITH_HISTORY_2_H
#define CGAL_ARRANGEMENT_WITH_HISTORY_2_H #define CGAL_ARRANGEMENT_WITH_HISTORY_2_H
@ -23,6 +24,7 @@
#include <CGAL/Arrangement_on_surface_with_history_2.h> #include <CGAL/Arrangement_on_surface_with_history_2.h>
#include <CGAL/Arrangement_2/Arr_default_planar_topology.h> #include <CGAL/Arrangement_2/Arr_default_planar_topology.h>
#include <CGAL/Arr_default_dcel.h>
namespace CGAL { namespace CGAL {