mirror of https://github.com/CGAL/cgal
Introduced Arr_dcel and fixed Arr_default_dcel
This commit is contained in:
parent
a850c34460
commit
826f60c4be
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#include <CGAL/Arrangement_with_history_2.h>
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Arr_default_dcel.h>
|
||||
#include <CGAL/Arr_segment_traits_2.h>
|
||||
#include <CGAL/Arr_linear_traits_2.h>
|
||||
#include <CGAL/Arr_polyline_traits_2.h>
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ the `Arrangement_2` class template; their description follows.
|
|||
|
||||
<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
|
||||
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.
|
||||
|
||||
<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
|
||||
the topological layout of the arrangement. This parameter is
|
||||
substituted with `Arr_default_dcel<Traits>` 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.
|
||||
</UL>
|
||||
|
||||
|
|
@ -5877,12 +5878,12 @@ applications.
|
|||
|
||||
All examples presented so far use the default \dcel; namely, they
|
||||
employ the `Arr_default_dcel<Traits>` 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<Traits>`. 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<Traits>`. 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`
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ namespace CGAL {
|
|||
*
|
||||
* The `Arr_bounded_planar_topology_traits_2` template has two parameters:
|
||||
* <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
|
||||
* 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.
|
||||
* <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
|
||||
* value of this parameter is by default
|
||||
* `Arr_default_dcel<Traits>`.
|
||||
|
|
|
|||
|
|
@ -57,17 +57,17 @@ namespace CGAL {
|
|||
* 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$).
|
||||
* 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<NtTraits::Rational>` and `Cartesian<NtTraits::Algebraic>`
|
||||
* 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<NtTraits::Rational>` and `Cartesian<NtTraits::Algebraic>`
|
||||
* 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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
@ -1,26 +1,25 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgArrangementOnSurface2DCEL
|
||||
|
||||
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<V,H,F>`
|
||||
/*! \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<Traits, V, H, F>`
|
||||
* \sa `Arr_dcel_base<V, H, F>`
|
||||
*/
|
||||
template< typename 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 */
|
||||
template <typename Traits> using Arr_default_dcel = Arr_dcel<Traits>;
|
||||
|
||||
} /* end namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -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<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
|
||||
`Simple_cartesian<double>`) is also possible, at the user's own
|
||||
risk.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ namespace CGAL {
|
|||
*
|
||||
* The `Arr_spherical_topology_traits_2` template has two parameters:
|
||||
* <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
|
||||
* 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.
|
||||
* <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
|
||||
* value of this parameter is by default
|
||||
* `Arr_default_dcel<Traits>`.
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ namespace CGAL {
|
|||
*
|
||||
* The `Arr_unb_planar_topology_traits_2` template has two parameters:
|
||||
* <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
|
||||
* 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.
|
||||
* <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
|
||||
* value of this parameter is by default
|
||||
* `Arr_default_dcel<Traits>`.
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@ namespace CGAL {
|
|||
|
||||
* The `Arrangement_on_surface_2` template has two parameters:
|
||||
* <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
|
||||
* `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.
|
||||
* <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.
|
||||
* </UL>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -25,16 +25,15 @@ namespace CGAL {
|
|||
* The `Arrangement_on_surface_with_history_2` template has two parameters:
|
||||
*
|
||||
* <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
|
||||
* `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.
|
||||
* <LI>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<Traits>`.
|
||||
* <LI>The `TopologyTraits` template-parameter should be substituted with a
|
||||
* class that is a model of the `ArrangementTopologyTraits` concept.
|
||||
* </UL>
|
||||
*
|
||||
* \sa `Arrangement_with_history_2<GeometryTraits,Dcel>`
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ namespace CGAL {
|
|||
*
|
||||
* The `Arrangement_with_history_2` template has two parameters:
|
||||
* <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`
|
||||
* 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.
|
||||
* <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
|
||||
* parameter is by default `Arr_default_dcel<Traits>`.
|
||||
* </UL>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ Instantiate a dcel class with many different possible types without ad-hoc limit
|
|||
|
||||
\cgalHasModelsBegin
|
||||
\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_extended_dcel<Traits,VData,HData,FData,V,H,F>}
|
||||
\cgalHasModelsEnd
|
||||
|
|
@ -48,4 +49,3 @@ Arr_dcel();
|
|||
/// @}
|
||||
|
||||
}; /* end ArrangementDcelWithRebind */
|
||||
|
||||
|
|
|
|||
|
|
@ -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<V,H,F>`
|
||||
- `CGAL::Arr_dcel<Traits,V,H,F>`
|
||||
- `CGAL::Arr_default_dcel<Traits>`
|
||||
- `CGAL::Arr_face_extended_dcel<Traits,FData,V,H,F>`
|
||||
- `CGAL::Arr_extended_dcel<Traits,VData,HData,FData,V,H,F>`
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
*/
|
||||
|
||||
#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_bounded_planar_construction_helper.h>
|
||||
#include <CGAL/Arr_topology_traits/Arr_bounded_planar_insertion_helper.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 <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
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
//
|
||||
//
|
||||
// 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)
|
||||
|
||||
#ifndef CGAL_ARR_DCEL_BASE_H
|
||||
|
|
@ -23,11 +24,12 @@
|
|||
* peripheral records.
|
||||
*/
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Arr_enums.h>
|
||||
#include <list>
|
||||
#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/function_objects.h>
|
||||
#include <CGAL/Iterator_project.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 <wein@post.tau.ac.il>
|
||||
// Baruch Zukerman <baruchzu@post.tau.ac.il>
|
||||
// Author(s): Efi Fogel <efifogel@gmail.com>
|
||||
|
||||
#ifndef CGAL_ARR_DEFAULT_DCEL_H
|
||||
#define CGAL_ARR_DEFAULT_DCEL_H
|
||||
|
|
@ -19,46 +18,19 @@
|
|||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
/*! \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 {
|
||||
|
||||
/*! \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 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()
|
||||
{}
|
||||
};
|
||||
template <typename Traits> using Arr_default_dcel = Arr_dcel<Traits>;
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
#include <CGAL/enable_warnings.h>
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
//
|
||||
// Author(s): Ron Wein <wein@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
|
||||
#define CGAL_ARR_DEFAULT_OVERLAY_TRAITS_H
|
||||
|
|
@ -23,7 +24,6 @@
|
|||
* Definition of default overlay-traits classes.
|
||||
*/
|
||||
|
||||
#include <CGAL/Arr_default_dcel.h>
|
||||
#include <CGAL/Arr_extended_dcel.h>
|
||||
#include <CGAL/Surface_sweep_2/Arr_default_overlay_traits_base.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,142 +26,115 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
* \class
|
||||
/*! \class
|
||||
* An extended DCEL vertex with auxiliary data field.
|
||||
*/
|
||||
template <class VertexBase_, typename VertexData_>
|
||||
class Arr_extended_vertex : public VertexBase_
|
||||
{
|
||||
typedef Arr_extended_vertex<VertexBase_, VertexData_> Self;
|
||||
typedef VertexBase_ Base;
|
||||
template <typename VertexBase, typename VertexData>
|
||||
class Arr_extended_vertex : public VertexBase {
|
||||
using Vertex_base = VertexBase;
|
||||
using Vertex_data = VertexData;
|
||||
|
||||
using Self = Arr_extended_vertex<Vertex_base, Vertex_data>;
|
||||
|
||||
public:
|
||||
typedef VertexData_ Data;
|
||||
typedef Vertex_data Data;
|
||||
|
||||
private:
|
||||
|
||||
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);
|
||||
|
||||
virtual void assign(const Vertex_base& v) {
|
||||
Vertex_base::assign(v);
|
||||
const Self& ex_v = static_cast<const Self&>(v);
|
||||
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.
|
||||
*/
|
||||
template <class HalfedgeBase_, typename HalfedgeData_>
|
||||
class Arr_extended_halfedge : public HalfedgeBase_
|
||||
{
|
||||
typedef Arr_extended_halfedge<HalfedgeBase_, HalfedgeData_> Self;
|
||||
typedef HalfedgeBase_ Base;
|
||||
template <typename HalfedgeBase, typename HalfedgeData>
|
||||
class Arr_extended_halfedge : public HalfedgeBase {
|
||||
using Halfedge_base = HalfedgeBase;
|
||||
using Halfedge_data = HalfedgeData;
|
||||
|
||||
using Self = Arr_extended_halfedge<Halfedge_base, Halfedge_data>;
|
||||
|
||||
public:
|
||||
typedef HalfedgeData_ Data;
|
||||
typedef Halfedge_data Data;
|
||||
|
||||
private:
|
||||
|
||||
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& he)
|
||||
{
|
||||
Base::assign (he);
|
||||
void set_data(const Data& data) { m_data = data; }
|
||||
|
||||
/*! Assign from another halfedge. */
|
||||
virtual void assign(const Halfedge_base& he) {
|
||||
Halfedge_base::assign(he);
|
||||
const Self& ex_he = static_cast<const Self&>(he);
|
||||
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.
|
||||
*/
|
||||
template <class FaceBase_, typename FaceData_>
|
||||
class Arr_extended_face : public FaceBase_
|
||||
{
|
||||
typedef Arr_extended_face<FaceBase_, FaceData_> Self;
|
||||
typedef FaceBase_ Base;
|
||||
template <typename FaceBase, typename FaceData>
|
||||
class Arr_extended_face : public FaceBase {
|
||||
using Face_base = FaceBase;
|
||||
using Face_data = FaceData;
|
||||
|
||||
using Self = Arr_extended_face<Face_base, Face_data>;
|
||||
|
||||
public:
|
||||
typedef FaceData_ Data;
|
||||
typedef Face_data Data;
|
||||
|
||||
private:
|
||||
|
||||
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<const Self&>(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 Traits_, typename FaceData_,
|
||||
class VertexBase_ = Arr_vertex_base<typename Traits_::Point_2>,
|
||||
class HalfedgeBase_ =
|
||||
template <typename Traits_, typename FaceData,
|
||||
typename VertexBase = Arr_vertex_base<typename Traits_::Point_2>,
|
||||
typename HalfedgeBase =
|
||||
Arr_halfedge_base<typename Traits_::X_monotone_curve_2>,
|
||||
class FaceBase_ = Arr_face_base>
|
||||
typename FaceBase = Arr_face_base>
|
||||
class Arr_face_extended_dcel :
|
||||
public Arr_dcel_base<VertexBase_,
|
||||
HalfedgeBase_,
|
||||
Arr_extended_face<FaceBase_, FaceData_> >
|
||||
{
|
||||
public Arr_dcel_base<VertexBase, HalfedgeBase,
|
||||
Arr_extended_face<FaceBase, FaceData>> {
|
||||
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 <typename T>
|
||||
class rebind
|
||||
{
|
||||
typedef typename VertexBase_::template rebind
|
||||
<typename T::Point_2> Rebind_vertex;
|
||||
typedef typename Rebind_vertex::other Vertex_base;
|
||||
typedef typename HalfedgeBase_::template rebind
|
||||
<typename T::X_monotone_curve_2> Rebind_halfedge;
|
||||
typedef typename Rebind_halfedge::other Halfedge_base;
|
||||
class rebind {
|
||||
private:
|
||||
using Pnt = typename T::Point_2;
|
||||
using Xcv = typename T::X_monotone_curve_2;
|
||||
using Rebind_vertex = typename VertexBase::template rebind<Pnt>;
|
||||
using Vertex_other = typename Rebind_vertex::other;
|
||||
using Rebind_halfedge = typename HalfedgeBase::template rebind<Xcv>;
|
||||
using Halfedge_other = typename Rebind_halfedge::other;
|
||||
|
||||
public:
|
||||
|
||||
typedef Arr_face_extended_dcel<T,
|
||||
Face_data,
|
||||
Vertex_base,
|
||||
Halfedge_base,
|
||||
FaceBase_> other;
|
||||
using other = Arr_face_extended_dcel<T, Face_data, Vertex_other,
|
||||
Halfedge_other, Face_base>;
|
||||
};
|
||||
|
||||
/*! 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 Traits_,
|
||||
typename VertexData_, typename HalfedgeData_, typename FaceData_,
|
||||
class VertexBase_ = Arr_vertex_base<typename Traits_::Point_2>,
|
||||
class HalfedgeBase_ =
|
||||
template <typename Traits_,
|
||||
typename VertexData, typename HalfedgeData, typename FaceData,
|
||||
typename VertexBase = Arr_vertex_base<typename Traits_::Point_2>,
|
||||
typename HalfedgeBase =
|
||||
Arr_halfedge_base<typename Traits_::X_monotone_curve_2>,
|
||||
class FaceBase_ = Arr_face_base>
|
||||
typename FaceBase = Arr_face_base>
|
||||
class Arr_extended_dcel :
|
||||
public Arr_dcel_base<Arr_extended_vertex<VertexBase_, VertexData_>,
|
||||
Arr_extended_halfedge<HalfedgeBase_, HalfedgeData_>,
|
||||
Arr_extended_face<FaceBase_, FaceData_> >
|
||||
{
|
||||
public Arr_dcel_base<Arr_extended_vertex<VertexBase, VertexData>,
|
||||
Arr_extended_halfedge<HalfedgeBase, HalfedgeData>,
|
||||
Arr_extended_face<FaceBase, FaceData>> {
|
||||
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 <typename T>
|
||||
class rebind
|
||||
{
|
||||
typedef typename VertexBase_::template rebind
|
||||
<typename T::Point_2> Rebind_vertex;
|
||||
typedef typename Rebind_vertex::other Vertex_base;
|
||||
typedef typename HalfedgeBase_::template rebind
|
||||
<typename T::X_monotone_curve_2> Rebind_halfedge;
|
||||
typedef typename Rebind_halfedge::other Halfedge_base;
|
||||
struct rebind {
|
||||
private:
|
||||
using Pnt = typename T::Point_2;
|
||||
using Xcv = typename T::X_monotone_curve_2;
|
||||
using Rebind_vertex = typename VertexBase::template rebind<Pnt>;
|
||||
using Vertex_other = typename Rebind_vertex::other;
|
||||
using Rebind_halfedge = typename HalfedgeBase::template rebind<Xcv>;
|
||||
using Halfedge_other = typename Rebind_halfedge::other;
|
||||
|
||||
public:
|
||||
|
||||
typedef Arr_extended_dcel<T,
|
||||
Vertex_data,
|
||||
Halfedge_data,
|
||||
Face_data,
|
||||
Vertex_base,
|
||||
Halfedge_base,
|
||||
FaceBase_> other;
|
||||
using other = Arr_extended_dcel<T,
|
||||
Vertex_data, Halfedge_data, Face_data,
|
||||
Vertex_other, Halfedge_other, Face_base>;
|
||||
};
|
||||
|
||||
/*! Default constructor. */
|
||||
Arr_extended_dcel ()
|
||||
{}
|
||||
Arr_extended_dcel() {}
|
||||
|
||||
/*! Destructor. */
|
||||
virtual ~Arr_extended_dcel ()
|
||||
{}
|
||||
virtual ~Arr_extended_dcel() {}
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
#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_unb_planar_construction_helper.h>
|
||||
#include <CGAL/Arr_topology_traits/Arr_unb_planar_insertion_helper.h>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Arrangement_on_surface_2.h>
|
||||
#include <CGAL/Arrangement_2/Arr_default_planar_topology.h>
|
||||
#include <CGAL/Arr_default_dcel.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@
|
|||
#include <CGAL/HalfedgeDS_iterator.h>
|
||||
#include <CGAL/Arrangement_2/Arrangement_2_iterators.h>
|
||||
#include <CGAL/In_place_list.h>
|
||||
#include <CGAL/Arr_default_dcel.h>
|
||||
#include <CGAL/Arr_observer.h>
|
||||
#include <CGAL/Arr_accessor.h>
|
||||
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
|
||||
#include <CGAL/function_objects.h>
|
||||
#include <CGAL/iterator.h>
|
||||
#include <CGAL/Iterator_project.h>
|
||||
#include <CGAL/Iterator_transform.h>
|
||||
#include <CGAL/Arr_point_location_result.h>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
//
|
||||
//
|
||||
// Author(s): Ron Wein <wein@post.tau.ac.il>
|
||||
// Efi Fogel <efif@post.tau.ac.il>
|
||||
|
||||
#ifndef 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_2/Arr_default_planar_topology.h>
|
||||
#include <CGAL/Arr_default_dcel.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue