Merge master

This commit is contained in:
Andreas Fabri 2024-03-04 16:56:21 +00:00
commit 263db4fa7a
428 changed files with 11775 additions and 10682 deletions

3
.github/test.sh vendored
View File

@ -9,4 +9,5 @@ PLUGINS_ARRAY=(${LIST_OF_PLUGINS});
NB_OF_PLUGINS=${#PLUGINS_ARRAY[@]} NB_OF_PLUGINS=${#PLUGINS_ARRAY[@]}
DEL=$(($NB_OF_PLUGINS / 4)) DEL=$(($NB_OF_PLUGINS / 4))
cd build cd build
make -j2 ${PLUGINS_ARRAY[@]:$(($FACTOR * $DEL)):$((($FACTOR + 1) * $DEL))} NUM_PROCS=$(nproc)
make -j${NUM_PROCS} ${PLUGINS_ARRAY[@]:$(($FACTOR * $DEL)):$((($FACTOR + 1) * $DEL))}

View File

@ -104,8 +104,8 @@ jobs:
echo "DoxygenError=No package affected." >> $GITHUB_OUTPUT echo "DoxygenError=No package affected." >> $GITHUB_OUTPUT
exit 1 exit 1
fi fi
cd build_doc && make -j2 doc cd build_doc && make -j$(nproc) doc
make -j2 doc_with_postprocessing 2>tmp.log make -j$(nproc) doc_with_postprocessing 2>tmp.log
if [ -s tmp.log ]; then if [ -s tmp.log ]; then
content=`cat ./tmp.log` content=`cat ./tmp.log`
delimiter="$(openssl rand -hex 8)" delimiter="$(openssl rand -hex 8)"

View File

@ -12,24 +12,24 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: REUSE version - name: REUSE version
uses: fsfe/reuse-action@v2 uses: fsfe/reuse-action@v3
with: with:
args: --version args: --version
- name: REUSE lint - name: REUSE lint
uses: fsfe/reuse-action@v2 uses: fsfe/reuse-action@v3
with: with:
args: --include-submodules lint args: --include-submodules lint
- name: REUSE SPDX SBOM - name: REUSE SPDX SBOM
uses: fsfe/reuse-action@v2 uses: fsfe/reuse-action@v3
with: with:
args: spdx args: spdx
- name: install dependencies - name: install dependencies
run: sudo apt-get install -y cmake run: sudo apt-get update && sudo apt-get install -y cmake
- name: Create CGAL internal release - name: Create CGAL internal release
run: | run: |
mkdir -p ./release mkdir -p ./release
cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake
- name: REUSE lint release tarball - name: REUSE lint release tarball
uses: fsfe/reuse-action@v2 uses: fsfe/reuse-action@v3
with: with:
args: --root ./release/CGAL-9.9 --include-submodules lint args: --root ./release/CGAL-9.9 --include-submodules lint

View File

@ -73,7 +73,7 @@ public:
Result; Result;
public: public:
First_intersection_traits(const AABBTraits& traits) First_intersection_traits(const AABBTraits& traits)
: m_result(), m_traits(traits) : m_result(std::nullopt), m_traits(traits)
{} {}
bool go_further() const { bool go_further() const {
@ -202,7 +202,7 @@ class First_primitive_traits
public: public:
First_primitive_traits(const AABBTraits& traits) First_primitive_traits(const AABBTraits& traits)
: m_is_found(false) : m_is_found(false)
, m_result() , m_result(std::nullopt)
, m_traits(traits) {} , m_traits(traits) {}
bool go_further() const { return !m_is_found; } bool go_further() const { return !m_is_found; }

View File

@ -27,7 +27,7 @@ namespace Qt {
} }
template < class Gt > template < class Gt >
class Parabola_segment_2 : public Parabola_2< Gt > struct Parabola_segment_2 : public Parabola_2< Gt >
{ {
typedef CGAL::Parabola_2<Gt> Base; typedef CGAL::Parabola_2<Gt> Base;
typedef typename Base::Site_2 Site_2; typedef typename Base::Site_2 Site_2;
@ -39,10 +39,10 @@ class Parabola_segment_2 : public Parabola_2< Gt >
using Base::t; using Base::t;
using Base::f; using Base::f;
protected:
Point_2 p1, p2; Point_2 p1, p2;
public:
Parabola_segment_2() : Parabola_2< Gt >() {} Parabola_segment_2() : Parabola_2< Gt >() {}
template<class ApolloniusSite> template<class ApolloniusSite>

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

@ -11,7 +11,7 @@
#include "IntersectCurves.h" #include "IntersectCurves.h"
#include "ArrangementTypes.h" #include "ArrangementTypes.h"
#include <boost/function_output_iterator.hpp> #include <boost/iterator/function_output_iterator.hpp>
template <typename Traits_> template <typename Traits_>

View File

@ -69,10 +69,10 @@ class Arrangement_2 { ... };
An instance of this template represents an arrangement embedded in the An instance of this template represents an arrangement embedded in the
plane. When the template is instantiated, the `GeometryTraits` plane. When the template is instantiated, the `GeometryTraits`
parameter must be substituted with a type that defines a set of parameter must be substituted by a type that defines a set of
geometric-object types, such as point and curve, and a set of geometric-object types, such as point and curve, and a set of
operations on objects of these types (see Section \ref operations on objects of these types (see Section \ref
aos_sec-geom_traits); the `Dcel` parameter must be substituted with a aos_sec-geom_traits); the `Dcel` parameter must be substituted by a
type that represents a doubly-connected edge list (\dcel) data type that represents a doubly-connected edge list (\dcel) data
structure. It defines types of topological objects, such as vertices, structure. It defines types of topological objects, such as vertices,
edges, and faces, and the operations required to maintain the edges, and faces, and the operations required to maintain the
@ -91,7 +91,7 @@ An instance of this template represents a two-dimensional arrangement
embedded in a surface in three dimensional space. When the template is embedded in a surface in three dimensional space. When the template is
instantiated, the `GeometryTraits` parameter must be substituted as instantiated, the `GeometryTraits` parameter must be substituted as
described above; the `TopologyTraits` parameter must be substituted described above; the `TopologyTraits` parameter must be substituted
with a type that deals with the topology of the surface (see Section by a type that deals with the topology of the surface (see Section
\ref aos_sec-topol_traits). In particular, it maintains a \ref aos_sec-topol_traits). In particular, it maintains a
representation of the arrangement graph embedded in the surface using representation of the arrangement graph embedded in the surface using
a doubly-connected edge list (\dcel) data-structure suitable for a doubly-connected edge list (\dcel) data-structure suitable for
@ -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 by 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 by 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 by `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>
@ -1001,7 +1002,7 @@ segments common to all examples that do not construct new geometric
objects. They are kept in the header file objects. They are kept in the header file
`arr_inexact_construction_segments.h`. In these examples the `Traits` `arr_inexact_construction_segments.h`. In these examples the `Traits`
parameter of the `Arrangement_2<Traits, Dcel>` class template is parameter of the `Arrangement_2<Traits, Dcel>` class template is
substituted with an instance of the substituted by an instance of the
`Arr_non_caching_segment_traits_2<Kernel>` class template. The `Arr_non_caching_segment_traits_2<Kernel>` class template. The
`Arr_non_caching_segment_traits_2` class template is instantiated with `Arr_non_caching_segment_traits_2` class template is instantiated with
the predefined kernel that evaluates predicates in an exact manner, the predefined kernel that evaluates predicates in an exact manner,
@ -1438,7 +1439,7 @@ vary according to the user choice.} for answering queries:
The landmark strategy requires that the type of the attached The landmark strategy requires that the type of the attached
arrangement be an instance of the `Arrangement_2<Traits,Dcel>` class arrangement be an instance of the `Arrangement_2<Traits,Dcel>` class
template, where the `Traits` parameter is substituted with a template, where the `Traits` parameter is substituted by a
geometry-traits class that models the `ArrangementLandmarkTraits_2` geometry-traits class that models the `ArrangementLandmarkTraits_2`
concept, which refines the basic `ArrangementBasicTraits_2` concept; concept, which refines the basic `ArrangementBasicTraits_2` concept;
see Section \ref aos_sssec-tr_landmarks_concept for details. Most see Section \ref aos_sssec-tr_landmarks_concept for details. Most
@ -1742,7 +1743,7 @@ query results, and insert \f$c\f$ at its proper
location.\cgalFootnote{The \cgalFootnoteCode{CGAL::insert_non_intersecting_curve<>()} location.\cgalFootnote{The \cgalFootnoteCode{CGAL::insert_non_intersecting_curve<>()}
function template, as all other functions reviewed in this section, is function template, as all other functions reviewed in this section, is
parameterized by an arrangement type and a point-location type (The parameterized by an arrangement type and a point-location type (The
latter must be substituted with a model of the latter must be substituted by a model of the
`ArrangementPointLocation_2` concept).} The insertion operation thus `ArrangementPointLocation_2` concept).} The insertion operation thus
hardly requires any geometric operations on top of the ones needed to hardly requires any geometric operations on top of the ones needed to
answer the point-location queries. Moreover, it is sufficient that the answer the point-location queries. Moreover, it is sufficient that the
@ -1846,7 +1847,7 @@ condition. Consider the call \link CGAL::insert<>() `insert(arr, c,
pl)`\endlink, where \f$c\f$ is not necessarily \f$x\f$-monotone. In pl)`\endlink, where \f$c\f$ is not necessarily \f$x\f$-monotone. In
this case the type of `arr` must be an instance of the this case the type of `arr` must be an instance of the
`Arrangement_2<Traits, Dcel>` class template, where the `Traits` `Arrangement_2<Traits, Dcel>` class template, where the `Traits`
template parameter is substituted with a traits class that models the template parameter is substituted by a traits class that models the
concept `ArrangementTraits_2`, which refines the concept `ArrangementTraits_2`, which refines the
`ArrangementXMonotoneTraits_2` concept. It has to define an additional `ArrangementXMonotoneTraits_2` concept. It has to define an additional
\link ArrangementTraits_2::Curve_2 `Curve_2`\endlink type, which may \link ArrangementTraits_2::Curve_2 `Curve_2`\endlink type, which may
@ -2267,7 +2268,7 @@ accepts the name of an input file that contains the plain-text
description of the geometric objects and an output iterator for description of the geometric objects and an output iterator for
storing the newly constructed objects. When the function is storing the newly constructed objects. When the function is
instantiated, the first template parameter, namely `Type`, must be instantiated, the first template parameter, namely `Type`, must be
substituted with the type of objects to read. It is assumed that an substituted by the type of objects to read. It is assumed that an
extractor operator (`>>`) that extracts objects of the given type from extractor operator (`>>`) that extracts objects of the given type from
the input stream is available. The listing of the function template, the input stream is available. The listing of the function template,
which is defined in the file `read_objects.h`, is omitted here which is defined in the file `read_objects.h`, is omitted here
@ -2704,7 +2705,7 @@ All the free functions that operate on arrangements of bounded curves
of unbounded curves. For example, consider a container of linear of unbounded curves. For example, consider a container of linear
curves that has to be inserted into an arrangement object, the type of curves that has to be inserted into an arrangement object, the type of
which is an instance of the `Arrangement_2<Traits,Dcel>` class which is an instance of the `Arrangement_2<Traits,Dcel>` class
template, where the `Traits` parameter is substituted with the traits template, where the `Traits` parameter is substituted by the traits
class that handles linear curves; see Section \ref class that handles linear curves; see Section \ref
arr_sssectr_linear. You can do it incrementally; namely, insert the arr_sssectr_linear. You can do it incrementally; namely, insert the
curves one by one as follows: curves one by one as follows:
@ -3485,7 +3486,7 @@ point-location strategy.
The type of an arrangement associated with the landmark point-location The type of an arrangement associated with the landmark point-location
strategy (see Section \ref arr_ssecpl) must be an instance of the strategy (see Section \ref arr_ssecpl) must be an instance of the
`Arrangement_on_surface_2<GeomTraits, TopolTraits>` class template, `Arrangement_on_surface_2<GeomTraits, TopolTraits>` class template,
where the `GeomTraits` parameter is substituted with a model of the where the `GeomTraits` parameter is substituted by a model of the
concept `ArrangementLandmarkTraits_2`. (Naturally, it can also model concept `ArrangementLandmarkTraits_2`. (Naturally, it can also model
either the `ArrangementXMonotoneTraits_2` concept or the either the `ArrangementXMonotoneTraits_2` concept or the
`ArrangementTraits_2` concept.) The `ArrangementLandmarkTraits_2` `ArrangementTraits_2` concept.) The `ArrangementLandmarkTraits_2`
@ -4541,7 +4542,7 @@ PkgBooleanSetOperations2Ref. Note that it is not a model of the
computations with square root numbers, which makes it attractive for computations with square root numbers, which makes it attractive for
arrangements induced by line segments, circular arcs, and whole arrangements induced by line segments, circular arcs, and whole
circles. When the traits class-template is instantiated, the `Kernel` circles. When the traits class-template is instantiated, the `Kernel`
template parameter must be substituted with a geometric kernel that template parameter must be substituted by a geometric kernel that
models the `Kernel` concept. Always plug in a kernel that uses a models the `Kernel` concept. Always plug in a kernel that uses a
rational number type, such as rational number type, such as
`Exact_predicates_exact_constructions_kernel`. Observe that the nested `Exact_predicates_exact_constructions_kernel`. Observe that the nested
@ -4722,20 +4723,20 @@ follows:
<UL> <UL>
<LI>The `RatKernel` template parameter must be substituted with a <LI>The `RatKernel` template parameter must be substituted by a
geometric kernel whose field type is an exact rational type. It is geometric kernel whose field type is an exact rational type. It is
used to define basic geometric entities (e.g., a line segment or a used to define basic geometric entities (e.g., a line segment or a
circle) with rational coefficients. Typically we use one of the circle) with rational coefficients. Typically we use one of the
standard \cgal kernels, instantiated with the number type standard \cgal kernels, instantiated with the number type
`NtTraits::Rational` (see below). `NtTraits::Rational` (see below).
<LI>The `AlgKernel` template parameter must be substituted with a <LI>The `AlgKernel` template parameter must be substituted by a
geometric kernel whose field type is an exact algebraic type. It is geometric kernel whose field type is an exact algebraic type. It is
used to define points with algebraic coordinates. Typically, we use used to define points with algebraic coordinates. Typically, we use
one of the standard \cgal kernels, instantiated with the number type one of the standard \cgal kernels, instantiated with the number type
`NtTraits::Algebraic` (see below). `NtTraits::Algebraic` (see below).
<LI>The `NtTraits` template parameter must be substituted with a type <LI>The `NtTraits` template parameter must be substituted by a type
that encapsulates all the numeric operations needed for performing that encapsulates all the numeric operations needed for performing
geometric computation carried out by the geometric traits class. It geometric computation carried out by the geometric traits class. It
defines the `Integer`, `Rational`, and `Algebraic` number-types, and defines the `Integer`, `Rational`, and `Algebraic` number-types, and
@ -4916,7 +4917,7 @@ provided by the traits in form of functors.
When the `Arr_rational_function_traits_2<AlgebraicKernel_d_1>` class When the `Arr_rational_function_traits_2<AlgebraicKernel_d_1>` class
template is instantiated, the template parameter must be substituted template is instantiated, the template parameter must be substituted
with a model of the `AlgebraicKernel_d_1` concept. Models of this by a model of the `AlgebraicKernel_d_1` concept. Models of this
concept, such as the `Algebraic_kernel_d_1<Coefficient>` class concept, such as the `Algebraic_kernel_d_1<Coefficient>` class
template provided by the package \ref PkgAlgebraicFoundations are template provided by the package \ref PkgAlgebraicFoundations are
meant to support algebraic functionalities on univariate polynomials meant to support algebraic functionalities on univariate polynomials
@ -5176,11 +5177,11 @@ polynomial. Currently supported integral number types are `Gmpz`,
statements included in the header file `integer_type.h`, the listings statements included in the header file `integer_type.h`, the listings
of which are omitted here. This header file is used by the two example of which are omitted here. This header file is used by the two example
programs listed in this section. The template parameter `Coefficient` programs listed in this section. The template parameter `Coefficient`
can be substituted in addition with an instance of the can be substituted in addition by an instance of the
`Sqrt_extension<A,B>` class template, where the template parameters `Sqrt_extension<A,B>` class template, where the template parameters
`NT` and `Root` are substituted in turn with one of the integral `NT` and `Root` are substituted in turn by one of the integral
number types above. Finally, the template parameter `Coefficient` can number types above. Finally, the template parameter `Coefficient` can
be substituted also with a rational number type, where the type of the be substituted also by a rational number type, where the type of the
numerator and denominator is one of the types above. numerator and denominator is one of the types above.
The type \link Arr_algebraic_segment_traits_2::Curve_2 The type \link Arr_algebraic_segment_traits_2::Curve_2
@ -5487,7 +5488,7 @@ decorator used to attach a data field to curves and to
\f$x\f$-monotone curves. It is a class template named \f$x\f$-monotone curves. It is a class template named
`Arr_curve_data_traits_2<BaseTraits, XMonotoneCurveData, Merge, `Arr_curve_data_traits_2<BaseTraits, XMonotoneCurveData, Merge,
CurveData, Convert>` parameterized by a base-traits class, which must CurveData, Convert>` parameterized by a base-traits class, which must
be substituted with one of the geometric traits models described in be substituted by one of the geometric traits models described in
the previous subsections or with a user-defined traits model, when the the previous subsections or with a user-defined traits model, when the
decorator is instantiated. The curve-data decorator derives from the decorator is instantiated. The curve-data decorator derives from the
base-traits class, and in particular inherits its \link base-traits class, and in particular inherits its \link
@ -5703,20 +5704,25 @@ objects, so that when one object changes state, all its dependents are
notified and updated automatically. The observed object does not know notified and updated automatically. The observed object does not know
anything about the observers. It merely "publishes" information about anything about the observers. It merely "publishes" information about
changes when they occur. In our case observers can be attached to an changes when they occur. In our case observers can be attached to an
arrangement object. An attached observer receives notifications about arrangement object.
the changes this arrangement undergoes.
An observer object, the type of which is an instance of the An observer object that observes changes in an arrangement object
`Arr_observer<Arrangement>` class template, stores a pointer to an stores a pointer to the attached arrangement object. It receives
arrangement object. When the `Arr_observer<Arrangement>` class notifications about the changes this arrangement undergoes. The
template is instantiated, the `Arrangement` parameter must be observer receives notifications <em>just before</em> a structural
substituted with the type of the arrangement object. The observer change occurs in the arrangement and <em>immediately after</em> such a
receives notifications <em>just before</em> a structural change occurs change takes place. An observer object that observes changes in an
in the arrangement and <em>immediately after</em> such a change takes arrangement object of type `Arrangement` must be of a type derived
place. `Arr_observer` serves as a base class for other from `Arrangement::Observer`, which is an alias to
observer classes and defines a set of virtual notification `Aos_observer<Arrangement_on_surface_2>`, where
functions, with default empty implementations. The set of functions `Arrangement_on_surface_2` is the type of the arrangement object or
can be divided into three categories, as follows: its base type. An instance of `Aos_observer<>` serves as a base type
for other observer classes and defines a set of virtual notification
functions, with default empty implementations. You can also use the
template alias `Arr_observer<Arrangement_2>`, where `Arrangement_2` is
the type of the arrangement object in case it is derived from an
instance of the template `Arrangement_on_surface_2`. The set of
functions can be divided into three categories, as follows:
<OL> <OL>
@ -5782,10 +5788,10 @@ the call to `after_global_change()`.
</OL> </OL>
See the Reference Manual for a detailed specification of the See the Reference Manual for a detailed specification of the
`Arr_observer` class template and the prototypes of all notification `Aos_observer` class template and the prototypes of all notification
functions. functions.
Each arrangement object stores a list of pointers to `Arr_observer` Each arrangement object stores a list of pointers to `Aos_observer`
objects. This list may be empty, in which case the arrangement does objects. This list may be empty, in which case the arrangement does
not have to notify any external class on the structural changes it not have to notify any external class on the structural changes it
undergoes. If, however, there are observers associated with the undergoes. If, however, there are observers associated with the
@ -5799,7 +5805,7 @@ invoked for each observer.
<!-- This allows for the nesting of \Index{observer} objects. --> <!-- This allows for the nesting of \Index{observer} objects. -->
Concrete arrangement-observer classes should inherit from Concrete arrangement-observer classes should inherit from
`Arr_observer`. When an observer is constructed, it is attached to a `Aos_observer`. When an observer is constructed, it is attached to a
valid arrangement supplied to the observed constructor, or valid arrangement supplied to the observed constructor, or
alternatively the observer can be attached to the arrangement at a alternatively the observer can be attached to the arrangement at a
later time. When this happens, the observer object inserts itself later time. When this happens, the observer object inserts itself
@ -5809,8 +5815,8 @@ thereafter. Subsequently, the observer object unregisters itself by
removing itself from this list just before it is destroyed. Most removing itself from this list just before it is destroyed. Most
concrete observer-classes do not need to use the full set of concrete observer-classes do not need to use the full set of
notifications. Thus, the bodies of all notification methods defined in notifications. Thus, the bodies of all notification methods defined in
the base class `Arr_observer` are empty. A concrete observer that the base class `Aos_observer` are empty. A concrete observer that
inherits from `Arr_observer` needs to override only the relevant inherits from `Aos_observer` needs to override only the relevant
notification methods. The remaining methods are invoked when notification methods. The remaining methods are invoked when
corresponding changes occur, but they do nothing. corresponding changes occur, but they do nothing.
@ -5877,12 +5883,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
@ -6102,7 +6108,7 @@ ovl_traits)`\endlink constructs the arrangement `arr_o`, which is the
overlay of two input arrangement `arr_r` and `arr_b`. All three overlay of two input arrangement `arr_r` and `arr_b`. All three
arrangements must use the same geometric primitives. In other words, arrangements must use the same geometric primitives. In other words,
their types are instances of the `Arrangement_2<Traits,Dcel>` class their types are instances of the `Arrangement_2<Traits,Dcel>` class
template, where the `Traits` parameter is substituted with three template, where the `Traits` parameter is substituted by three
geometry-traits classes, respectively. The geometry-traits classes of geometry-traits classes, respectively. The geometry-traits classes of
the input arrangements must be convertible to the geometry-traits the input arrangements must be convertible to the geometry-traits
class of the resulting arrangement.\cgalFootnote{It is sufficient that class of the resulting arrangement.\cgalFootnote{It is sufficient that
@ -6111,17 +6117,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}
@ -6163,7 +6169,7 @@ arrangement that results from overlaying two face-extended
arrangements typically also stores additional data-fields with its arrangements typically also stores additional data-fields with its
faces. The types of such arrangements, for example, could be instances faces. The types of such arrangements, for example, could be instances
of the `Arrangement_2<Traits,Dcel>` class template, where the `Dcel` of the `Arrangement_2<Traits,Dcel>` class template, where the `Dcel`
parameters are substituted with instances of the parameters are substituted by instances of the
`Arr_face_extended_dcel` class template (see Section \ref `Arr_face_extended_dcel` class template (see Section \ref
arr_sssecex_dcel_face). The data field that is attached to an overlay arr_sssecex_dcel_face). The data field that is attached to an overlay
face can be computed from the data fields of the two faces (in `arr_r` face can be computed from the data fields of the two faces (in `arr_r`
@ -6173,7 +6179,7 @@ data fields with all their \dcel records typically also stores
additional data-fields with all its \dcel records. The types of additional data-fields with all its \dcel records. The types of
such arrangements, for example, could be instances of the such arrangements, for example, could be instances of the
`Arrangement_2<Traits,Dcel>` class template, where the `Dcel` `Arrangement_2<Traits,Dcel>` class template, where the `Dcel`
parameters are substituted with instances of the `Arr_extended_dcel` parameters are substituted by instances of the `Arr_extended_dcel`
class template (see Section \ref arr_sssecex_dcel_all). The data field class template (see Section \ref arr_sssecex_dcel_all). The data field
attached to an overlay feature can be computed from the data fields of attached to an overlay feature can be computed from the data fields of
the two features (in `arr_r` and `arr_b`) that induce the overlay the two features (in `arr_r` and `arr_b`) that induce the overlay
@ -6188,7 +6194,7 @@ of the overlay traits can be an instance of the class template
`Arr_face_overlay_traits<ArrangementR,ArrangementB,ArrangementO,OverlayFaceData>`, `Arr_face_overlay_traits<ArrangementR,ArrangementB,ArrangementO,OverlayFaceData>`,
which models the concept `OverlayTraits`. An object of this type which models the concept `OverlayTraits`. An object of this type
operates on face-extended arrangements. When instantiated, the operates on face-extended arrangements. When instantiated, the
`OverlayFaceData` parameter must be substituted with a functor that is `OverlayFaceData` parameter must be substituted by a functor that is
capable of combining two face-data fields of types capable of combining two face-data fields of types
`ArrangementR::Dcel::Face_data` and `ArrangementB::Dcel::Face_data` `ArrangementR::Dcel::Face_data` and `ArrangementB::Dcel::Face_data`
and computing the output `ArrangementO::Dcel::Face_data` object. The and computing the output `ArrangementO::Dcel::Face_data` object. The
@ -6203,7 +6209,7 @@ flag. A polygon is represented as a <em>marked</em> arrangement face
(whose flag is set). The example uses an instance of the (whose flag is set). The example uses an instance of the
`Arr_face_overlay_traits<ArrR,ArrB,ArrO,OverlayFaceData>` class `Arr_face_overlay_traits<ArrR,ArrB,ArrO,OverlayFaceData>` class
template as the face-overlay traits class where the `OverlayFaceData` template as the face-overlay traits class where the `OverlayFaceData`
template parameter is substituted with a functor that simply performs template parameter is substituted by a functor that simply performs
a logical <em>and</em> operation on Boolean flags. As a result, a face a logical <em>and</em> operation on Boolean flags. As a result, a face
in the overlay arrangement is marked only when it corresponds to an in the overlay arrangement is marked only when it corresponds to an
overlapping region of two marked faces in the input overlapping region of two marked faces in the input
@ -6401,12 +6407,12 @@ between these curves and the arrangement edges they induce. Similarly,
the `Arrangement_with_history_2<GeometryTraits,Dcel>` class-template the `Arrangement_with_history_2<GeometryTraits,Dcel>` class-template
extends the `Arrangement_2<GeometryTraits,Dcel>` class template. The extends the `Arrangement_2<GeometryTraits,Dcel>` class template. The
`GeometryTraits` template parameter, of either class templates, must `GeometryTraits` template parameter, of either class templates, must
be substituted with a model of the `ArrangementTraits_2` concept; see be substituted by a model of the `ArrangementTraits_2` concept; see
Section \ref aos_ssec-insert_gen. It should define the \link Section \ref aos_ssec-insert_gen. It should define the \link
ArrangementTraits_2::Curve_2 `Curve_2`\endlink type and support its ArrangementTraits_2::Curve_2 `Curve_2`\endlink type and support its
subdivision into \link ArrangementBasicTraits_2::X_monotone_curve_2 subdivision into \link ArrangementBasicTraits_2::X_monotone_curve_2
`X_monotone_curve_2`\endlink objects, among the others. The `Dcel` `X_monotone_curve_2`\endlink objects, among the others. The `Dcel`
parameter must be substituted with a model of the `ArrangementDcel` parameter must be substituted by a model of the `ArrangementDcel`
concept. You can use either the default \dcel class or an extended concept. You can use either the default \dcel class or an extended
\dcel class (see Section \ref arr_ssecex_dcel) based on your needs. An \dcel class (see Section \ref arr_ssecex_dcel) based on your needs. An
arrangement that support the cross-mapping mentioned above is referred arrangement that support the cross-mapping mentioned above is referred
@ -6483,7 +6489,7 @@ iterators is \link Arrangement_with_history_2::Curve_2
Overlaying two arrangement-with-history objects is possible only if Overlaying two arrangement-with-history objects is possible only if
their types are instances of the their types are instances of the
`Arrangement_with_history_2<Traits,Dcel>` class template, where the `Arrangement_with_history_2<Traits,Dcel>` class template, where the
respective `Traits` parameters are substituted with two traits classes respective `Traits` parameters are substituted by two traits classes
that are convertible to one another. In this case, the resulting that are convertible to one another. In this case, the resulting
arrangement stores a consolidated container of input curves, and arrangement stores a consolidated container of input curves, and
automatically preserves the cross-mapping between the arrangement automatically preserves the cross-mapping between the arrangement
@ -6663,15 +6669,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`
@ -6968,7 +6974,7 @@ algorithm on a dual arrangement. It uses the functor template
information stored inside the faces. The functor implements a property information stored inside the faces. The functor implements a property
map that utilizes the `data()` and `set_data()` member functions of the map that utilizes the `data()` and `set_data()` member functions of the
extended face to update or obtain the property. When the property map extended face to update or obtain the property. When the property map
is instantiated, the `Type` parameter must be substituted with the is instantiated, the `Type` parameter must be substituted by the
same type that is used to extend the arrangement face; see Section same type that is used to extend the arrangement face; see Section
\ref arr_sssecex_dcel_face. The functor template is defined in the \ref arr_sssecex_dcel_face. The functor template is defined in the
header file `Extended_face_property_map.h` listed below. header file `Extended_face_property_map.h` listed below.

View File

@ -0,0 +1,424 @@
namespace CGAL {
/*! \ingroup PkgArrangementOnSurface2Ref
*
* \anchor arr_refaos_obs
*
* `Aos_observer` serves as an abstract base class for all observer classes that
* are attached to an arrangement instance of type `Arrangement` and receive
* notifications from the arrangement. This base class handles the attachment
* of the observer to a given arrangement instance or to the detachment of the
* observer from this arrangement instance. It also gives a default empty
* implementation to all notification functions that are invoked by the
* arrangement to notify the observer on local or global changes it undergoes.
* The notification functions are all virtual functions, so they can be
* overridden by the concrete observer classes that inherit from `Aos_observer`.
*
* In order to implement a concrete arrangement observer-class, one simply needs
* to derive from `Aos_observer` and override the relevant notification
* functions. For example, if only face-split events are of interest, it is
* sufficient to override just `before_split_face()` (or just
* `after_split_face()`).
*/
template <typename Arrangement>
class Aos_observer {
public:
/// \name Types
/// @{
//! the type of the associated arrangement.
typedef unspecified_type Arrangement_2;
//! the point type.
typedef typename Arrangement_2::Point_2 Point_2;
//! the \f$x\f$-monotone curve type.
typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2;
//! the type of a handle to an arrangement vertex.
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
//! the type of a handle to an arrangement halfedge.
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
//! the type of a handle to an arrangement face.
typedef typename Arrangement_2::Face_handle Face_handle;
/*! represents a connected component of the boundary (CCB), either an outer
* boundary or an inner boundary (the latter is also referred to as a hole).
*/
typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator;
/// @}
/// \name Creation
/// @{
/*! constructs an observer that is unattached to any arrangement instance. */
Aos_observer();
/*! constructs an observer and attaches it to the given arrangement `arr`. */
Aos_observer(Arrangement_2& arr);
/// @}
/// \name Modifiers
/// @{
/*! attaches the observer to the given arrangement `arr`. */
void attach(Arrangement_2& arr);
/*! detaches the observer from its arrangement. */
void detach();
/// @}
/// \name Notifications on Global Arrangement Operations
/// @{
/*! issued just before the attached arrangement is assigned with the contents of another
* arrangement.
* \param arr The other arrangement. Notice that the arrangement type is the type used to
* instantiate the observer, which is conveniently defined as
* `Arrangement_2::Base_aos`.
*/
virtual void before_assign(const typename Arrangement_2::Base_aos& arr);
/*! issued immediately after the attached arrangement has been assigned with
* the contents of another arrangement.
*/
virtual void after_assign();
/*! issued just before the attached arrangement is cleared. */
virtual void before_clear();
/*! issued immediately after the attached arrangement has been cleared, so it
* now consists only of a the unbounded face `uf`.
*/
virtual void after_clear(Face_handle uf);
/*! issued just before a global function starts to modify the attached
* arrangement. It is guaranteed that no queries (especially no point-location
* queries) are issued until the termination of the global function is
* indicated by `after_global_change()`.
*/
virtual void before_global_change();
/*!
issued immediately after a global function has stopped modifying the
attached arrangement.
*/
virtual void after_global_change();
/// @}
/// \name Notifications on Attachment or Detachment
/// @{
/*! issued just before the observer is attached to the arrangement instance
* `arr`.
* \param arr The arrangement that is about to attach the observer. Notice
* that the arrangement type is the type used to instantiate the
* observer, which is conveniently defined as
* `Arrangement_2::Base_aos`.
*/
virtual void before_attach(const typename Arrangement_2::Base_aos& arr);
/*! issued immediately after the observer has been attached to an arrangement
* instance.
*/
virtual void after_attach();
/*! issued just before the observer is detached from its arrangement instance.
*/
virtual void before_detach();
/*! issued immediately after the observer has been detached from its
* arrangement instance.
*/
virtual void after_detach();
/// @}
/// \name Notifications on Local Changes in the Arrangement
/// @{
/*! issued just before a new vertex that corresponds to the point `p` is
* created.
*/
virtual void before_create_vertex(const Point_2& p);
/*! issued immediately after a new vertex `v` has been created. Note that the
* vertex still has no incident edges and is not connected to any other vertex.
*/
virtual void after_create_vertex(Vertex_handle v);
/*! issued just before a new vertex at infinity is created, `cv` is the curve
* incident to the surface boundary, `ind` is the relevant curve-end, `ps_x`
* is the boundary condition of the vertex in \f$x\f$ and `ps_y` is the
* boundary condition of the vertex in \f$y\f$.
*/
virtual void before_create_boundary_vertex(const X_monotone_curve_2& cv,
Arr_curve_end ind,
Arr_parameter_space ps_x,
Arr_parameter_space ps_y);
/*! issued immediately after a new vertex `v` has been created. Note that the
* vertex still has no incident edges and is not connected to any other vertex.
*/
virtual void after_create_boundary_vertex(Vertex_handle v);
/*! issued just before a new edge that corresponds to the \f$x\f$-monotone
* curve `c` and connects the vertices `v1` and `v2` is created.
*/
virtual void before_create_edge(const X_monotone_curve_2& c,
Vertex_handle v1, Vertex_handle v2);
/*! issued immediately after a new edge `e` has been created. The halfedge
* that is sent to this function is always directed from `v1` to `v2` (see
* `before_create_edge()`).
*/
virtual void after_create_edge(Halfedge_handle e);
/*! issued just before a vertex `v` is modified to be associated with the point
* `p`.
*/
virtual void before_modify_vertex(Vertex_handle v, const Point_2& p);
/*! issued immediately after an existing vertex `v` has been modified. */
virtual void after_modify_vertex(Vertex_handle v);
/*! issued just before an edge `e` is modified to be associated with the
* \f$x\f$-monotone curve `c`.
*/
virtual void before_modify_edge(Halfedge_handle e,
const X_monotone_curve_2& c);
/*! issued immediately after an existing edge `e` has been modified. */
virtual void after_modify_edge(Halfedge_handle e);
/*! issued just before an edge `e` is split into two edges that should be
* associated with the \f$x\f$-monotone curves `c1` and `c2`. The vertex `v`
* corresponds to the split point, and will be used to separate the two
* resulting edges.
*/
virtual void before_split_edge(Halfedge_handle e, Vertex_handle v,
const X_monotone_curve_2& c1,
const X_monotone_curve_2& c2);
/*! issued immediately after an existing edge has been split into the two
* given edges `e1` and `e2`.
*/
virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2);
/*! issued just before a fictitious edge `e` is split into two. The vertex at
* infinity `v` corresponds to the split point, and will be used to separate
* the two resulting edges.
*/
virtual void before_split_fictitious_edge(Halfedge_handle e, Vertex_handle v);
/*! issued immediately after an existing fictitious edge has been split into
* the two given fictitious edges `e1` and `e2`.
*/
virtual void after_split_fictitious_edge(Halfedge_handle e1,
Halfedge_handle e2);
/*! issued just before a face `f` is split into two, as a result of the
* insertion of the edge `e` into the arrangement.
*/
virtual void before_split_face(Face_handle f, Halfedge_handle e);
/*! issued immediately after the existing face `f1` has been split, such that
* a portion of it now forms a new face `f2`. The flag `is_hole` designates
* whether `f2` forms a hole (an inner CCB) inside `f1`.
*/
virtual void after_split_face(Face_handle f1, Face_handle f2, bool is_hole);
/*! issued just before outer CCB `h` inside a face `f` is split into two, as a
* result of the removal of the edge `e` from the arrangement.
*/
virtual void before_split_outer_ccb(Face_handle f, Ccb_halfedge_circulator h,
Halfedge_handle e);
/*! issued immediately after an outer CCB of the face `f` has been split,
* resulting in the two holes `h1` and `h2`.
*/
virtual void after_split_outer_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2);
/*! issued just before an inner CCB `h` inside a face `f` is split into two,
* as a result of the removal of the edge `e` from the arrangement.
*/
virtual void before_split_inner_ccb(Face_handle f, Ccb_halfedge_circulator h,
Halfedge_handle e);
/*! issued immediately after an inner CCB of the face `f` has been split,
* resulting in the two inner CCBs (holes) `h1` and `h2`.
*/
virtual void after_split_inner_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2);
/*! issued just before the edge `e` is inserted as a new outer CCB inside the
* face `f`.
*/
virtual void before_add_outer_ccb(Face_handle f, Halfedge_handle e);
/*! issued immediately after a new outer ccb `h` has been created. The outer
* ccb always consists of a single pair of twin halfedges.
*/
virtual void after_add_outer_ccb(Ccb_halfedge_circulator h);
/*! issued just before the edge `e` is inserted as a new inner CCB inside the
* face `f`.
*/
virtual void before_add_inner_ccb(Face_handle f, Halfedge_handle e);
/*! issued immediately after a new inner CCB `h` has been created. The inner
* CCB always consists of a single pair of twin halfedges.
*/
virtual void after_add_inner_ccb(Ccb_halfedge_circulator h);
/*! issued just before the vertex `v` is inserted as an isolated vertex inside
* the face `f`.
*/
virtual void before_add_isolated_vertex(Face_handle f, Vertex_handle v);
/*! issued immediately after the vertex `v` has been set as an isolated vertex.
*/
virtual void after_add_isolated_vertex(Vertex_handle v);
/*! issued just before the two edges `e1` and `e2` are merged to form a single
* edge that will be associated with the \f$x\f$-monotone curve `c`.
*/
virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2,
const X_monotone_curve_2& c);
/*! issued immediately after two edges have been merged to form the edge `e`.
*/
virtual void after_merge_edge(Halfedge_handle e);
/*! issued just before the two fictitious edges `e1` and `e2` are merged to
* form a single fictitious edge.
*/
virtual void before_merge_fictitious_edge(Halfedge_handle e1,
Halfedge_handle e2);
/*! issued immediately after two fictitious edges have been merged to form the
* fictitious edge `e`.
*/
virtual void after_merge_fictitious_edge(Halfedge_handle e);
/*! issued just before the two edges `f1` and `f2` are merged to form a single
* face, following the removal of the edge `e` from the arrangement.
*/
virtual void before_merge_face(Face_handle f1, Face_handle f2,
Halfedge_handle e);
/*! issued immediately after two faces have been merged to form the face `f`.
*/
virtual void after_merge_face(Face_handle f);
/*! issued just before two outer ccbs `h1` and `h2` inside the face `f` are
* merged to form a single connected component, following the insertion of the
* edge `e` into the arrangement.
*/
virtual void before_merge_outer_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2,
Halfedge_handle e);
/*! issued immediately after two outer cCBs have been merged to form a single
* outer CCB `h` inside the face `f`.
*/
virtual void after_merge_outer_ccb(Face_handle f, Ccb_halfedge_circulator h);
/*! issued just before two inner CCBs `h1` and `h2` inside the face `f` are
* merged to form a single connected component, following the insertion of the
* edge `e` into the arrangement.
*/
virtual void before_merge_inner_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2,
Halfedge_handle e);
/*! issued immediately after two inner CCBs have been merged to form a single
* inner CCB `h` inside the face `f`.
*/
virtual void after_merge_inner_ccb(Face_handle f, Ccb_halfedge_circulator h);
/*! issued just before the outer CCB `h` is moved from one face to another.
* This can happen if the face `to_f` containing the outer CCB has just been
* split from `from_f`.
*/
virtual void before_move_outer_ccb(Face_handle from_f, Face_handle to_f,
Ccb_halfedge_circulator h);
/*! issued immediately after the outer CCB `h` has been moved to a new face.
*/
virtual void after_move_outer_ccb(Ccb_halfedge_circulator h);
/*! issued just before the inner CCB `h` is moved from one face to another.
* This can happen if the face `to_f` containing the inner CCB has just been
* split from `from_f`.
*/
virtual void before_move_inner_ccb(Face_handle from_f, Face_handle to_f,
Ccb_halfedge_circulator h);
/*! issued immediately after the inner CCB `h` has been moved to a new face.
*/
virtual void after_move_inner_ccb(Ccb_halfedge_circulator h);
/*! issued just before the isolated vertex `v` is moved from one face to
* another. This can happen if the face `to_f` containing the isolated vertex
* has just been split from `from_f`.
*/
virtual void before_move_isolated_vertex(Face_handle from_f,
Face_handle to_f, Vertex_handle v);
/*! issued immediately after the isolated vertex `v` has been moved to a new
* face.
*/
virtual void after_move_isolated_vertex(Vertex_handle v);
/*! issued just before the vertex `v` is removed from the arrangement. */
virtual void before_remove_vertex(Vertex_handle v);
/*! issued immediately after a vertex has been removed (and deleted) from the
* arrangement.
*/
virtual void after_remove_vertex();
/*! issued just before the edge `e` is removed from the arrangement. */
virtual void before_remove_edge(Halfedge_handle e);
/*! issued immediately after an edge has been removed (and deleted) from the
* arrangement.
*/
virtual void after_remove_edge();
/*! issued just before the outer ccb `f` is removed from inside the face `f`.
*/
virtual void before_remove_outer_ccb(Face_handle f, Ccb_halfedge_circulator h);
/*! issued immediately after a outer CCB has been removed (and deleted) from
* inside the face `f`.
*/
virtual void after_remove_outer_ccb(Face_handle f);
/*! issued just before the inner CCB `f` is removed from inside the face `f`.
*/
virtual void before_remove_inner_ccb(Face_handle f,
Ccb_halfedge_circulator h);
/*! issued immediately after a inner CCB has been removed (and deleted) from
* inside the face `f`.
*/
virtual void after_remove_inner_ccb(Face_handle f);
/// @}
}; /* end Aos_observer */
} /* end namespace CGAL */

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 by
* 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 by
* 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 * by 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`,
* `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> using Arr_default_dcel = Arr_dcel<Traits>;
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>`
*/
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 */
} /* end namespace CGAL */ } /* end namespace CGAL */

View File

@ -1,77 +1,69 @@
namespace CGAL { namespace CGAL {
/*! /*! \ingroup PkgArrangementOnSurface2Ref
\ingroup PkgArrangementOnSurface2Ref *
* `Arr_face_index_map` maintains a mapping of face handles of an attached
* arrangement object to indices (of type `unsigned int`). This class template
* is a model of the concept `ReadablePropertyMap`. A mapping between face
* handles and indices enables convenient usage of property-map classes supplied
* by `boost`. For example, the property-map class templates
* `boost::vector_property_map`, which is based on `std::vector`, and
* `boost::iterator_property_map`, which can be used to implement a property map
* based on a native \CC array, require the user to supply a mapping such as
* `Arr_face_index_map`.
*
* As new faces might be inserted into the attached arrangement, and
* existing faces might be removed, the notification mechanism is used
* to dynamically maintain the mapping of face handles to indices.
*
* \cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap}
*
* \sa `Arr_vertex_index_map<Arrangement>`
*/
`Arr_face_index_map` maintains a mapping of face handles of an template <typename Arrangement_>
attached arrangement object to indices (of type `unsigned int`). class Arr_face_index_map: public Arrangement_::Observer {
This class template is a model of the concept public:
`ReadablePropertyMap`. A mapping between face handles and indices
enables convenient usage of property-map classes supplied by `boost`.
For example, the property-map class templates
`boost::vector_property_map`, which is based on `std::vector`,
and `boost::iterator_property_map`, which can be used to implement
a property map based on a native \CC array, require the
user to supply a mapping such as `Arr_face_index_map`.
As new faces might be inserted into the attached arrangement, and /// \name Types
existing faces might be removed, the notification mechanism is used /// @{
to dynamically maintain the mapping of face handles to indices.
/*! the type of the attached arrangement.
*/
typedef Arrangement_ Arrangement_2;
typedef typename Arrangement_2::Base_aos Base_aos;
\cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} typedef boost::readable_property_map_tag category;
\sa `Arr_observer<Arrangement>` typedef unsigned int value_type;
\sa `Arr_vertex_index_map<Arrangement>`
*/
template< typename Arrangement > typedef unsigned int reference;
class Arr_face_index_map: public Arr_observer<Arrangement> {
public:
/// \name Types typedef Face_handle key_type;
/// @{
/*! /*! The face handle type.
the type of the attached arrangement. */
*/ typedef typename Base_aos::Face_handle Face_handle;
typedef Arrangement Arrangement_2;
typedef boost::readable_property_map_tag category; /*! The type of mapping of faces to indices.
*/
typedef Unique_hash_map<Face_handle, value_type> Index_map;
typedef unsigned int value_type; /// @}
typedef unsigned int reference; /// \name Creation
/// @{
typedef Face_handle key_type; /*! constructs a map that is unattached to any arrangement instance.
*/
Arr_face_index_map();
/*! /*! constructs a map and attaches it to the given arrangement `arr`.
The face handle type. */
*/ Arr_face_index_map(Base_aos& arr);
typedef typename Arrangement_2::Face_handle Face_handle;
/*! /// @}
The type of mapping of faces to indices.
*/
typedef Unique_hash_map<Face_handle, value_type> Index_map;
/// @} }; /* end Arr_accessor */
/// \name Creation
/// @{
/*!
constructs a map that is unattached to any arrangement instance.
*/
Arr_face_index_map();
/*!
constructs a map and attaches it to the given arrangement `arr`.
*/
Arr_face_index_map(Arrangement_2& arr);
/// @}
}; /* end Arr_accessor */
} /* 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

@ -2,408 +2,14 @@ namespace CGAL {
/*! \ingroup PkgArrangementOnSurface2Ref /*! \ingroup PkgArrangementOnSurface2Ref
* *
* \anchor arr_refarr_obs * `Arr_observer<Arrangement_2>` is an alias for
* * Aos_observer<Arrangement_on_surface_2>`,
* `Arr_observer` serves as an abstract base class for all observer classes that * where `Arrangement_2` derives from `Arrangement_on_surface_2` and the latter
* are attached to an arrangement instance of type `Arrangement` and receive * is an instance of the template
* notifications from the arrangement. This base class handles the attachment * `CGAL::Arrangement_on_surface_2<GeometryTraits, TopologyTraits>`.
* of the observer to a given arrangement instance or to the detachment of the
* observer from this arrangement instance. It also gives a default empty
* implementation to all notification functions that are invoked by the
* arrangement to notify the observer on local or global changes it undergoes.
* The notification functions are all virtual functions, so they can be
* overridden by the concrete observer classes that inherit from `Arr_observer`.
*
* In order to implement a concrete arrangement observer-class, one simply needs
* to derive from `Arr_observer` and override the relevant notification
* functions. For example, if only face-split events are of interest, it is
* sufficient to override just `before_split_face()` (or just
* `after_split_face()`).
*/ */
template< typename Arrangement >
class Arr_observer {
public:
/// \name Types template <typename Arrangement_>
/// @{ using Arr_observer = typename Arrangement_::Observer;
/*! the type of the associated arrangement. */ } // namespace CGAL
typedef unspecified_type Arrangement_2;
/*! the point type. */
typedef typename Arrangement_2::Point_2 Point_2;
/*! the \f$ x\f$-monotone curve type. */
typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2;
/*! */
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
/*! */
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
/*! */
typedef typename Arrangement_2::Face_handle Face_handle;
/*! represents a connected component of the boundary (CCB), either an outer
* boundary or an inner boundary (the latter is also referred to as a hole).
*/
typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator;
/// @}
/// \name Creation
/// @{
/*! constructs an observer that is unattached to any arrangement instance. */
Arr_observer();
/*! constructs an observer and attaches it to the given arrangement `arr`. */
Arr_observer(Arrangement_2& arr);
/// @}
/// \name Modifiers
/// @{
/*! attaches the observer to the given arrangement `arr`. */
void attach(Arrangement_2& arr);
/*! detaches the observer from its arrangement. */
void detach();
/// @}
/// \name Notifications on Global Arrangement Operations
/// @{
/*! issued just before the attached arrangement is assigned with the contents of
* another arrangement `arr`.
*/
virtual void before_assign(const Arrangement_2& arr);
/*! issued immediately after the attached arrangement has been assigned with the
* contents of another arrangement.
*/
virtual void after_assign();
/*! issued just before the attached arrangement is cleared. */
virtual void before_clear();
/*! issued immediately after the attached arrangement has been cleared, so it
* now consists only of a the unbounded face `uf`.
*/
virtual void after_clear(Face_handle uf);
/*! issued just before a global function starts to modify the attached
* arrangement. It is guaranteed that no queries (especially no point-location
* queries) are issued until the termination of the global function is indicated
* by `after_global_change()`.
*/
virtual void before_global_change();
/*!
issued immediately after a global function has stopped modifying the
attached arrangement.
*/
virtual void after_global_change();
/// @}
/// \name Notifications on Attachment or Detachment
/// @{
/*! issued just before the observer is attached to the arrangement instance
* `arr`.
*/
virtual void before_attach(const Arrangement_2& arr);
/*! issued immediately after the observer has been attached to an arrangement
* instance.
*/
virtual void after_attach();
/*! issued just before the observer is detached from its arrangement instance.
*/
virtual void before_detach();
/*! issued immediately after the observer has been detached from its arrangement
* instance.
*/
virtual void after_detach();
/// @}
/// \name Notifications on Local Changes in the Arrangement
/// @{
/*! issued just before a new vertex that corresponds to the point `p` is
* created.
*/
virtual void before_create_vertex(const Point_2& p);
/*! issued immediately after a new vertex `v` has been created. Note that the
* vertex still has no incident edges and is not connected to any other vertex.
*/
virtual void after_create_vertex(Vertex_handle v);
/*! issued just before a new vertex at infinity is created, `cv` is the curve
* incident to the surface boundary, `ind` is the relevant curve-end, `ps_x` is
* the boundary condition of the vertex in \f$ x\f$ and `ps_y` is the boundary
* condition of the vertex in \f$ y\f$.
*/
virtual void before_create_boundary_vertex(const X_monotone_curve_2& cv,
Arr_curve_end ind,
Arr_parameter_space ps_x,
Arr_parameter_space ps_y);
/*! issued immediately after a new vertex `v` has been created. Note that the
* vertex still has no incident edges and is not connected to any other vertex.
*/
virtual void after_create_boundary_vertex(Vertex_handle v);
/*! issued just before a new edge that corresponds to the \f$ x\f$-monotone
* curve `c` and connects the vertices `v1` and `v2` is created.
*/
virtual void before_create_edge(const X_monotone_curve_2& c,
Vertex_handle v1, Vertex_handle v2);
/*! issued immediately after a new edge `e` has been created. The halfedge that
* is sent to this function is always directed from `v1` to `v2` (see above).
*/
virtual void after_create_edge(Halfedge_handle e);
/*! issued just before a vertex `v` is modified to be associated with the point
* `p`.
*/
virtual void before_modify_vertex(Vertex_handle v, const Point_2& p);
/*! issued immediately after an existing vertex `v` has been modified. */
virtual void after_modify_vertex(Vertex_handle v);
/*! issued just before an edge `e` is modified to be associated with the \f$
* x\f$-monotone curve `c`.
*/
virtual void before_modify_edge(Halfedge_handle e, const X_monotone_curve_2& c);
/*! issued immediately after an existing edge `e` has been modified. */
virtual void after_modify_edge(Halfedge_handle e);
/*! issued just before an edge `e` is split into two edges that should be
* associated with the \f$ x\f$-monotone curves `c1` and `c2`. The vertex `v`
* corresponds to the split point, and will be used to separate the two
* resulting edges.
*/
virtual void before_split_edge(Halfedge_handle e, Vertex_handle v,
const X_monotone_curve_2& c1,
const X_monotone_curve_2& c2);
/*! issued immediately after an existing edge has been split into the two given
* edges `e1` and `e2`.
*/
virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2);
/*! issued just before a fictitious edge `e` is split into two. The vertex at
* infinity `v` corresponds to the split point, and will be used to separate the
* two resulting edges.
*/
virtual void before_split_fictitious_edge(Halfedge_handle e, Vertex_handle v);
/*! issued immediately after an existing fictitious edge has been split into the
* two given fictitious edges `e1` and `e2`.
*/
virtual void after_split_fictitious_edge(Halfedge_handle e1, Halfedge_handle e2);
/*! issued just before a face `f` is split into two, as a result of the
* insertion of the edge `e` into the arrangement.
*/
virtual void before_split_face(Face_handle f, Halfedge_handle e);
/*! issued immediately after the existing face `f1` has been split, such that a
* portion of it now forms a new face `f2`. The flag `is_hole` designates
* whether `f2` forms a hole (an inner CCB) inside `f1`.
*/
virtual void after_split_face(Face_handle f1, Face_handle f2, bool is_hole);
/*! issued just before outer ccb `h` inside a face `f` is split into two, as a
* result of the removal of the edge `e` from the arrangement.
*/
virtual void before_split_outer_ccb(Face_handle f, Ccb_halfedge_circulator h,
Halfedge_handle e);
/*! issued immediately after an outer ccb of the face `f` has been split,
* resulting in the two holes `h1` and `h2`.
*/
virtual void after_split_outer_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2);
/*! issued just before an inner ccb `h` inside a face `f` is split into two, as
* a result of the removal of the edge `e` from the arrangement.
*/
virtual void before_split_inner_ccb(Face_handle f, Ccb_halfedge_circulator h,
Halfedge_handle e);
/*! issued immediately after an inner ccb of the face `f` has been split,
* resulting in the two inner CCBs (holes) `h1` and `h2`.
*/
virtual void after_split_inner_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2);
/*! issued just before the edge `e` is inserted as a new outer ccb inside the
* face `f`.
*/
virtual void before_add_outer_ccb(Face_handle f, Halfedge_handle e);
/*! issued immediately after a new outer ccb `h` has been created. The outer ccb
* always consists of a single pair of twin halfedges.
*/
virtual void after_add_outer_ccb(Ccb_halfedge_circulator h);
/*! issued just before the edge `e` is inserted as a new inner ccb inside the
* face `f`.
*/
virtual void before_add_inner_ccb(Face_handle f, Halfedge_handle e);
/*! issued immediately after a new inner ccb `h` has been created. The inner ccb
* always consists of a single pair of twin halfedges.
*/
virtual void after_add_inner_ccb(Ccb_halfedge_circulator h);
/*! issued just before the vertex `v` is inserted as an isolated vertex inside
* the face `f`.
*/
virtual void before_add_isolated_vertex(Face_handle f, Vertex_handle v);
/*! issued immediately after the vertex `v` has been set as an isolated vertex.
*/
virtual void after_add_isolated_vertex(Vertex_handle v);
/*! issued just before the two edges `e1` and `e2` are merged to form a single
* edge that will be associated with the \f$ x\f$-monotone curve `c`.
*/
virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2,
const X_monotone_curve_2& c);
/*! issued immediately after two edges have been merged to form the edge `e`. */
virtual void after_merge_edge(Halfedge_handle e);
/*! issued just before the two fictitious edges `e1` and `e2` are merged to form
* a single fictitious edge.
*/
virtual void before_merge_fictitious_edge(Halfedge_handle e1,
Halfedge_handle e2);
/*! issued immediately after two fictitious edges have been merged to form the
* fictitious edge `e`.
*/
virtual void after_merge_fictitious_edge(Halfedge_handle e);
/*! issued just before the two edges `f1` and `f2` are merged to form a single
* face, following the removal of the edge `e` from the arrangement.
*/
virtual void before_merge_face(Face_handle f1, Face_handle f2,
Halfedge_handle e);
/*! issued immediately after two faces have been merged to form the face `f`. */
virtual void after_merge_face(Face_handle f);
/*! issued just before two outer ccbs `h1` and `h2` inside the face `f` are
* merged to form a single connected component, following the insertion of the
* edge `e` into the arrangement.
*/
virtual void before_merge_outer_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2,
Halfedge_handle e);
/*! issued immediately after two outer ccbs have been merged to form a single
* outer ccb `h` inside the face `f`.
*/
virtual void after_merge_outer_ccb(Face_handle f, Ccb_halfedge_circulator h);
/*! issued just before two inner ccbs `h1` and `h2` inside the face `f` are
* merged to form a single connected component, following the insertion of the
* edge `e` into the arrangement.
*/
virtual void before_merge_inner_ccb(Face_handle f,
Ccb_halfedge_circulator h1,
Ccb_halfedge_circulator h2,
Halfedge_handle e);
/*! issued immediately after two inner ccbs have been merged to form a single
* inner ccb `h` inside the face `f`.
*/
virtual void after_merge_inner_ccb(Face_handle f, Ccb_halfedge_circulator h);
/*! issued just before the outer ccb `h` is moved from one face to another.
* This can happen if the face `to_f` containing the outer ccb has just been
* split from `from_f`.
*/
virtual void before_move_outer_ccb(Face_handle from_f, Face_handle to_f,
Ccb_halfedge_circulator h);
/*! issued immediately after the outer ccb `h` has been moved to a new face. */
virtual void after_move_outer_ccb(Ccb_halfedge_circulator h);
/*! issued just before the inner ccb `h` is moved from one face to another.
* This can happen if the face `to_f` containing the inner ccb has just been
* split from `from_f`.
*/
virtual void before_move_inner_ccb(Face_handle from_f, Face_handle to_f,
Ccb_halfedge_circulator h);
/*! issued immediately after the inner ccb `h` has been moved to a new face. */
virtual void after_move_inner_ccb(Ccb_halfedge_circulator h);
/*! issued just before the isolated vertex `v` is moved from one face to
* another. This can happen if the face `to_f` containing the isolated vertex
* has just been split from `from_f`.
*/
virtual void before_move_isolated_vertex(Face_handle from_f,
Face_handle to_f, Vertex_handle v);
/*! issued immediately after the isolated vertex `v` has been moved to a new
* face.
*/
virtual void after_move_isolated_vertex(Vertex_handle v);
/*! issued just before the vertex `v` is removed from the arrangement. */
virtual void before_remove_vertex(Vertex_handle v);
/*! issued immediately after a vertex has been removed (and deleted) from the
* arrangement.
*/
virtual void after_remove_vertex();
/*! issued just before the edge `e` is removed from the arrangement. */
virtual void before_remove_edge(Halfedge_handle e);
/*! issued immediately after an edge has been removed (and deleted) from the
* arrangement.
*/
virtual void after_remove_edge();
/*! issued just before the outer ccb `f` is removed from inside the face `f`. */
virtual void before_remove_outer_ccb(Face_handle f, Ccb_halfedge_circulator h);
/*! issued immediately after a outer ccb has been removed (and deleted) from
* inside the face `f`.
*/
virtual void after_remove_outer_ccb(Face_handle f);
/*! issued just before the inner ccb `f` is removed from inside the face `f`.
*/
virtual void before_remove_inner_ccb(Face_handle f,
Ccb_halfedge_circulator h);
/*! issued immediately after a inner ccb has been removed (and deleted) from
* inside the face `f`.
*/
virtual void after_remove_inner_ccb(Face_handle f);
/// @}
}; /* end Arr_observer */
} /* end namespace CGAL */

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 by
* 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 by
* 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

@ -1,7 +1,6 @@
namespace CGAL { namespace CGAL {
/*! /*! \ingroup PkgArrangementOnSurface2PointLocation
* \ingroup PkgArrangementOnSurface2PointLocation
* *
* \anchor arr_reftri_pl * \anchor arr_reftri_pl
* *
@ -23,7 +22,6 @@ namespace CGAL {
*/ */
template <typename Arrangement_> template <typename Arrangement_>
class Arr_triangulation_point_location : public Arr_observer<Arrangement_> class Arr_triangulation_point_location : public Arrangement_::Observer {}
{}
} }

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 by
* 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 by
* 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

@ -1,82 +1,69 @@
namespace CGAL { namespace CGAL {
/*! /*! \ingroup PkgArrangementOnSurface2Ref
\ingroup PkgArrangementOnSurface2Ref *
* `Arr_vertex_index_map` maintains a mapping of vertex handles of an attached
* arrangement object to indices (of type `unsigned int`). This class template
* is a model of the concept `ReadablePropertyMap`. A mapping between vertex
* handles and indices enables convenient usage of property-map classes supplied
* by `boost`. For example, the property-map class templates
* `boost::vector_property_map`, which is based on `std::vector`, and
* `boost::iterator_property_map`, which can be used to implement a property map
* based on a native \CC array, require the user to supply a mapping such as
* `Arr_vertex_index_map`.
*
* As new vertices might be inserted into the attached arrangement, and
* existing vertices might be removed, the notification mechanism is used
* to dynamically maintain the mapping of vertex handles to indices.
*
* \cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap}
*
* \sa `Arr_face_index_map<Arrangement>`
*/
`Arr_vertex_index_map` maintains a mapping of vertex handles of an template< typename Arrangement_>
attached arrangement object to indices (of type `unsigned int`). class Arr_vertex_index_map: public Arrangement_::Observer {
This class template is a model of the concept public:
`ReadablePropertyMap`. A mapping between vertex handles and indices
enables convenient usage of property-map classes supplied by `boost`.
For example, the property-map class templates
`boost::vector_property_map`, which is based on `std::vector`,
and `boost::iterator_property_map`, which can be used to implement
a property map based on a native \CC array, require the
user to supply a mapping such as `Arr_vertex_index_map`.
As new vertices might be inserted into the attached arrangement, and /// \name Types
existing vertices might be removed, the notification mechanism is used /// @{
to dynamically maintain the mapping of vertex handles to indices.
/*! the type of the attached arrangement.
*/
typedef Arrangement_ Arrangement_2;
typedef typename Arrangement_2::Base_aos Base_aos;
\cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} typedef boost::readable_property_map_tag category;
\sa `Arr_observer<Arrangement>` typedef unsigned int value_type;
\sa `Arr_face_index_map<Arrangement>`
*/
template< typename Arrangement > typedef unsigned int reference;
class Arr_vertex_index_map: public Arr_observer<Arrangement> {
public:
/// \name Types typedef Vertex_handle key_type;
/// @{
/*! /*! The vertex handle type.
the type of the attached arrangement. */
*/ typedef typename Base_aos::Vertex_handle Vertex_handle;
typedef Arrangement Arrangement_2;
typedef boost::readable_property_map_tag category; /*! The type of mapping of vertices to indices.
*/
typedef Unique_hash_map<Vertex_handle, value_type> Index_map;
typedef unsigned int value_type; /// @}
typedef unsigned int reference; /// \name Creation
/// @{
typedef Vertex_handle key_type; /*! constructs a map that is unattached to any arrangement instance.
*/
Arr_vertex_index_map();
/*! /*! constructs a map and attaches it to the given arrangement `arr`.
The vertex handle type. */
*/ Arr_vertex_index_map(Base_aos& arr);
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
/*! /// @}
The type of mapping of vertices to indices.
*/
typedef Unique_hash_map<Vertex_handle, value_type> Index_map;
/// @} }; /* end Arr_accessor */
/// \name Creation
/// @{
/*!
constructs a map that is unattached to any arrangement instance.
*/
Arr_vertex_index_map();
/*!
constructs a map and attaches it to the given arrangement `arr`.
*/
Arr_vertex_index_map(Arrangement_2& arr);
/// @}
}; /* end Arr_accessor */
} /* end namespace CGAL */ } /* end namespace CGAL */

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 by
* 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 by 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 by 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 by 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 by 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 by 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

@ -7,7 +7,7 @@
* associated with the landmark point-location strategy (see * associated with the landmark point-location strategy (see
* `CGAL::Arr_landmarks_point_location`) must be an instance of the * `CGAL::Arr_landmarks_point_location`) must be an instance of the
* `CGAL::Arrangement_2<Traits,Dcel>` class template, where the Traits parameter * `CGAL::Arrangement_2<Traits,Dcel>` class template, where the Traits parameter
* is substituted with a model of this concept. * is substituted by a model of this concept.
* *
* \cgalRefines{ArrangementApproximateTraits_2,ArrangementConstructXMonotoneCurveTraits_2} * \cgalRefines{ArrangementApproximateTraits_2,ArrangementConstructXMonotoneCurveTraits_2}
* *

View File

@ -199,11 +199,13 @@ implemented as peripheral classes or as free (global) functions.
- `CGAL::Arrangement_2<Traits,Dcel>` - `CGAL::Arrangement_2<Traits,Dcel>`
- `CGAL::Arrangement_with_history_2<Traits,Dcel>` - `CGAL::Arrangement_with_history_2<Traits,Dcel>`
- `CGAL::Arr_accessor<Arrangement>` - `CGAL::Arr_accessor<Arrangement>`
- `CGAL::Arr_observer<Arrangement>` - `CGAL::Aos_observer<ArrangementOnSurface_2>`
- `CGAL::Arr_observer<Arrangement_2>`
- `CGAL::Arrangement_2::Vertex` - `CGAL::Arrangement_2::Vertex`
- `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

@ -2,56 +2,62 @@
\input{header} \input{header}
\pagestyle{empty} \pagestyle{empty}
\begin{document} \begin{document}
\psscalebox{1.8}{\arrset{1}% \begin{tikzpicture}[scale=1]
\pspicture[](-1,-1)(8,7) \myAxes{-1}{-1}{8}{7}
\arraxes(0,0)(-1,-1)(8,7) \coordinate (a) at (0,0);
\arrMainVertex(0,0){1} \coordinate (b) at (0,3);
\arrMainVertex(0,3){2} \coordinate (d) at (2,3);
\arrEmptyVertex(1,3){3} \coordinate (j) at (4,3);
\arrMainVertex(2,3){4} \coordinate (l) at (5,3);
\arrMainVertex(2,6){5} %
\arrMainVertex(3,1){6} \arrMainVertexZ(a){1}
\arrEmptyVertex(3,3){7} \arrMainVertexZ(b){2}
\arrMainVertex(3,4){8} \arrIntersectionVertexZ(1,3){3}
\arrMainVertex(3,5){9} \arrMainVertexZ(d){4}
\arrMainVertex(4,3){10} \arrMainVertexZ(2,6){5}
\arrEmptyVertex(4,4){11} \arrMainVertexZ(3,1){6}
\arrMainVertex(5,3){12} \arrIntersectionVertexZ(3,3){7}
\arrMainVertex(6,4){13} \arrMainVertexZ(3,4){8}
\arrMainVertex(7,1){14} \arrMainVertexZ(3,5){9}
\arrCrossVertex(4,6){x1}\uput[-45]{0}(4,6){$q_1$} \arrMainVertexZ(j){10}
\arrCrossVertex(6,2){x2}\uput[45]{0}(6,2){$q_2$} \arrIntersectionVertexZ(4,4){11}
\arrCrossVertex(2,4){x3}\uput[45]{0}(2,4){$q_3$} \arrMainVertexZ(l){12}
% \arrMainVertexZ(6,4){13}
\ncline[linewidth=1pt,linecolor=blue]{1}{3} \arrMainVertexZ(7,1){14}
\ncline[linewidth=1pt,linecolor=blue]{3}{5} %
\ncline[linewidth=1pt,linecolor=blue]{5}{9} \draw[edge](1)--(3);
\ncline[linewidth=1pt,linecolor=blue]{9}{11} \draw[edge](3)--(5);
\ncline[linewidth=1pt,linecolor=blue]{11}{12} \draw[edge](5)--(9);
\ncline[linewidth=1pt,linecolor=blue]{12}{14} \draw[edge](9)--(11);
% \draw[edge](11)--(12);
\ncline[linewidth=1pt,linecolor=blue]{6}{7} \draw[edge](12)--(14);
\ncline[linewidth=1pt,linecolor=blue]{7}{8}\Bput[1pt]{\textcolor{blue}{$s_2$}} %
\ncline[linewidth=1pt,linecolor=blue]{8}{9} \draw[edge](6)--node[sloped,below,pos=0.4] {\textcolor{blue}{$s_2$}} (7);
% \draw[edge](7)--(8);
\ncline[linewidth=1pt,linecolor=blue]{8}{11} \draw[edge](8)--(9);
\ncline[linewidth=1pt,linecolor=blue]{11}{13} %
% \draw[edge](8)--(11);
\ncline[linewidth=1pt,linecolor=blue]{4}{7} \draw[edge](11)--(13);
\ncline[linewidth=1pt,linecolor=blue]{7}{10} %
\ncline[linewidth=1pt,linecolor=blue]{10}{12} \draw[edge](4)--(7);
% \draw[edge](7)--(10);
\ncline[linestyle=dashed,dash=2pt 2pt,linewidth=1pt,linecolor=red]{2}{3} \draw[edge](10)--(12);
\ncline[linestyle=dashed,dash=2pt 2pt,linewidth=1pt,linecolor=red]{3}{4} %
\ncline[linestyle=dashed,dash=2pt 2pt,linewidth=1pt,linecolor=red]{4}{7} \draw[edge=red,dashed](2)--(3);
\ncline[linestyle=dashed,dash=2pt 2pt,linewidth=1pt,linecolor=red]{7}{10} \draw[edge=red,dashed](3)--(4);
% \draw[edge=red,dashed](4)--(7);
\pnode(2,2){a}\uput{2pt}[-90]{0}(2,2){\textcolor{red}{$s_1$}} \draw[edge=red,dashed](7)--(10);
\nccurve[linewidth=0.25pt,angleA=-90,angleB=90]{2}{a} %
\nccurve[linewidth=0.25pt,angleA=-90,angleB=90]{10}{a} \arrQueryLabeledVertexZ[-45](4,6){x1}{$q_1$}
\pnode(3.5,2){b}\uput{2pt}[-90]{0}(3.5,2){\textcolor{blue}{$s_3$}} \arrQueryLabeledVertexZ[45](6,2){x2}{$q_2$}
\nccurve[linewidth=0.25pt,angleA=-90,angleB=90]{4}{b} \arrQueryLabeledVertexZ[45](2,4){x3}{$q_3$}
\nccurve[linewidth=0.25pt,angleA=-90,angleB=90]{12}{b} %
\endpspicture \draw [decoration={calligraphic brace,
} raise=2pt,
amplitude=10pt,aspect=0.5},decorate,line width=0.2pt] (j)--(b)
node[midway,below=10pt,red]{$s_1$};
\draw [decoration={calligraphic brace,raise=2pt,
amplitude=10pt,aspect=0.5},decorate,line width=0.2pt] (d)--(l)
node[midway,above=10pt,blue]{$s_3$};
\end{tikzpicture}
\end{document} \end{document}

View File

@ -11,7 +11,7 @@
% ======== Math =============================================================== % ======== Math ===============================================================
\usepackage{amsmath,amscd,amsthm} \usepackage{amsmath,amscd,amsthm}
\usepackage{empheq} \usepackage{empheq}
\usepackage{bm}
% ======== pdf, url and hyperlink ============================================= % ======== pdf, url and hyperlink =============================================
% \usepackage{url} % \usepackage{url}
\usepackage{hyperref} \usepackage{hyperref}
@ -42,24 +42,33 @@
% graphicx. % graphicx.
\usepackage{tikz} \usepackage{tikz}
\usepackage{pgfplots} \usepackage{pgfplots}
% \pgfplotsset{compat=1.16}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{fillbetween}
\usepackage{tikz-3dplot}
\usepackage{mathptmx} \usepackage{mathptmx}
\usetikzlibrary{calc} \usetikzlibrary{arrows,arrows.meta}
\usetikzlibrary{automata}
\usetikzlibrary{backgrounds} \usetikzlibrary{backgrounds}
\usetikzlibrary{calligraphy}
\usetikzlibrary{calc}
\usetikzlibrary{chains}
\usetikzlibrary{cd}
\usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings} \usetikzlibrary{decorations.markings}
\usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{patterns}
\usetikzlibrary{matrix}
\usetikzlibrary{fit} \usetikzlibrary{fit}
\usetikzlibrary{arrows,arrows.meta} \usetikzlibrary{intersections}
\usetikzlibrary{automata} \usetikzlibrary{math}
\usetikzlibrary{matrix}
\usetikzlibrary{patterns}
\usetikzlibrary{positioning} \usetikzlibrary{positioning}
\usetikzlibrary{shapes} \usetikzlibrary{shapes}
\usetikzlibrary{chains} \usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{spy} \usetikzlibrary{spy}
\usetikzlibrary{intersections}
\usetikzlibrary{through} \usetikzlibrary{through}
\usetikzlibrary{cd}
\usepackage{tikz-3dplot} \usepackage{tikz-3dplot}
%\usetikzlibrary{quotes,angles,graph} %\usetikzlibrary{quotes,angles,graph}
\tikzset{% \tikzset{%
@ -72,6 +81,23 @@
point/.default=red, point/.default=red,
halfedge/.style={-{Stealth[left,scale=1.5]},commutative diagrams/shift left=#1}, halfedge/.style={-{Stealth[left,scale=1.5]},commutative diagrams/shift left=#1},
halfedge/.default=3pt halfedge/.default=3pt
edge/.style={line width=0.8pt,draw=#1},
edge/.default=blue,
halfedge/.style={-{Stealth[left,scale=1.5]},
commutative diagrams/shift left=#1},
halfedge/.default=3pt,
cross/.style={#1,cross out,draw,very thick,rotate=0,
minimum size=2*(4pt-\pgflinewidth),inner sep=0pt,outer sep=0pt},
cross/.default=red
}
\pgfplotsset{%
axisLimits/.style={enlarge x limits={abs value=\axisLimitsAbsValue,auto},
enlarge y limits={abs value=\axisLimitsAbsValue,auto}}}
\newlength{\axisLimitsAbsValue}\setlength{\axisLimitsAbsValue}{0.08cm}
% ------------------------------------------------------------------------------
\newcommand{\mySimpleAxes}[4]{%
\draw[-{Stealth[scale=1.5]}] (#1,0)--(#3,0) node[right]{$x$};
\draw[-{Stealth[scale=1.5]}] (0,#2)--(0,#4) node[above]{$y$};
} }
% ------------------------------------------------------------------------------ % ------------------------------------------------------------------------------
% #1 half length of tick % #1 half length of tick

View File

@ -2,33 +2,38 @@
\input{header} \input{header}
\pagestyle{empty} \pagestyle{empty}
\begin{document} \begin{document}
\psscalebox{1.8}{\arrset{1}% \begin{tikzpicture}[scale=1.0,smooth]
\pspicture[](-3.1,-0.725)(3.1,1.709) \begin{axis}[ticks=none,axis line style={draw=none},unit vector ratio*=1 1 1,
% enlarge x limits={abs value=0.08,auto},
\pscustom[linecolor=blue,linewidth=0pt,fillstyle=hlines,hatchcolor=orange,hatchsep=2pt,hatchwidth=1pt]{% enlarge y limits={abs value=0.08,auto},
\psplot{-2}{0}{0 x x mul x mul add x x mul add x 4 mul sub 1 add 8 div} % The following miraculously solves the wierd shift in the intersection
\psplot{0}{-2}{0 x x mul x mul sub x x mul add x 4 mul add 1 add 8 div} % computation
} anchor=left of west
% ]
\pscustom[linecolor=blue,linewidth=0pt,fillstyle=vlines,hatchcolor=orange,hatchsep=2pt,hatchwidth=1pt]{ % x^3+x^2-4x-8y=-1
\psplot{0}{2}{0 x x mul x mul add x x mul add x 4 mul sub 1 add 8 div} % -x^3+x^2+4x-8y=-1
\psplot{2}{0}{0 x x mul x mul sub x x mul add x 4 mul add 1 add 8 div} \addplot [draw=none,name path=f11,domain=-2:0]{(1-x^3+x^2+4*x)*0.125};
} \addplot [draw=none,name path=f12,domain=0:-2]{(1+x^3+x^2-4*x)*0.125};
% \addplot [draw=none,name path=f21,domain=0:2]{(1-x^3+x^2+4*x)/8.0};
\psplot[linecolor=blue]{-2.5}{3}{0 x x mul x mul sub x x mul add x 4 mul add 1 add 8 div} \addplot [draw=none,name path=f22,domain=2:0]{(1+x^3+x^2-4*x)/8.0};
\psplot[linecolor=blue]{-3}{2.5}{0 x x mul x mul add x x mul add x 4 mul sub 1 add 8 div} %
% \addplot [name path global=A,color=blue,thick,domain=-2.5:3]
\arrMainVertex(-3,-0.625){1} {(1-x^3+x^2+4*x)*0.125} coordinate[point,pos=0] coordinate[point];
\arrMainVertex( 3,-0.625){2} \addplot [name path global=B,color=blue,thick,domain=-3:2.5]
\arrMainVertex(-2.5,1.609){3} {(1+x^3+x^2-4*x)*0.125} coordinate[point,pos=0] coordinate[point];
\arrMainVertex( 2.5,1.609){4} \coordinate [name intersections={of=A and B,name=x}];
\arrEmptyVertex(-2,0.625){x1} %
\arrEmptyVertex( 2,0.625){x2} \node[point=white] at (x-1) {};
\arrEmptyVertex(0,0.125){x3} \node[point=white] at (x-2) {};
\rput(-2.5,1){\textcolor{blue}{$c_1$}} \node[point=white] at (x-3) {};
\rput(-2.9,0.15){\textcolor{blue}{$c_2$}} %
\rput(-1,0.3){\boldmath{$f_1$}} \addplot[pattern={north east lines},pattern color=orange] fill between[of=f11 and f12];
\rput(1,0.3){\boldmath{$f_2$}} \addplot[pattern={north west lines},pattern color=orange] fill between[of=f21 and f22];
\endpspicture %
} \node at (-2.5,1){\textcolor{blue}{$c_1$}};
\node at (-2.9,0.15){\textcolor{blue}{$c_2$}};
\node at (-1,0.3){$\bm{f_1}$};
\node at (1,0.3){$\bm{f_2}$};
\end{axis}
\end{tikzpicture}
\end{document} \end{document}

View File

@ -2,7 +2,7 @@
\input{header} \input{header}
\pagestyle{empty} \pagestyle{empty}
\begin{document} \begin{document}
\psscalebox{1.8}{\arrset{0.9}% \psscalebox{1.0}{\arrset{0.75}%
\begin{pspicture}(-3.5,-3.5)(2.1,2.1) \begin{pspicture}(-3.5,-3.5)(2.1,2.1)
\newpsstyle{SimpleHandle}{fillstyle=solid,fillcolor=white,framearc=0.5} \newpsstyle{SimpleHandle}{fillstyle=solid,fillcolor=white,framearc=0.5}
\psframe[linewidth=0.25pt](-2,-2)(2,2) \psframe[linewidth=0.25pt](-2,-2)(2,2)

View File

@ -2,143 +2,134 @@
\input{header} \input{header}
\pagestyle{empty} \pagestyle{empty}
\begin{document} \begin{document}
\psscalebox{1.8}{\arrset{1}% \begin{tikzpicture}[scale=0.93]
\begin{pspicture}(0,0)(10,7) \fill[lightyellow](0,0)rectangle(1,7);
\psframe*[linecolor=lightyellow](0,0)(1,7) \fill[lightyellow](9,0)rectangle(10,7);
\psframe*[linecolor=lightyellow](9,0)(10,7) \fill[lightyellow](1,0)rectangle(9,1);
\psframe*[linecolor=lightyellow](1,0)(9,1) \fill[lightyellow](1,6)rectangle(9,7);
\psframe*[linecolor=lightyellow](1,6)(9,7) \draw[line width=0.25pt](0,0)rectangle(10,7);
\psframe[linewidth=0.25pt](0,0)(10,7)
% %
\arrlvertex[225](1,1){bl}{$v_{\mathrm{bl}}$} \arrMainLabeledVertexZ[225](1,1){bl}{$v_{\mathrm{bl}}$}
\arrlvertex[135](1,6){tl}{$v_{\mathrm{tl}}$} \arrMainLabeledVertexZ[135](1,6){tl}{$v_{\mathrm{tl}}$}
\arrlvertex[315](9,1){br}{$v_{\mathrm{br}}$} \arrMainLabeledVertexZ[315](9,1){br}{$v_{\mathrm{br}}$}
\arrlvertex[45](9,6){tr}{$v_{\mathrm{tr}}$} \arrMainLabeledVertexZ[45](9,6){tr}{$v_{\mathrm{tr}}$}
\arrv[180](1,2.5){1} \arrvZ[180](1,2.5){1}
\arrv[180](1,4){2} \arrvZ[180](1,4){2}
\arrv[180](1,5){3} \arrvZ[180](1,5){3}
\arrv[270](5,1){4} \arrvZ[270](5,1){4}
\arrv[90](5,6){5} \arrvZ[90](5,6){5}
\arrv[0](9,1.5){6} \arrvZ[0](9,1.5){6}
\arrv[0](9,4){7} \arrvZ[0](9,4){7}
\arrv[0](9,5.5){8} \arrvZ[0](9,5.5){8}
% %
\arrEmptyIntersectionVertex(1,4)(9,4)(5,1)(5,6){9} \node[point=white] (9) at (intersection of 2--7 and 4--5) {};
\arrEmptyIntersectionVertex(1,4)(9,4)(1,5)(9,1.5){10} \node[point=white] (10) at (intersection of 2--7 and 3--6) {};
\arrEmptyIntersectionVertex(1,5)(9,1.5)(5,1)(5,6){11} \node[point=white] (11) at (intersection of 3--6 and 4--5) {};
\arrEmptyIntersectionVertex(1,5)(9,1.5)(1,2.5)(9,5.5){12} \node[point=white] (12) at (intersection of 3--6 and 1--8) {};
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{bl}{1} \draw[dashed,line width=0.5pt](bl)--(1);
\ncline[linewidth=0.5pt,offset=3pt]{->}{bl}{1} \draw[halfedge](bl)to(1);
\ncline[linewidth=0.5pt,offset=3pt,nodesepB=1pt]{->}{1}{bl} \draw[halfedge](1)to(bl);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{1}{2} \draw[dashed,line width=0.5pt](1)--(2);
\ncline[linewidth=0.5pt,offset=3pt]{->}{1}{2} \draw[halfedge](1)to(2);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt,nodesepB=2pt]{->}{2}{1} \draw[halfedge,shorten >=1pt](2)to(1);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{2}{3} \draw[dashed,line width=0.5pt](2)--(3);
\ncline[linewidth=0.5pt,offset=3pt]{->}{2}{3} \draw[halfedge](2)to(3);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=3pt,nodesepB=1pt]{->}{3}{2} \draw[halfedge,shorten <=2pt](3)to(2);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{3}{tl} \draw[dashed,line width=0.5pt](3)--(tl);
\ncline[linewidth=0.5pt,offset=3pt]{->}{3}{tl} \draw[halfedge](3)to(tl);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt]{->}{tl}{3} \draw[halfedge](tl)to(3);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{tl}{5} \draw[dashed,line width=0.5pt](tl)--(5);
\ncline[linewidth=0.5pt,offset=3pt]{->}{tl}{5} \draw[halfedge](tl)to(5);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt,nodesepB=1pt]{->}{5}{tl} \draw[halfedge](5)to(tl);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{5}{tr} \draw[dashed,line width=0.5pt](5)--(tr);
\ncline[linewidth=0.5pt,offset=3pt]{->}{5}{tr} \draw[halfedge](5)to(tr);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt,nodesepB=1pt]{->}{tr}{5} \draw[halfedge](tr)to(5);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{tr}{8} \draw[dashed,line width=0.5pt](tr)--(8);
\ncline[linewidth=0.5pt,offset=3pt]{->}{tr}{8} \draw[halfedge](tr)to(8);
\ncline[linewidth=0.5pt,offset=3pt,nodesepB=1pt]{->}{8}{tr} \draw[halfedge](8)to(tr);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{8}{7} \draw[dashed,line width=0.5pt](8)--(7);
\ncline[linewidth=0.5pt,offset=3pt]{->}{8}{7} \draw[halfedge](8)to(7);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt,nodesepB=2pt]{->}{7}{8} \draw[halfedge,shorten >=1pt](7)to(8);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{7}{6} \draw[dashed,line width=0.5pt](7)--(6);
\ncline[linewidth=0.5pt,offset=3pt]{->}{7}{6} \draw[halfedge](7)to(6);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=3pt,nodesepB=1pt]{->}{6}{7} \draw[halfedge,shorten <=1.8pt](6)to(7);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{6}{br} \draw[dashed,line width=0.5pt](6)--(br);
\ncline[linewidth=0.5pt,offset=3pt]{->}{6}{br} \draw[halfedge](6)to(br);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt]{->}{br}{6} \draw[halfedge](br)to(6);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{br}{4} \draw[dashed,line width=0.5pt](br)--(4);
\ncline[linewidth=0.5pt,offset=3pt]{->}{br}{4} \draw[halfedge](br)to(4);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt,nodesepB=1pt]{->}{4}{br} \draw[halfedge](4)to(br);
% %
\ncline[linestyle=dashed,linewidth=0.5pt]{4}{bl} \draw[dashed,line width=0.5pt](4)--(bl);
\ncline[linewidth=0.5pt,offset=3pt]{->}{4}{bl} \draw[halfedge](4)to(bl);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=1pt,nodesepB=1pt]{->}{bl}{4} \draw[halfedge](bl)to(4);
% %
%\arredge{3}{10} \draw[edge](3)--(10);
\ncline[linewidth=0.5pt,linecolor=blue]{3}{10} \draw[halfedge](3)to(10);
\ncline[linewidth=0.25pt,offset=3pt]{->}{3}{10} \draw[halfedge,shorten <=11pt,shorten >=1.6pt](10)to(3);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=12pt,nodesepB=2pt]{->}{10}{3} \draw[edge](10)--(12);
%\arredge{10}{12} \draw[halfedge,shorten <=4pt](12)to(10);
\ncline[linewidth=0.5pt,linecolor=blue]{10}{12} \draw[halfedge,shorten <=10pt,shorten >=-1.8pt](10)to(12);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=6pt]{->}{12}{10} \draw[edge](12)--(11);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=16pt,nodesepB=-2pt]{->}{10}{12} \draw[halfedge](11)to(12);
%\arredge{12}{11} \draw[halfedge,shorten <=4.2pt,shorten >=1.2pt](12)to(11);
\ncline[linewidth=0.5pt,linecolor=blue]{12}{11} \draw[edge](11)--(6);
\ncline[linewidth=0.25pt,offset=3pt]{->}{11}{12} \draw[halfedge,shorten >=1.6pt](11)to(6);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=6pt,nodesepB=2pt]{->}{12}{11} \draw[halfedge,shorten >=1.6pt](6)to(11);
%\arredge{11}{6}
\ncline[linewidth=0.5pt,linecolor=blue]{11}{6}
\ncline[linewidth=0.25pt,offset=3pt,nodesepB=2pt]{->}{11}{6}
\ncline[linewidth=0.25pt,offset=3pt,nodesepB=2pt]{->}{6}{11}
%\arredge{1}{12} \draw[edge](1)--(12);
\ncline[linewidth=0.5pt,linecolor=blue]{1}{12} \draw[halfedge,shorten <=1.4pt,shorten >=4pt](1)to(12);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=2pt,nodesepB=5pt]{->}{1}{12} \draw[halfedge](12)to(1);
\ncline[linewidth=0.25pt,offset=3pt]{->}{12}{1} \draw[edge](12)--(9);
%\arredge{12}{9} \draw[halfedge,shorten >=11.6pt](12)to(9);
\ncline[linewidth=0.5pt,linecolor=blue]{12}{9} \draw[halfedge,shorten <=2pt,shorten >=3.6pt](9)to(12);
\ncline[linewidth=0.25pt,,offset=3pt,nodesepB=12pt]{->}{12}{9} \draw[edge](9)--(8);
\ncline[linewidth=0.25pt,,offset=3pt,nodesepA=2pt,nodesepB=5pt]{->}{9}{12} \draw[halfedge,shorten <=1.4pt](9)to(8);
%\arredge{9}{8} \draw[halfedge,shorten <=1.8pt,shorten >=11.8pt](8)to(9);
\ncline[linewidth=0.5pt,linecolor=blue]{9}{8}
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=2pt]{->}{9}{8}
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=2pt,nodesepB=12pt]{->}{8}{9}
\ncline[linewidth=0.5pt,linecolor=blue]{2}{10} \draw[edge](2)--(10);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=1pt,nodesepB=10pt]{->}{2}{10} \draw[halfedge,shorten >=10pt](2)to(10);
\ncline[linewidth=0.25pt,offset=3pt,nodesepB=1pt]{->}{10}{2} \draw[halfedge](10)to(2);
\ncline[linewidth=0.5pt,linecolor=blue]{10}{9} \draw[edge](10)--(9);
\ncline[linewidth=0.25pt,offset=3pt,nodesepB=1pt]{->}{10}{9} \draw[halfedge](10)to(9);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=16pt,nodesepB=10pt]{->}{9}{10} \draw[halfedge,shorten <=13pt,shorten >=9.4pt](9)to(10);
\ncline[linewidth=0.5pt,linecolor=blue]{9}{7} \draw[edge](9)--(7);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=16pt,nodesepB=1pt]{->}{9}{7} \draw[halfedge,shorten <=13pt](9)to(7);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=1pt,nodesepB=1pt]{->}{7}{9} \draw[halfedge](7)to(9);
\ncline[linewidth=0.5pt,linecolor=blue]{4}{11} \draw[edge](4)--(11);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=1pt]{->}{4}{11} \draw[halfedge](4)to(11);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=2pt,nodesepB=1pt]{->}{11}{4} \draw[halfedge,shorten <=2pt](11)to(4);
\ncline[linewidth=0.5pt,linecolor=blue]{11}{9} \draw[edge](11)--(9);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=1pt]{->}{9}{11} \draw[halfedge](9)to(11);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=2pt,nodesepB=2pt]{->}{11}{9} \draw[halfedge,shorten <=2pt,shorten >=1pt](11)to(9);
\ncline[linewidth=0.5pt,linecolor=blue]{9}{5} \draw[edge](9)--(5);
\ncline[linewidth=0.25pt,offset=3pt,nodesepA=1pt,nodesepB=1pt]{->}{9}{5} \draw[halfedge](9)to(5);
\ncline[linewidth=0.25pt,offset=3pt,,nodesepA=1pt,nodesepB=2pt]{->}{5}{9} \draw[halfedge,shorten >=1.2pt](5)to(9);
% %
\rput(2,6.5){$\tilde{f}$} \node at(2,6.5){$\tilde{f}$};
\rput(6.2,5.2){$f_1$} \node at(6.2,5.2){$f_1$};
\rput(8.5,4.4){$f_2$} \node at(8.5,4.4){$f_2$};
\rput(8.3,3.4){$f_3$} \node at(8.3,3.4){$f_3$};
\rput(6.2,2){$f_4$} \node at(6.2,2){$f_4$};
\rput(3.8,2){$f_5$} \node at(3.8,2){$f_5$};
\rput(1.7,3.4){$f_6$} \node at(1.7,3.4){$f_6$};
\rput(1.5,4.4){$f_7$} \node at(1.5,4.4){$f_7$};
\rput(3.8,5.2){$f_8$} \node at (3.8,5.2){$f_8$};
\end{pspicture} \end{tikzpicture}
}
\end{document} \end{document}

View File

@ -18,9 +18,10 @@ private:
public: public:
Face_index_observer(Ex_arrangement& arr) : Face_index_observer(Ex_arrangement& arr) :
CGAL::Arr_observer<Ex_arrangement>(arr), n_faces(0) CGAL::Arr_observer<Ex_arrangement>(arr),
n_faces(0)
{ {
CGAL_precondition (arr.is_empty()); CGAL_precondition(arr.is_empty());
arr.unbounded_face()->set_data (0); arr.unbounded_face()->set_data (0);
} }

View File

@ -55,22 +55,6 @@ int main() {
// Landmarks_pl landmarks_pl(gm); // Landmarks_pl landmarks_pl(gm);
Walk_pl walk_pl(gm); Walk_pl walk_pl(gm);
// Trap_pl trap_pl(gm); // Trap_pl trap_pl(gm);
/* Need to add the code below to both Arr_spherical_gaussian_map_3 and
* Arr_polyhedral_sgm, and then work on the trap point location code...
private:
friend class Arr_observer<Self>;
friend class Arr_accessor<Self>;
protected:
typedef Arr_observer<Self> Observer;
void _register_observer(Observer *p_obs)
{ Base::_register_observer((typename Base::Observer*)p_obs); }
bool _unregister_observer(Observer *p_obs)
{ return (Base::_unregister_observer ((typename Base::Observer*)p_obs)); }
*/
Gm_traits traits; Gm_traits traits;
Gm_initializer gm_initializer(gm); Gm_initializer gm_initializer(gm);

View File

@ -0,0 +1,571 @@
// Copyright (c) 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>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_AOS_OBSERVER_H
#define CGAL_AOS_OBSERVER_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/disable_warnings.h>
#include <CGAL/Arr_enums.h>
/*! \file
* Definition of the `Aos_observer<Arrangement>` base class.
*/
namespace CGAL {
/*! \class
* A base class for arrangement observers.
* The Arrangement parameter corresponds to an arrangement instantiation.
*/
template <typename Arrangement_>
class Aos_observer {
public:
typedef Arrangement_ Arrangement_2;
typedef Aos_observer<Arrangement_2> Self;
typedef typename Arrangement_2::Point_2 Point_2;
typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
typedef typename Arrangement_2::Face_handle Face_handle;
typedef typename Arrangement_2::Ccb_halfedge_circulator
Ccb_halfedge_circulator;
private:
Arrangement_2* p_arr; // The associated arrangement.
/*! Copy constructor - not supported. */
Aos_observer(const Self&);
/*! Assignment operator - not supported. */
Self& operator=(const Self&);
public:
/// \name Construction and destruction functions.
//@{
/*! Default constructor. */
Aos_observer() : p_arr(nullptr) {}
/*! Constructor with an associated arrangement. */
Aos_observer(Arrangement_2& arr) : p_arr(&arr)
{
// Register the observer object in the arrangement.
p_arr->_register_observer(this);
}
/*! Destructor. */
virtual ~Aos_observer()
{
// Unregister the observer object from the arrangement.
if (p_arr != nullptr)
p_arr->_unregister_observer(this);
}
//@}
/// \name Modifying the associated arrangement.
//@{
/*! Get the associated arrangement (const version). */
const Arrangement_2* arrangement() const { return (p_arr); }
/*! Get the associated arrangement (non-const version). */
Arrangement_2* arrangement() { return (p_arr); }
/*! Attach the observer to an arrangement.
* \pre The observer is not already attached to an arrangement.
*/
void attach(Arrangement_2& arr)
{
// Do nothing if the associated arrangement is not changed.
if (p_arr == &arr) return;
// The observer is not already attached to an arrangement.
CGAL_precondition (p_arr == nullptr);
if (p_arr != nullptr) return;
// Notify the concrete observer (the sub-class) about the attachment.
before_attach(arr);
// Register the observer object in the new arrangement.
p_arr = &arr;
p_arr->_register_observer(this);
// Notify the concrete observer that the attachment took place.
after_attach();
}
/*! Detach the observer from the arrangement. */
void detach()
{
if (p_arr == nullptr) return;
// Notify the concrete observer (the sub-class) about the detachment.
before_detach ();
// Unregister the observer object from the current arrangement, and mark
// that the observer is not attached to an arrangement.
p_arr->_unregister_observer(this);
p_arr = nullptr;
// Notify the concrete observer that the detachment took place.
after_detach();
}
//@}
/// \name Notification functions on global arrangement operations.
//@{
/*! Notification before the arrangement is assigned with another
* arrangement.
* \param arr The arrangement to be copied.
*/
virtual void before_assign(const Arrangement_2& /* arr */) {}
/*! Notification after the arrangement has been assigned with another
* arrangement.
*/
virtual void after_assign() {}
/*! Notification before the arrangement is cleared. */
virtual void before_clear() {}
/*! Notification after the arrangement is cleared. */
virtual void after_clear() {}
/*! Notification before a global operation modifies the arrangement. */
virtual void before_global_change() {}
/*! Notification after a global operation is completed. */
virtual void after_global_change() {}
//@}
/// \name Notification functions on observer attachment or detachment.
//@{
/*! Notification before the observer is attached to an arrangement.
* \param arr The arrangement that is about to attach the observer.
*/
virtual void before_attach(const Arrangement_2& /* arr */) {}
/*! Notification after the observer has been attached to an arrangement. */
virtual void after_attach() {}
/*! Notification before the observer is detached from the arrangement. */
virtual void before_detach() {}
/*! Notification after the observer has been detached from the arrangement. */
virtual void after_detach() {}
//@}
/// \name Notification functions on local changes in the arrangement.
//@{
/*! Notification before the creation of a new vertex.
* \param p The point to be associated with the vertex.
* This point cannot lie on the surface boundaries.
*/
virtual void before_create_vertex(const Point_2& /* p */) {}
/*! Notification after the creation of a new vertex.
* \param v A handle to the created vertex.
*/
virtual void after_create_vertex(Vertex_handle /* v */)
{}
/*! Notification before the creation of a new boundary vertex.
* \param p The point on the surface boundary.
* \param ps_x The boundary condition of the vertex in x.
* \param ps_y The boundary condition of the vertex in y.
*/
virtual void before_create_boundary_vertex(const Point_2& /* p */,
Arr_parameter_space /* ps_x */,
Arr_parameter_space /* ps_y */)
{}
/*! Notification before the creation of a new boundary vertex.
* \param cv The curve incident to the surface boundary.
* \param ind The relevant curve-end.
* \param ps_x The boundary condition of the vertex in x.
* \param ps_y The boundary condition of the vertex in y.
*/
virtual void before_create_boundary_vertex(const X_monotone_curve_2& /* cv */,
Arr_curve_end /* ind */,
Arr_parameter_space /* ps_x */,
Arr_parameter_space /* ps_y */)
{}
/*! Notification after the creation of a new vertex at infinity.
* \param v A handle to the created vertex.
*/
virtual void after_create_boundary_vertex(Vertex_handle /* v */) {}
/*! Notification before the creation of a new edge.
* \param c The \f$x\f$-monotone curve to be associated with the edge.
* \param v1 A handle to the first end-vertex of the edge.
* \param v2 A handle to the second end-vertex of the edge.
*/
virtual void before_create_edge(const X_monotone_curve_2& /* c */,
Vertex_handle /* v1 */,
Vertex_handle /* v2 */)
{}
/*! Notification after the creation of a new edge.
* \param e A handle to one of the twin halfedges that were created.
*/
virtual void after_create_edge(Halfedge_handle /* e */) {}
/*! Notification before the modification of an existing vertex.
* \param v A handle to the vertex to be updated.
* \param p The point to be associated with the vertex.
*/
virtual void before_modify_vertex(Vertex_handle /* v */,
const Point_2& /* p */)
{}
/*! Notification after a vertex was modified.
* \param v A handle to the updated vertex.
*/
virtual void after_modify_vertex(Vertex_handle /* v */) {}
/*! Notification before the modification of an existing edge.
* \param e A handle to one of the twin halfedges to be updated.
* \param c The \f$x\f$-monotone curve to be associated with the edge.
*/
virtual void before_modify_edge(Halfedge_handle /* e */,
const X_monotone_curve_2& /* c */)
{}
/*! Notification after an edge was modified.
* \param e A handle to one of the twin halfedges that were updated.
*/
virtual void after_modify_edge(Halfedge_handle /* e */) {}
/*! Notification before the splitting of an edge into two.
* \param e A handle to one of the existing halfedges.
* \param v A vertex representing the split point.
* \param c1 The \f$x\f$-monotone curve to be associated with the first edge.
* \param c2 The \f$x\f$-monotone curve to be associated with the second edge.
*/
virtual void before_split_edge(Halfedge_handle /* e */,
Vertex_handle /* v */,
const X_monotone_curve_2& /* c1 */,
const X_monotone_curve_2& /* c2 */)
{}
/*! Notification after an edge was split.
* \param e1 A handle to one of the twin halfedges forming the first edge.
* \param e2 A handle to one of the twin halfedges forming the second edge.
*/
virtual void after_split_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */)
{}
/*! Notification before the splitting of a fictitious edge into two.
* \param e A handle to one of the existing halfedges.
* \param v A vertex representing the unbounded split point.
*/
virtual void before_split_fictitious_edge(Halfedge_handle /* e */,
Vertex_handle /* v */)
{}
/*! Notification after a fictitious edge was split.
* \param e1 A handle to one of the twin halfedges forming the first edge.
* \param e2 A handle to one of the twin halfedges forming the second edge.
*/
virtual void after_split_fictitious_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */)
{}
/*! Notification before the splitting of a face into two.
* \param f A handle to the existing face.
* \param e The new edge whose insertion causes the face to split.
*/
virtual void before_split_face(Face_handle /* f */,
Halfedge_handle /* e */)
{}
/*! Notification after a face was split.
* \param f A handle to the face we have just split.
* \param new_f A handle to the new face that has been created.
* \param is_hole Whether the new face forms a hole inside f.
*/
virtual void after_split_face(Face_handle /* f */,
Face_handle /* new_f */,
bool /* is_hole */)
{}
/*! Notification before the splitting of an outer CCB into two.
* \param f A handle to the face that owns the outer CCB.
* \param h A circulator representing the component boundary.
* \param e The new edge whose removal causes the outer CCB to split.
*/
virtual void before_split_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */,
Halfedge_handle /* e */)
{}
/*! Notification after an outer CCB was split.
* \param f A handle to the face that owns the outer CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
*/
virtual void after_split_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */)
{}
/*! Notification before the splitting of an inner CCB into two.
* \param f A handle to the face containing the inner CCB.
* \param h A circulator representing the component boundary.
* \param e The new edge whose removal causes the inner CCB to split.
*/
virtual void before_split_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */,
Halfedge_handle /* e */)
{}
/*! Notification after an inner CCB was split.
* \param f A handle to the face containing the inner CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
*/
virtual void after_split_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */)
{}
/*! Notification before the creation of a new outer CCB of a face.
* \param f A handle to the face that owns the outer CCB.
* \param e A halfedge along the new outer CCB.
*/
virtual void before_add_outer_ccb(Face_handle /* f */,
Halfedge_handle /* e */)
{}
/*! Notification after an outer CCB was added to a face.
* \param h A circulator representing the boundary of the new outer CCB.
*/
virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before the creation of a new inner CCB inside a face.
* \param f A handle to the face containing the inner CCB.
* \param e The new halfedge that forms the new inner CCB.
*/
virtual void before_add_inner_ccb(Face_handle /* f */,
Halfedge_handle /* e */)
{}
/*! Notification after an inner CCB was created inside a face.
* \param h A circulator representing the boundary of the new inner CCB.
*/
virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before the creation of a new isolated vertex inside a face.
* \param f A handle to the face containing the isolated vertex.
* \param v The isolated vertex.
*/
virtual void before_add_isolated_vertex(Face_handle /* f */,
Vertex_handle /* v */)
{}
/*! Notification after an isolated vertex was created inside a face.
* \param v The isolated vertex.
*/
virtual void after_add_isolated_vertex(Vertex_handle /* v */) {}
/*! Notification before the merging of two edges.
* \param e1 A handle to one of the halfedges forming the first edge.
* \param e2 A handle to one of the halfedges forming the second edge.
* \param c The \f$x\f$-monotone curve to be associated with the merged edge.
*/
virtual void before_merge_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */,
const X_monotone_curve_2& /* c */)
{}
/*! Notification after an edge was merged.
* \param e A handle to one of the twin halfedges forming the merged edge.
*/
virtual void after_merge_edge(Halfedge_handle /* e */) {}
/*! Notification before the merging of two fictitious edges.
* \param e1 A handle to one of the halfedges forming the first edge.
* \param e2 A handle to one of the halfedges forming the second edge.
*/
virtual void before_merge_fictitious_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */)
{}
/*! Notification after a fictitious edge was merged.
* \param e A handle to one of the twin halfedges forming the merged edge.
*/
virtual void after_merge_fictitious_edge(Halfedge_handle /* e */) {}
/*! Notification before the merging of two faces.
* \param f1 A handle to the first face.
* \param f2 A handle to the second face.
* \param e The edge whose removal causes the faces to merge.
*/
virtual void before_merge_face(Face_handle /* f1 */,
Face_handle /* f2 */,
Halfedge_handle /* e */)
{}
/*! Notification after a face was merged.
* \param f A handle to the merged face.
*/
virtual void after_merge_face(Face_handle /* f */) {}
/*! Notification before the merging of two outer CCBs.
* \param f A handle to the face that owns the outer CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
* \param e The edge whose insertion or removal causes the CCBs to merge.
*/
virtual void before_merge_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */,
Halfedge_handle /* e */)
{}
/*! Notification after an outer CCB was merged.
* \param f A handle to the face that owns the outer CCBs.
* \param h A circulator representing the boundary of the merged component.
*/
virtual void after_merge_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notification before the merging of two inner CCBs (holes).
* \param f A handle to the face that contains the inner CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
* \param e The edge whose insertion causes the inner CCBs to merge.
*/
virtual void before_merge_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */,
Halfedge_handle /* e */)
{}
/*! Notification after an inner CCB was merged.
* \param f A handle to the face that contains the inner CCBs.
* \param h A circulator representing the boundary of the merged component.
*/
virtual void after_merge_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notification before an outer CCB is moved from one face to another.
* \param from_f A handle to the face that currently owns the outer CCB.
* \param to_f A handle to the face that should own the outer CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_move_outer_ccb(Face_handle /* from_f */,
Face_handle /* to_f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notification after an outer CCB is moved from one face to another.
* \param h A circulator representing the boundary of the component.
*/
virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before an inner CCB is moved from one face to another.
* \param from_f A handle to the face currently containing the inner CCB.
* \param to_f A handle to the face that should contain the inner CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_move_inner_ccb(Face_handle /* from_f */,
Face_handle /* to_f */,
Ccb_halfedge_circulator /* h */)
{}
/*!
* Notification after an inner CCB is moved from one face to another.
* \param h A circulator representing the boundary of the component.
*/
virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before an isolated vertex is moved from one face to another.
* \param from_f A handle to the face currently containing the vertex.
* \param to_f A handle to the face that should contain the vertex.
* \param v The isolated vertex.
*/
virtual void before_move_isolated_vertex(Face_handle /* from_f */,
Face_handle /* to_f */,
Vertex_handle /* v */)
{}
/*! Notification after an isolated vertex is moved from one face to another.
* \param v The isolated vertex.
*/
virtual void after_move_isolated_vertex(Vertex_handle /* v */) {}
/*! Notificaion before the removal of a vertex.
* \param v A handle to the vertex to be deleted.
*/
virtual void before_remove_vertex(Vertex_handle /* v */) {}
/*! Notificaion after the removal of a vertex. */
virtual void after_remove_vertex() {}
/*! Notification before the removal of an edge.
* \param e A handle to one of the twin halfedges to be deleted.
*/
virtual void before_remove_edge(Halfedge_handle /* e */) {}
/*! Notificaion after the removal of an edge. */
virtual void after_remove_edge() {}
/*! Notification before the removal of an outer CCB.
* \param f The face that owns the outer CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_remove_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notificaion after the removal of an outer CCB.
* \param f The face that used to own the outer CCB.
*/
virtual void after_remove_outer_ccb(Face_handle /* f */) {}
/*! Notification before the removal of an inner CCB.
* \param f The face containing the inner CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_remove_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notificaion after the removal of an inner CCB.
* \param f The face that used to contain the inner CCB.
*/
virtual void after_remove_inner_ccb(Face_handle /* f */) {}
//@}
};
} //namespace CGAL
#include <CGAL/enable_warnings.h>
#endif

View File

@ -5,15 +5,18 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s): Michael Kerber <mkerber@mpi-inf.mpg.de> // Author(s): Michael Kerber <mkerber@mpi-inf.mpg.de>
// //
// ============================================================================ // ============================================================================
#ifndef CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS #ifndef CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS_H
#define CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS #define CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
@ -655,4 +658,4 @@ public:
#include <CGAL/enable_warnings.h> #include <CGAL/enable_warnings.h>
#endif // CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS #endif // CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS_H

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

@ -8,8 +8,9 @@
// 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): Ron Wein <wein@post.tau.ac.il>
// (based on old version by: Iddo Hanniel and Oren Nechushtan) // Efi Fogel <efif@post.tau.ac.il>
// (based on old version by: Iddo Hanniel and Oren Nechushtan)
#ifndef CGAL_ARR_DCEL_BASE_H #ifndef CGAL_ARR_DCEL_BASE_H
#define CGAL_ARR_DCEL_BASE_H #define 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

@ -8,8 +8,9 @@
// 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): 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

@ -8,8 +8,8 @@
// 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): Ron Wein <wein@post.tau.ac.il>
// Efi Fogel <efif@post.tau.ac.il> // Efi Fogel <efif@post.tau.ac.il>
#ifndef CGAL_ARR_EXTENDED_DCEL_H #ifndef CGAL_ARR_EXTENDED_DCEL_H
#define CGAL_ARR_EXTENDED_DCEL_H #define CGAL_ARR_EXTENDED_DCEL_H
@ -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. */ /*! Assign from another halfedge. */
virtual void assign (const Base& he) virtual void assign(const Halfedge_base& he) {
{ Halfedge_base::assign(he);
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

@ -21,7 +21,6 @@
* Definition of the Arr_face_index_map<Arrangement> class. * Definition of the Arr_face_index_map<Arrangement> class.
*/ */
#include <CGAL/Arr_observer.h>
#include <CGAL/Unique_hash_map.h> #include <CGAL/Unique_hash_map.h>
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
@ -34,140 +33,110 @@ namespace CGAL {
* arrangement faces to the indices 0, ..., (n -1), where n is the number * arrangement faces to the indices 0, ..., (n -1), where n is the number
* of faces in the arrangement. * of faces in the arrangement.
*/ */
template <class Arrangement_> template <typename Arrangement_>
class Arr_face_index_map : public Arr_observer<Arrangement_> class Arr_face_index_map : public Arrangement_::Observer {
{
public: public:
using Arrangement_2 = Arrangement_;
using Base_aos = typename Arrangement_2::Base_aos;
typedef Arrangement_ Arrangement_2; using Halfedge_handle = typename Base_aos::Halfedge_handle;
typedef typename Arrangement_2::Face_handle Face_handle; using Face_handle = typename Base_aos::Face_handle;
// Boost property type definitions: // Boost property type definitions:
typedef boost::readable_property_map_tag category; using category = boost::readable_property_map_tag;
typedef unsigned int value_type; using value_type = unsigned int;
typedef value_type reference; using reference = value_type;
typedef Face_handle key_type; using key_type = Face_handle;
private: private:
using Self = Arr_face_index_map<Arrangement_2>;
using Base = typename Arrangement_2::Observer;
typedef Arr_face_index_map<Arrangement_2> Self; using Index_map = Unique_hash_map<Face_handle, unsigned int>;
typedef Arr_observer<Arrangement_2> Base;
typedef Unique_hash_map<Face_handle, unsigned int> Index_map;
// Data members: // Data members:
unsigned int n_faces; // The current number of faces. unsigned int n_faces; // The current number of faces.
Index_map index_map; // Mapping faces to indices. Index_map index_map; // Mapping faces to indices.
std::vector<Face_handle> rev_map; // Mapping indices to faces. std::vector<Face_handle> rev_map; // Mapping indices to faces.
enum {MIN_REV_MAP_SIZE = 32}; enum {MIN_REV_MAP_SIZE = 32};
public: public:
/*! Default constructor. */ /*! Default constructor. */
Arr_face_index_map () : Arr_face_index_map() :
Base (), Base(),
n_faces (0), n_faces(0),
rev_map (MIN_REV_MAP_SIZE) rev_map(MIN_REV_MAP_SIZE)
{} {}
/*! Constructor with an associated arrangement. */ /*! Constructor with an associated arrangement. */
Arr_face_index_map (const Arrangement_2& arr) : Arr_face_index_map(const Base_aos& arr) :
Base (const_cast<Arrangement_2&> (arr)) Base(const_cast<Base_aos&>(arr))
{ { _init(); }
_init();
}
/*! Copy constructor. */ /*! Copy constructor. */
Arr_face_index_map (const Self& other) : Arr_face_index_map(const Self& other) :
Base (const_cast<Arrangement_2&> (*(other.arrangement()))) Base(const_cast<Base_aos&>(*(other.arrangement())))
{ { _init(); }
_init();
}
/*! Assignment operator. */ /*! Assignment operator. */
Self& operator= (const Self& other) Self& operator= (const Self& other) {
{ if (this == &other) return (*this);
if (this == &other)
return (*this);
this->detach(); this->detach();
this->attach (const_cast<Arrangement_2&> (*(other.arrangement()))); this->attach(const_cast<Base_aos&>(*(other.arrangement())));
return (*this); return (*this);
} }
/*! /*! Get the index of a given face.
* Get the index of a given face.
* \param f A handle to the face. * \param f A handle to the face.
* \pre f is a valid face in the arrangement. * \pre f is a valid face in the arrangement.
*/ */
unsigned int operator[] (Face_handle f) const unsigned int operator[](Face_handle f) const { return (index_map[f]); }
{
return (index_map[f]);
}
/*! /*! Get the face given its index.
* Get the face given its index.
* \param i The index of the face. * \param i The index of the face.
* \pre i is less than the number of faces in the arrangement. * \pre i is less than the number of faces in the arrangement.
*/ */
Face_handle face (const int i) const Face_handle face(const int i) const {
{
CGAL_precondition((unsigned int) i < n_faces); CGAL_precondition((unsigned int) i < n_faces);
return (rev_map[i]); return (rev_map[i]);
} }
/// \name Notification functions, to keep the mapping up-to-date. /// \name Notification functions, to keep the mapping up-to-date.
//@{ //@{
/*! /*! Update the mapping after the arrangement has been assigned with another
* Update the mapping after the arrangement has been assigned with another
* arrangement. * arrangement.
*/ */
virtual void after_assign () virtual void after_assign() override { _init(); }
{
_init();
}
/*! /*! Update the mapping after the arrangement is cleared.
* Update the mapping after the arrangement is cleared.
*/ */
virtual void after_clear () virtual void after_clear() override { _init(); }
{
_init();
}
/*! /*! Update the mapping after attaching to a new arrangement.
* Update the mapping after attaching to a new arrangement.
*/ */
virtual void after_attach () virtual void after_attach() override { _init(); }
{
_init();
}
/*! /*! Update the mapping after detaching the arrangement.
* Update the mapping after detaching the arrangement.
*/ */
virtual void after_detach () virtual void after_detach() override {
{
n_faces = 0; n_faces = 0;
index_map.clear(); index_map.clear();
} }
/*! /*! Update the mapping after the creation of a new face is split from another
* Update the mapping after the creation of a new face is split from another
* face. * face.
* \param f A handle to the existing face. * \param f A handle to the existing face.
* \param new_f A handle to the newly created face. * \param new_f A handle to the newly created face.
*/ */
virtual void after_split_face (Face_handle /* f */, virtual void after_split_face(Face_handle /* f */,
Face_handle new_f, Face_handle new_f,
bool /* is_hole */) bool /* is_hole */) override {
{
// Update the number of vertices. // Update the number of vertices.
n_faces++; ++n_faces;
// If necessary, allocate memory for the reverse mapping. // If necessary, allocate memory for the reverse mapping.
if (rev_map.size() < n_faces) if (rev_map.size() < n_faces)
@ -176,97 +145,77 @@ public:
// Update the mapping of the newly created face. // Update the mapping of the newly created face.
index_map[new_f] = n_faces - 1; index_map[new_f] = n_faces - 1;
rev_map[n_faces - 1] = new_f; rev_map[n_faces - 1] = new_f;
return;
} }
/*! /*! Update the mapping before the merge of two faces.
* Update the mapping before the merge of two faces.
* \param f1 A handle to the face that is going to remain. * \param f1 A handle to the face that is going to remain.
* \param f2 A handle to the face that is about to be removed. * \param f2 A handle to the face that is about to be removed.
*/ */
virtual void before_merge_face (Face_handle /* f1 */, virtual void before_merge_face(Face_handle /* f1 */,
Face_handle f2, Face_handle f2,
typename Halfedge_handle /* e */) override {
Arrangement_2::Halfedge_handle /* e */)
{
// Update the number of faces. // Update the number of faces.
n_faces--; --n_faces;
// Reduce memory consumption in case the number of faces has // Reduce memory consumption in case the number of faces has
// drastically decreased. // drastically decreased.
if (2*n_faces+1 < rev_map.size() && if (2*n_faces+1 < rev_map.size() &&
rev_map.size() / 2 >= MIN_REV_MAP_SIZE) rev_map.size() / 2 >= MIN_REV_MAP_SIZE)
{ {
rev_map.resize (rev_map.size() / 2); rev_map.resize(rev_map.size() / 2);
} }
// Get the current face index, and assign this index to the face // Get the current face index, and assign this index to the face
// currently indexed (n - 1). // currently indexed (n - 1).
unsigned int index = index_map[f2]; unsigned int index = index_map[f2];
if (index == n_faces) if (index == n_faces) return;
return;
Face_handle last_f = rev_map[n_faces]; Face_handle last_f = rev_map[n_faces];
index_map[last_f] = index; index_map[last_f] = index;
rev_map[index] = last_f; rev_map[index] = last_f;
// Clear the reverse mapping for the last face. // Clear the reverse mapping for the last face.
rev_map[n_faces] = Face_handle(); rev_map[n_faces] = Face_handle();
return;
} }
//@} //@}
private: private:
/*! Initialize the map for the given arrangement. */ /*! Initialize the map for the given arrangement. */
void _init () void _init() {
{
// Get the number of faces and allocate the reverse map accordingly. // Get the number of faces and allocate the reverse map accordingly.
n_faces = static_cast<unsigned int>(this->arrangement()->number_of_faces()); n_faces = static_cast<unsigned int>(this->arrangement()->number_of_faces());
if (n_faces < MIN_REV_MAP_SIZE) if (n_faces < MIN_REV_MAP_SIZE) rev_map.resize (MIN_REV_MAP_SIZE);
rev_map.resize (MIN_REV_MAP_SIZE); else rev_map.resize (n_faces);
else
rev_map.resize (n_faces);
// Clear the current mapping. // Clear the current mapping.
index_map.clear(); index_map.clear();
// Create the initial mapping. // Create the initial mapping.
typename Arrangement_2::Face_iterator fit; Face_handle fh;
Face_handle fh; unsigned int index = 0;
unsigned int index = 0;
for (fit = this->arrangement()->faces_begin(); for (auto fit = this->arrangement()->faces_begin();
fit != this->arrangement()->faces_end(); ++fit, ++index) fit != this->arrangement()->faces_end(); ++fit, ++index) {
{
// Map the current face to the current index. // Map the current face to the current index.
fh = fit; fh = fit;
index_map[fh] = index; index_map[fh] = index;
rev_map[index] = fh; rev_map[index] = fh;
} }
return;
} }
}; };
/*! /*! Get the index property-map function. Provided so that boost is able to
* Get the index property-map function. Provided so that boost is able to
* access the Arr_face_index_map above. * access the Arr_face_index_map above.
* \param index_map The index map. * \param index_map The index map.
* \param f A face handle. * \param f A face handle.
* \return The face index. * \return The face index.
*/ */
template<class Arrangement> template <typename Arrangement>
unsigned int get (const CGAL::Arr_face_index_map<Arrangement>& index_map, unsigned int get(const CGAL::Arr_face_index_map<Arrangement>& index_map,
typename Arrangement::Face_handle f) typename Arrangement::Face_handle f)
{ { return (index_map[f]); }
return (index_map[f]);
}
} //namespace CGAL } //namespace CGAL

View File

@ -1,4 +1,4 @@
// Copyright (c) 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,565 +8,26 @@
// 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>
// Efi Fogel <efif@post.tau.ac.il>
#ifndef CGAL_ARR_OBSERVER_H #ifndef CGAL_ARR_OBSERVER_H
#define CGAL_ARR_OBSERVER_H #define CGAL_ARR_OBSERVER_H
/*! \file
* Definition of the `Arr_observer<Arrangement>` base class mainly for backward
* compatibility.
*/
#include <CGAL/license/Arrangement_on_surface_2.h> #include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
#include <CGAL/Arr_enums.h>
/*! \file
* Definition of the Arr_observer<Arrangement> base class.
*/
namespace CGAL { namespace CGAL {
/*! \class
* A base class for arrangement observers.
* The Arrangement parameter corresponds to an arrangement instantiation.
*/
template <typename Arrangement_> template <typename Arrangement_>
class Arr_observer using Arr_observer = typename Arrangement_::Observer;
{
public:
typedef Arrangement_ Arrangement_2;
typedef Arr_observer<Arrangement_2> Self;
typedef typename Arrangement_2::Point_2 Point_2; } // namespace CGAL
typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
typedef typename Arrangement_2::Face_handle Face_handle;
typedef typename Arrangement_2::Ccb_halfedge_circulator
Ccb_halfedge_circulator;
private:
Arrangement_2* p_arr; // The associated arrangement.
/*! Copy constructor - not supported. */
Arr_observer(const Self&);
/*! Assignment operator - not supported. */
Self& operator=(const Self&);
public:
/// \name Construction and destruction functions.
//@{
/*! Default constructor. */
Arr_observer() : p_arr(nullptr) {}
/*! Constructor with an associated arrangement. */
Arr_observer(Arrangement_2& arr) : p_arr(&arr)
{
// Register the observer object in the arrangement.
p_arr->_register_observer(this);
}
/*! Destructor. */
virtual ~Arr_observer()
{
// Unregister the observer object from the arrangement.
if (p_arr != nullptr)
p_arr->_unregister_observer(this);
}
//@}
/// \name Modifying the associated arrangement.
//@{
/*! Get the associated arrangement (non-const version). */
const Arrangement_2* arrangement() const { return (p_arr); }
/*! Get the associated arrangement (non-const version). */
Arrangement_2* arrangement() { return (p_arr); }
/*! Attach the observer to an arrangement.
* \pre The observer is not already attached to an arrangement.
*/
void attach(Arrangement_2& arr)
{
// Do nothing if the associated arrangement is not changed.
if (p_arr == &arr) return;
// The observer is not already attached to an arrangement.
CGAL_precondition (p_arr == nullptr);
if (p_arr != nullptr) return;
// Notify the concrete observer (the sub-class) about the attachment.
before_attach(arr);
// Register the observer object in the new arrangement.
p_arr = &arr;
p_arr->_register_observer(this);
// Notify the concrete observer that the attachment took place.
after_attach();
}
/*! Detach the observer from the arrangement. */
void detach()
{
if (p_arr == nullptr) return;
// Notify the concrete observer (the sub-class) about the detachment.
before_detach ();
// Unregister the observer object from the current arrangement, and mark
// that the observer is not attached to an arrangement.
p_arr->_unregister_observer(this);
p_arr = nullptr;
// Notify the concrete observer that the detachment took place.
after_detach();
}
//@}
/// \name Notification functions on global arrangement operations.
//@{
/*! Notification before the arrangement is assigned with another
* arrangement.
* \param arr The arrangement to be copied.
*/
virtual void before_assign(const Arrangement_2& /* arr */) {}
/*! Notification after the arrangement has been assigned with another
* arrangement.
*/
virtual void after_assign() {}
/*! Notification before the arrangement is cleared. */
virtual void before_clear() {}
/*! Notification after the arrangement is cleared. */
virtual void after_clear() {}
/*! Notification before a global operation modifies the arrangement. */
virtual void before_global_change() {}
/*! Notification after a global operation is completed. */
virtual void after_global_change() {}
//@}
/// \name Notification functions on observer attachment or detachment.
//@{
/*! Notification before the observer is attached to an arrangement.
* \param arr The arrangement we are about to attach the observer to.
*/
virtual void before_attach(const Arrangement_2& /* arr */) {}
/*! Notification after the observer has been attached to an arrangement. */
virtual void after_attach() {}
/*! Notification before the observer is detached from the arrangement. */
virtual void before_detach() {}
/*! Notification after the observer has been detached to the arrangement. */
virtual void after_detach() {}
//@}
/// \name Notification functions on local changes in the arrangement.
//@{
/*!
* Notification before the creation of a new vertex.
* \param p The point to be associated with the vertex.
* This point cannot lies on the surface boundaries.
*/
virtual void before_create_vertex(const Point_2& /* p */) {}
/*! Notification after the creation of a new vertex.
* \param v A handle to the created vertex.
*/
virtual void after_create_vertex(Vertex_handle /* v */)
{}
/*! Notification before the creation of a new boundary vertex.
* \param p The on the surface boundary.
* \param ps_x The boundary condition of the vertex in x.
* \param ps_y The boundary condition of the vertex in y.
*/
virtual void before_create_boundary_vertex(const Point_2& /* p */,
Arr_parameter_space /* ps_x */,
Arr_parameter_space /* ps_y */)
{}
/*! Notification before the creation of a new boundary vertex.
* \param cv The curve incident to the surface boundary.
* \param ind The relevant curve-end.
* \param ps_x The boundary condition of the vertex in x.
* \param ps_y The boundary condition of the vertex in y.
*/
virtual void before_create_boundary_vertex(const X_monotone_curve_2& /* cv */,
Arr_curve_end /* ind */,
Arr_parameter_space /* ps_x */,
Arr_parameter_space /* ps_y */)
{}
/*! Notification after the creation of a new vertex at infinity.
* \param v A handle to the created vertex.
*/
virtual void after_create_boundary_vertex(Vertex_handle /* v */) {}
/*! Notification before the creation of a new edge.
* \param c The x-monotone curve to be associated with the edge.
* \param v1 A handle to the first end-vertex of the edge.
* \param v2 A handle to the second end-vertex of the edge.
*/
virtual void before_create_edge(const X_monotone_curve_2& /* c */,
Vertex_handle /* v1 */,
Vertex_handle /* v2 */)
{}
/*! Notification after the creation of a new edge.
* \param e A handle to one of the twin halfedges that were created.
*/
virtual void after_create_edge(Halfedge_handle /* e */) {}
/*! Notification before the modification of an existing vertex.
* \param v A handle to the vertex to be updated.
* \param p The point to be associated with the vertex.
*/
virtual void before_modify_vertex(Vertex_handle /* v */,
const Point_2& /* p */)
{}
/*! Notification after a vertex was modified.
* \param v A handle to the updated vertex.
*/
virtual void after_modify_vertex(Vertex_handle /* v */) {}
/*! Notification before the modification of an existing edge.
* \param e A handle to one of the twin halfedges to be updated.
* \param c The x-monotone curve to be associated with the edge.
*/
virtual void before_modify_edge(Halfedge_handle /* e */,
const X_monotone_curve_2& /* c */)
{}
/*! Notification after an edge was modified.
* \param e A handle to one of the twin halfedges that were updated.
*/
virtual void after_modify_edge(Halfedge_handle /* e */) {}
/*! Notification before the splitting of an edge into two.
* \param e A handle to one of the existing halfedges.
* \param v A vertex representing the split point.
* \param c1 The x-monotone curve to be associated with the first edge.
* \param c2 The x-monotone curve to be associated with the second edge.
*/
virtual void before_split_edge(Halfedge_handle /* e */,
Vertex_handle /* v */,
const X_monotone_curve_2& /* c1 */,
const X_monotone_curve_2& /* c2 */)
{}
/*! Notification after an edge was split.
* \param e1 A handle to one of the twin halfedges forming the first edge.
* \param e2 A handle to one of the twin halfedges forming the second edge.
*/
virtual void after_split_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */)
{}
/*! Notification before the splitting of a fictitious edge into two.
* \param e A handle to one of the existing halfedges.
* \param v A vertex representing the unbounded split point.
*/
virtual void before_split_fictitious_edge(Halfedge_handle /* e */,
Vertex_handle /* v */)
{}
/*! Notification after a fictitious edge was split.
* \param e1 A handle to one of the twin halfedges forming the first edge.
* \param e2 A handle to one of the twin halfedges forming the second edge.
*/
virtual void after_split_fictitious_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */)
{}
/*! Notification before the splitting of a face into two.
* \param f A handle to the existing face.
* \param e The new edge whose insertion causes the face to split.
*/
virtual void before_split_face(Face_handle /* f */,
Halfedge_handle /* e */)
{}
/*! Notification after a face was split.
* \param f A handle to the face we have just split.
* \param new_f A handle to the new face that has been created.
* \param is_hole Whether the new face forms a hole inside f.
*/
virtual void after_split_face(Face_handle /* f */,
Face_handle /* new_f */,
bool /* is_hole */)
{}
/*! Notification before the splitting of an outer CCB into two.
* \param f A handle to the face that owns the outer CCB.
* \param h A circulator representing the component boundary.
* \param e The new edge whose removal causes the outer CCB to split.
*/
virtual void before_split_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */,
Halfedge_handle /* e */)
{}
/*! Notification after an outer CCB was split.
* \param f A handle to the face that owns the outer CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
*/
virtual void after_split_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */)
{}
/*! Notification before the splitting of an inner CCB into two.
* \param f A handle to the face containing the inner CCB.
* \param h A circulator representing the component boundary.
* \param e The new edge whose removal causes the inner CCB to split.
*/
virtual void before_split_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */,
Halfedge_handle /* e */)
{}
/*! Notification after an inner CCB was split.
* \param f A handle to the face containing the inner CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
*/
virtual void after_split_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */)
{}
/*! Notification before the creation of a new outer CCB of a face.
* \param f A handle to the face that owns the outer CCB.
* \param e A halfedge along the new outer CCB.
*/
virtual void before_add_outer_ccb(Face_handle /* f */,
Halfedge_handle /* e */)
{}
/*! Notification after an outer CCB was added to a face.
* \param h A circulator representing the boundary of the new outer CCB.
*/
virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before the creation of a new inner CCB inside a face.
* \param f A handle to the face containing the inner CCB.
* \param e The new halfedge that forms the new inner CCB.
*/
virtual void before_add_inner_ccb(Face_handle /* f */,
Halfedge_handle /* e */)
{}
/*! Notification after an inner CCB was created inside a face.
* \param h A circulator representing the boundary of the new inner CCB.
*/
virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before the creation of a new isolated vertex inside a face.
* \param f A handle to the face containing the isolated vertex.
* \param v The isolated vertex.
*/
virtual void before_add_isolated_vertex(Face_handle /* f */,
Vertex_handle /* v */)
{}
/*! Notification after an isolated vertex was created inside a face.
* \param v The isolated vertex.
*/
virtual void after_add_isolated_vertex(Vertex_handle /* v */) {}
/*! Notification before the merging of two edges.
* \param e1 A handle to one of the halfedges forming the first edge.
* \param e2 A handle to one of the halfedges forming the second edge.
* \param c The x-monotone curve to be associated with the merged edge.
*/
virtual void before_merge_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */,
const X_monotone_curve_2& /* c */)
{}
/*! Notification after an edge was merged.
* \param e A handle to one of the twin halfedges forming the merged edge.
*/
virtual void after_merge_edge(Halfedge_handle /* e */) {}
/*! Notification before the merging of two fictitious edges.
* \param e1 A handle to one of the halfedges forming the first edge.
* \param e2 A handle to one of the halfedges forming the second edge.
*/
virtual void before_merge_fictitious_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */)
{}
/*! Notification after a fictitious edge was merged.
* \param e A handle to one of the twin halfedges forming the merged edge.
*/
virtual void after_merge_fictitious_edge(Halfedge_handle /* e */) {}
/*! Notification before the merging of two faces.
* \param f1 A handle to the first face.
* \param f2 A handle to the second face.
* \param e The edge whose removal causes the faces to merge.
*/
virtual void before_merge_face(Face_handle /* f1 */,
Face_handle /* f2 */,
Halfedge_handle /* e */)
{}
/*! Notification after a face was merged.
* \param f A handle to the merged face.
*/
virtual void after_merge_face(Face_handle /* f */) {}
/*! Notification before the merging of two outer CCBs.
* \param f A handle to the face that owns the outer CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
* \param e The edge whose insertion or removal causes the CCBs to merge.
*/
virtual void before_merge_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */,
Halfedge_handle /* e */)
{}
/*! Notification after an outer CCB was merged.
* \param f A handle to the face that owns the outer CCBs.
* \param h A circulator representing the boundary of the merged component.
*/
virtual void after_merge_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notification before the merging of two inner CCBs (holes).
* \param f A handle to the face that contains the inner CCBs.
* \param h1 A circulator representing the boundary of the first component.
* \param h2 A circulator representing the boundary of the second component.
* \param e The edge whose insertion causes the inner CCBs to merge.
*/
virtual void before_merge_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h1 */,
Ccb_halfedge_circulator /* h2 */,
Halfedge_handle /* e */)
{}
/*! Notification after an inner CCB was merged.
* \param f A handle to the face that contains the inner CCBs.
* \param h A circulator representing the boundary of the merged component.
*/
virtual void after_merge_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notification before an outer CCB is moved from one face to another.
* \param from_f A handle to the face that currently owns the outer CCB.
* \param to_f A handle to the face that should own the outer CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_move_outer_ccb(Face_handle /* from_f */,
Face_handle /* to_f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notification after an outer CCB is moved from one face to another.
* \param h A circulator representing the boundary of the component.
*/
virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before an inner CCB is moved from one face to another.
* \param from_f A handle to the face currently containing the inner CCB.
* \param to_f A handle to the face that should contain the inner CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_move_inner_ccb(Face_handle /* from_f */,
Face_handle /* to_f */,
Ccb_halfedge_circulator /* h */)
{}
/*!
* Notification after an inner CCB is moved from one face to another.
* \param h A circulator representing the boundary of the component.
*/
virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) {}
/*! Notification before an isolated vertex is moved from one face to another.
* \param from_f A handle to the face currently containing the vertex.
* \param to_f A handle to the face that should contain the vertex.
* \param v The isolated vertex.
*/
virtual void before_move_isolated_vertex(Face_handle /* from_f */,
Face_handle /* to_f */,
Vertex_handle /* v */)
{}
/*! Notification after an isolated vertex is moved from one face to another.
* \param v The isolated vertex.
*/
virtual void after_move_isolated_vertex(Vertex_handle /* v */) {}
/*! Notificaion before the removal of a vertex.
* \param v A handle to the vertex to be deleted.
*/
virtual void before_remove_vertex(Vertex_handle /* v */) {}
/*! Notificaion after the removal of a vertex. */
virtual void after_remove_vertex() {}
/*! Notification before the removal of an edge.
* \param e A handle to one of the twin halfedges to be deleted.
*/
virtual void before_remove_edge(Halfedge_handle /* e */) {}
/*! Notificaion after the removal of an edge. */
virtual void after_remove_edge() {}
/*! Notification before the removal of an outer CCB.
* \param f The face that owns the outer CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_remove_outer_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notificaion after the removal of an outer CCB.
* \param f The face that used to own the outer CCB.
*/
virtual void after_remove_outer_ccb(Face_handle /* f */) {}
/*! Notification before the removal of an inner CCB.
* \param f The face containing the inner CCB.
* \param h A circulator representing the boundary of the component.
*/
virtual void before_remove_inner_ccb(Face_handle /* f */,
Ccb_halfedge_circulator /* h */)
{}
/*! Notificaion after the removal of an inner CCB.
* \param f The face that used to contain the inner CCB.
*/
virtual void after_remove_inner_ccb(Face_handle /* f */) {}
//@}
};
} //namespace CGAL
#include <CGAL/enable_warnings.h> #include <CGAL/enable_warnings.h>

View File

@ -20,7 +20,6 @@
* Definition of the Arr_landmarks_generator_base<Arrangement> template. * Definition of the Arr_landmarks_generator_base<Arrangement> template.
*/ */
#include <CGAL/Arr_point_location_result.h> #include <CGAL/Arr_point_location_result.h>
#include <CGAL/Arr_observer.h>
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h> #include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
#include <CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h> #include <CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h>
#include <CGAL/Arr_batched_point_location.h> #include <CGAL/Arr_batched_point_location.h>
@ -43,44 +42,44 @@ namespace CGAL {
*/ */
template <typename Arrangement_, template <typename Arrangement_,
typename Nearest_neighbor_ = typename Nearest_neighbor_ =
Arr_landmarks_nearest_neighbor <Arrangement_> > Arr_landmarks_nearest_neighbor<Arrangement_> >
class Arr_landmarks_generator_base : public Arr_observer <Arrangement_> { class Arr_landmarks_generator_base : public Arrangement_::Observer {
public: public:
typedef Arrangement_ Arrangement_2; using Arrangement_2 = Arrangement_;
typedef Nearest_neighbor_ Nearest_neighbor; using Base_aos = typename Arrangement_2::Base_aos;
typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; using Nearest_neighbor = Nearest_neighbor_;
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle;
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle;
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
typedef typename Arrangement_2::Face_handle Face_handle;
typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator;
typedef typename Arrangement_2::Ccb_halfedge_circulator
Ccb_halfedge_circulator;
typedef typename Arrangement_2::Point_2 Point_2; using Geometry_traits_2 = typename Base_aos::Geometry_traits_2;
typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; using Vertex_const_handle = typename Base_aos::Vertex_const_handle;
using Halfedge_const_handle = typename Base_aos::Halfedge_const_handle;
using Face_const_handle = typename Base_aos::Face_const_handle;
using Vertex_handle = typename Base_aos::Vertex_handle;
using Halfedge_handle = typename Base_aos::Halfedge_handle;
using Face_handle = typename Base_aos::Face_handle;
using Vertex_const_iterator = typename Base_aos::Vertex_const_iterator;
using Ccb_halfedge_circulator = typename Base_aos::Ccb_halfedge_circulator;
typedef typename Nearest_neighbor::NN_Point_2 NN_Point_2; using Point_2 = typename Base_aos::Point_2;
typedef std::list<NN_Point_2> NN_Points_set; using X_monotone_curve_2 = typename Base_aos::X_monotone_curve_2;
typedef std::vector<Point_2> Points_set; using NN_Point_2 = typename Nearest_neighbor::NN_Point_2;
using NN_Points_set = std::list<NN_Point_2>;
typedef Arr_point_location_result<Arrangement_2> PL_result; using Points_set = std::vector<Point_2>;
typedef typename PL_result::Type PL_result_type;
typedef std::pair<Point_2, PL_result_type> PL_pair; using PL_result = Arr_point_location_result<Base_aos>;
typedef std::vector<PL_pair> Pairs_set; using PL_result_type = typename PL_result::Type;
typedef typename std::vector<PL_pair>::iterator Pairs_iterator;
using PL_pair = std::pair<Point_2, PL_result_type>;
using Pairs_set = std::vector<PL_pair>;
using Pairs_iterator = typename std::vector<PL_pair>::iterator;
private: private:
typedef Arr_landmarks_generator_base<Arrangement_2, Nearest_neighbor> using Self = Arr_landmarks_generator_base<Arrangement_2, Nearest_neighbor>;
Self;
protected: protected:
typedef Arr_traits_basic_adaptor_2<Geometry_traits_2> Traits_adaptor_2; using Traits_adaptor_2 = Arr_traits_basic_adaptor_2<Geometry_traits_2>;
// Data members: // Data members:
const Traits_adaptor_2* m_traits; // The associated traits object. const Traits_adaptor_2* m_traits; // The associated traits object.
@ -109,8 +108,8 @@ public:
/*! Constructor from an arrangement. /*! Constructor from an arrangement.
* \param arr (in) The arrangement. * \param arr (in) The arrangement.
*/ */
Arr_landmarks_generator_base(const Arrangement_2& arr) : Arr_landmarks_generator_base(const Base_aos& arr) :
Arr_observer<Arrangement_2> (const_cast<Arrangement_2 &>(arr)), Base_aos::Observer(const_cast<Base_aos&>(arr)),
m_traits(static_cast<const Traits_adaptor_2*>(arr.geometry_traits())), m_traits(static_cast<const Traits_adaptor_2*>(arr.geometry_traits())),
m_ignore_notifications(false), m_ignore_notifications(false),
m_ignore_remove_edge(false), m_ignore_remove_edge(false),
@ -124,8 +123,7 @@ public:
/*! Create the landmarks set (choosing the landmarks) , /*! Create the landmarks set (choosing the landmarks) ,
* and saving them in the nearest-neighbor search structure. * and saving them in the nearest-neighbor search structure.
*/ */
virtual void build_landmark_set() virtual void build_landmark_set() {
{
// Create the landmark points. // Create the landmark points.
NN_Points_set nn_points; NN_Points_set nn_points;
_create_nn_points_set(nn_points); _create_nn_points_set(nn_points);
@ -140,8 +138,7 @@ public:
/*! clear the set of landmarks. /*! clear the set of landmarks.
*/ */
virtual void clear_landmark_set() virtual void clear_landmark_set() {
{
nn.clear(); nn.clear();
num_small_not_updated_changes = 0; num_small_not_updated_changes = 0;
updated = false; updated = false;
@ -153,8 +150,7 @@ public:
* arrangement (a vertex, halfedge, or face handle). * arrangement (a vertex, halfedge, or face handle).
* \return The nearest landmark point. * \return The nearest landmark point.
*/ */
virtual Point_2 closest_landmark(const Point_2& p, PL_result_type& obj) virtual Point_2 closest_landmark(const Point_2& p, PL_result_type& obj) {
{
CGAL_assertion(updated); CGAL_assertion(updated);
return (nn.find_nearest_neighbor(p, obj)); return (nn.find_nearest_neighbor(p, obj));
} }
@ -162,13 +158,13 @@ public:
/// \name Overloaded observer functions on global changes. /// \name Overloaded observer functions on global changes.
//@{ //@{
/*! /*! Notification before the arrangement is assigned with the content of
* Notification before the arrangement is assigned with another * another arrangement.
* arrangement. * \param arr The other arrangement. Notice that the arrangement type is the
* \param arr The arrangement to be copied. * type used to instantiate the observer, which is conveniently
* defined as `Arrangement_2::Base_aos`.
*/ */
virtual void before_assign(const Arrangement_2& arr) virtual void before_assign(const Base_aos& arr) override {
{
this->clear_landmark_set(); this->clear_landmark_set();
m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits()); m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits());
m_ignore_notifications = true; m_ignore_notifications = true;
@ -177,8 +173,7 @@ public:
/*! Notification after the arrangement has been assigned with another /*! Notification after the arrangement has been assigned with another
* arrangement. * arrangement.
*/ */
virtual void after_assign() virtual void after_assign() override {
{
this->build_landmark_set(); this->build_landmark_set();
m_ignore_notifications = false; m_ignore_notifications = false;
} }
@ -186,8 +181,7 @@ public:
/*! Notification before the observer is attached to an arrangement. /*! Notification before the observer is attached to an arrangement.
* \param arr The arrangement we are about to attach the observer to. * \param arr The arrangement we are about to attach the observer to.
*/ */
virtual void before_attach(const Arrangement_2& arr) virtual void before_attach(const Base_aos& arr) override {
{
this->clear_landmark_set(); this->clear_landmark_set();
m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits()); m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits());
m_ignore_notifications = true; m_ignore_notifications = true;
@ -195,38 +189,33 @@ public:
/*! Notification after the observer has been attached to an arrangement. /*! Notification after the observer has been attached to an arrangement.
*/ */
virtual void after_attach() virtual void after_attach() override {
{
this->build_landmark_set(); this->build_landmark_set();
m_ignore_notifications = false; m_ignore_notifications = false;
} }
/*! Notification before the observer is detached from the arrangement. /*! Notification before the observer is detached from the arrangement.
*/ */
virtual void before_detach() virtual void before_detach() override { this->clear_landmark_set(); }
{ this->clear_landmark_set(); }
/*! Notification after the arrangement is cleared. /*! Notification after the arrangement is cleared.
* \param u A handle to the unbounded face. * \param u A handle to the unbounded face.
*/ */
virtual void after_clear() virtual void after_clear() override {
{
this->clear_landmark_set(); this->clear_landmark_set();
this->build_landmark_set(); this->build_landmark_set();
} }
/*! Notification before a global operation modifies the arrangement. /*! Notification before a global operation modifies the arrangement.
*/ */
virtual void before_global_change() virtual void before_global_change() override {
{
this->clear_landmark_set(); this->clear_landmark_set();
m_ignore_notifications = true; m_ignore_notifications = true;
} }
/*! Notification after a global operation is completed. /*! Notification after a global operation is completed.
*/ */
virtual void after_global_change() virtual void after_global_change() override {
{
this->build_landmark_set(); this->build_landmark_set();
m_ignore_notifications = false; m_ignore_notifications = false;
} }
@ -238,12 +227,11 @@ public:
/*! Notification before the removal of an edge. /*! Notification before the removal of an edge.
* \param e (in) A handle to one of the twin halfedges to be removed. * \param e (in) A handle to one of the twin halfedges to be removed.
*/ */
virtual void before_remove_edge(Halfedge_handle /* e */) virtual void before_remove_edge(Halfedge_handle /* e */) override
{ m_ignore_remove_edge = true; } { m_ignore_remove_edge = true; }
/*! Notification after the creation of a new vertex. */ /*! Notification after the creation of a new vertex. */
virtual void after_create_vertex(Vertex_handle) virtual void after_create_vertex(Vertex_handle) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -251,8 +239,7 @@ public:
} }
/*! Notification after the creation of a new edge. */ /*! Notification after the creation of a new edge. */
virtual void after_create_edge(Halfedge_handle) virtual void after_create_edge(Halfedge_handle) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -260,8 +247,7 @@ public:
} }
/*! Notification after an edge was split. */ /*! Notification after an edge was split. */
virtual void after_split_edge(Halfedge_handle, Halfedge_handle) virtual void after_split_edge(Halfedge_handle, Halfedge_handle) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -269,8 +255,7 @@ public:
} }
/*! Notification after a face was split. */ /*! Notification after a face was split. */
virtual void after_split_face(Face_handle, Face_handle, bool) virtual void after_split_face(Face_handle, Face_handle, bool) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -280,8 +265,7 @@ public:
/*! Notification after an outer CCB was split.*/ /*! Notification after an outer CCB was split.*/
virtual void after_split_outer_ccb(Face_handle, virtual void after_split_outer_ccb(Face_handle,
Ccb_halfedge_circulator, Ccb_halfedge_circulator,
Ccb_halfedge_circulator) Ccb_halfedge_circulator) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -291,8 +275,7 @@ public:
/*! Notification after an inner CCB was split. */ /*! Notification after an inner CCB was split. */
virtual void after_split_inner_ccb(Face_handle, virtual void after_split_inner_ccb(Face_handle,
Ccb_halfedge_circulator, Ccb_halfedge_circulator,
Ccb_halfedge_circulator) Ccb_halfedge_circulator) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -300,8 +283,7 @@ public:
} }
/*! Notification after an outer CCB was added to a face. */ /*! Notification after an outer CCB was added to a face. */
virtual void after_add_outer_ccb(Ccb_halfedge_circulator) virtual void after_add_outer_ccb(Ccb_halfedge_circulator) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -309,8 +291,7 @@ public:
} }
/*! Notification after an inner CCB was created inside a face. */ /*! Notification after an inner CCB was created inside a face. */
virtual void after_add_inner_ccb(Ccb_halfedge_circulator) virtual void after_add_inner_ccb(Ccb_halfedge_circulator) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -318,8 +299,7 @@ public:
} }
/*! Notification after an isolated vertex was created inside a face. */ /*! Notification after an isolated vertex was created inside a face. */
virtual void after_add_isolated_vertex(Vertex_handle) virtual void after_add_isolated_vertex(Vertex_handle) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -327,8 +307,7 @@ public:
} }
/*! Notification after an edge was merged. */ /*! Notification after an edge was merged. */
virtual void after_merge_edge(Halfedge_handle) virtual void after_merge_edge(Halfedge_handle) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -336,8 +315,7 @@ public:
} }
/*! Notification after a face was merged. */ /*! Notification after a face was merged. */
virtual void after_merge_face(Face_handle) virtual void after_merge_face(Face_handle) override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -346,7 +324,7 @@ public:
/*! Notification after an outer CCB was merged. */ /*! Notification after an outer CCB was merged. */
virtual void after_merge_outer_ccb(Face_handle, Ccb_halfedge_circulator) virtual void after_merge_outer_ccb(Face_handle, Ccb_halfedge_circulator)
{ override {
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -355,7 +333,7 @@ public:
/*! Notification after an inner CCB was merged. */ /*! Notification after an inner CCB was merged. */
virtual void after_merge_inner_ccb(Face_handle, Ccb_halfedge_circulator) virtual void after_merge_inner_ccb(Face_handle, Ccb_halfedge_circulator)
{ override {
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -363,8 +341,7 @@ public:
} }
/*! Notification after an outer CCB is moved from one face to another. */ /*! Notification after an outer CCB is moved from one face to another. */
virtual void after_move_outer_ccb(Ccb_halfedge_circulator ) virtual void after_move_outer_ccb(Ccb_halfedge_circulator) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -372,8 +349,7 @@ public:
} }
/*! Notification after an inner CCB is moved from one face to another. */ /*! Notification after an inner CCB is moved from one face to another. */
virtual void after_move_inner_ccb(Ccb_halfedge_circulator ) virtual void after_move_inner_ccb(Ccb_halfedge_circulator) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -381,8 +357,7 @@ public:
} }
/*! Notification after an isolated vertex is moved. */ /*! Notification after an isolated vertex is moved. */
virtual void after_move_isolated_vertex(Vertex_handle ) virtual void after_move_isolated_vertex(Vertex_handle) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -390,8 +365,7 @@ public:
} }
/*! Notificaion after the removal of a vertex. */ /*! Notificaion after the removal of a vertex. */
virtual void after_remove_vertex() virtual void after_remove_vertex() override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -399,8 +373,7 @@ public:
} }
/*! Notification after the removal of an edge. */ /*! Notification after the removal of an edge. */
virtual void after_remove_edge() virtual void after_remove_edge() override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -409,8 +382,7 @@ public:
} }
/*! Notificaion after the removal of an outer CCB. */ /*! Notificaion after the removal of an outer CCB. */
virtual void after_remove_outer_ccb(Face_handle) virtual void after_remove_outer_ccb(Face_handle) override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -418,8 +390,7 @@ public:
} }
/*! Notificaion after the removal of an inner CCB. */ /*! Notificaion after the removal of an inner CCB. */
virtual void after_remove_inner_ccb(Face_handle) virtual void after_remove_inner_ccb(Face_handle) override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_landmark_set(); clear_landmark_set();
build_landmark_set(); build_landmark_set();
@ -434,8 +405,7 @@ protected:
*/ */
virtual void _create_points_set(Points_set&) = 0; virtual void _create_points_set(Points_set&) = 0;
virtual void _create_nn_points_set(NN_Points_set& nn_points) virtual void _create_nn_points_set(NN_Points_set& nn_points) {
{
Points_set points; Points_set points;
Pairs_set pairs; Pairs_set pairs;
@ -453,8 +423,7 @@ protected:
// Insert all landmarks (paired with their current location in the // Insert all landmarks (paired with their current location in the
// arrangement) into the nearest-neighbor search structure. // arrangement) into the nearest-neighbor search structure.
Pairs_iterator itr; for (auto itr = pairs.begin(); itr != pairs.end(); ++itr) {
for (itr = pairs.begin(); itr != pairs.end(); ++itr) {
NN_Point_2 np(itr->first, itr->second); NN_Point_2 np(itr->first, itr->second);
nn_points.push_back(np); nn_points.push_back(np);
} }

View File

@ -98,14 +98,13 @@ public:
virtual void build_landmark_set() virtual void build_landmark_set()
{ {
// Go over the arrangement, and insert all its vertices as landmarks. // Go over the arrangement, and insert all its vertices as landmarks.
NN_Point_list nnp_list; NN_Point_list nnp_list;
const Arrangement_2* arr = this->arrangement(); const auto* arr = this->arrangement();
Vertex_const_iterator vit;
num_landmarks = 0; num_landmarks = 0;
for (vit = arr->vertices_begin(); vit != arr->vertices_end(); ++vit) { for (auto vit = arr->vertices_begin(); vit != arr->vertices_end(); ++vit) {
Vertex_const_handle vh = vit; Vertex_const_handle vh = vit;
nnp_list.push_back(NN_Point_2(vh->point(), this->pl_make_result(vh))); nnp_list.push_back(NN_Point_2(vh->point(), this->pl_make_result(vh)));
num_landmarks++; ++num_landmarks;
} }
// Update the search structure. // Update the search structure.

View File

@ -177,6 +177,7 @@ public:
//typedef of arrangement on surface //typedef of arrangement on surface
typedef typename Traits::Arrangement_on_surface_2 Arrangement_on_surface_2; typedef typename Traits::Arrangement_on_surface_2 Arrangement_on_surface_2;
using Base_aos = typename Arrangement_on_surface_2::Base_aos;
//type of traits adaptor //type of traits adaptor
typedef typename Traits::Arrangement_on_surface_2::Traits_adaptor_2 typedef typename Traits::Arrangement_on_surface_2::Traits_adaptor_2
@ -1804,7 +1805,7 @@ public:
return m_number_of_curves; return m_number_of_curves;
} }
void init_arrangement_and_traits(const Arrangement_on_surface_2* arr, void init_arrangement_and_traits(const Base_aos* arr,
bool allocate_traits = true) bool allocate_traits = true)
{ {
m_arr = arr; m_arr = arr;
@ -2125,7 +2126,7 @@ protected:
unsigned long m_number_of_curves; unsigned long m_number_of_curves;
const Traits* traits; const Traits* traits;
//Before_split_data m_before_split; //Before_split_data m_before_split;
const Arrangement_on_surface_2* m_arr; const Base_aos* m_arr;
const Traits_adaptor_2* m_trts_adaptor; const Traits_adaptor_2* m_trts_adaptor;
Halfedge_const_handle m_empty_he_handle; Halfedge_const_handle m_empty_he_handle;

View File

@ -8,8 +8,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Idit Haran <haranidi@post.tau.ac.il> // Author(s): Idit Haran <haranidi@post.tau.ac.il>
// (based on old version by Oren Nechushtan and Iddo Hanniel) // (based on old version by Oren Nechushtan and Iddo Hanniel)
#ifndef CGAL_ARR_TRAPEZOID_RIC_POINT_LOCATION_H #ifndef CGAL_ARR_TRAPEZOID_RIC_POINT_LOCATION_H
#define CGAL_ARR_TRAPEZOID_RIC_POINT_LOCATION_H #define CGAL_ARR_TRAPEZOID_RIC_POINT_LOCATION_H
@ -26,7 +26,6 @@
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h> #include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h> #include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <CGAL/Arr_point_location/Td_traits.h> #include <CGAL/Arr_point_location/Td_traits.h>
#include <CGAL/Arr_observer.h>
namespace CGAL { namespace CGAL {
@ -36,96 +35,95 @@ namespace CGAL {
* The Arrangement parameter corresponds to an arrangement instantiation. * The Arrangement parameter corresponds to an arrangement instantiation.
*/ */
template <typename Arrangement_> template <typename Arrangement_>
class Arr_trapezoid_ric_point_location : public Arr_observer <Arrangement_> { class Arr_trapezoid_ric_point_location : public Arrangement_::Observer {
public: public:
//type of arrangement on surface //type of arrangement on surface
typedef Arrangement_ Arrangement_on_surface_2; using Arrangement_on_surface_2 = Arrangement_;
using Base_aos = typename Arrangement_on_surface_2::Base_aos;
//type of geometry traits //type of geometry traits
typedef typename Arrangement_on_surface_2::Geometry_traits_2 using Geometry_traits_2 = typename Base_aos::Geometry_traits_2;
Geometry_traits_2;
//type of traits adaptor //type of traits adaptor
typedef typename Arrangement_on_surface_2::Traits_adaptor_2 using Traits_adaptor_2 = typename Base_aos::Traits_adaptor_2;
Traits_adaptor_2;
//type of vertex handle //type of vertex handle
typedef typename Arrangement_on_surface_2::Vertex_handle using Vertex_handle = typename Base_aos::Vertex_handle;
Vertex_handle;
//type of vertex const handle //type of vertex const handle
typedef typename Arrangement_on_surface_2::Vertex_const_handle using Vertex_const_handle = typename Base_aos::Vertex_const_handle;
Vertex_const_handle;
//type of halfedge handle //type of halfedge handle
typedef typename Arrangement_on_surface_2::Halfedge_handle using Halfedge_handle = typename Base_aos::Halfedge_handle;
Halfedge_handle;
//type of halfedge const handle //type of halfedge const handle
typedef typename Arrangement_on_surface_2::Halfedge_const_handle using Halfedge_const_handle = typename Base_aos::Halfedge_const_handle;
Halfedge_const_handle;
//type of face const handle //type of face const handle
typedef typename Arrangement_on_surface_2::Face_const_handle using Face_const_handle = typename Base_aos::Face_const_handle;
Face_const_handle;
//type of edge const iterator //type of edge const iterator
typedef typename Arrangement_on_surface_2::Edge_const_iterator using Edge_const_iterator = typename Base_aos::Edge_const_iterator;
Edge_const_iterator;
//type of isolated vertex const iterator //type of isolated vertex const iterator
typedef typename Arrangement_on_surface_2::Isolated_vertex_const_iterator using Isolated_vertex_const_iterator =
Isolated_vertex_const_iterator; typename Base_aos::Isolated_vertex_const_iterator;
//type of point //type of point
typedef typename Geometry_traits_2::Point_2 Point_2; using Point_2 = typename Geometry_traits_2::Point_2;
//type of x-monotone curve //type of x-monotone curve
typedef typename Geometry_traits_2::X_monotone_curve_2 using X_monotone_curve_2 = typename Geometry_traits_2::X_monotone_curve_2;
X_monotone_curve_2;
//type of trapezoidal decomposition traits class //type of trapezoidal decomposition traits class
typedef CGAL::Td_traits<Traits_adaptor_2, Arrangement_on_surface_2> using Td_traits = CGAL::Td_traits<Traits_adaptor_2, Base_aos>;
Td_traits;
//type of trapezoidal decomposition class //type of trapezoidal decomposition class
typedef Trapezoidal_decomposition_2<Td_traits> using Trapezoidal_decomposition = Trapezoidal_decomposition_2<Td_traits>;
Trapezoidal_decomposition;
//!types of Td_map_item-s //!types of Td_map_item-s
typedef typename Trapezoidal_decomposition::Td_map_item using Td_map_item = typename Trapezoidal_decomposition::Td_map_item;
Td_map_item; using Td_active_vertex = typename Trapezoidal_decomposition::Td_active_vertex;
typedef typename Trapezoidal_decomposition::Td_active_vertex using Td_active_fictitious_vertex =
Td_active_vertex; typename Trapezoidal_decomposition::Td_active_fictitious_vertex;
typedef typename Trapezoidal_decomposition::Td_active_fictitious_vertex using Td_active_edge = typename Trapezoidal_decomposition::Td_active_edge;
Td_active_fictitious_vertex; using Td_active_trapezoid =
typedef typename Trapezoidal_decomposition::Td_active_edge typename Trapezoidal_decomposition::Td_active_trapezoid;
Td_active_edge;
typedef typename Trapezoidal_decomposition::Td_active_trapezoid
Td_active_trapezoid;
//!type of side tags //!type of side tags
typedef typename Traits_adaptor_2::Left_side_category Left_side_category; using Left_side_category = typename Traits_adaptor_2::Left_side_category;
typedef typename Traits_adaptor_2::Bottom_side_category Bottom_side_category; using Bottom_side_category = typename Traits_adaptor_2::Bottom_side_category;
typedef typename Traits_adaptor_2::Top_side_category Top_side_category; using Top_side_category = typename Traits_adaptor_2::Top_side_category;
typedef typename Traits_adaptor_2::Right_side_category Right_side_category; using Right_side_category = typename Traits_adaptor_2::Right_side_category;
protected: protected:
typedef Arr_point_location_result<Arrangement_on_surface_2> Result; using Result = Arr_point_location_result<Base_aos>;
typedef typename Result::Type Result_type; using Result_type = typename Result::Type;
public: public:
// Support cpp11::result_of // Support cpp11::result_of
typedef Result_type result_type; using result_type = Result_type;
protected: protected:
//type of trapezoidal decomposition class //type of trapezoidal decomposition class
typedef Trapezoidal_decomposition TD; using TD = Trapezoidal_decomposition;
typedef typename Arr_all_sides_oblivious_category<Left_side_category, using All_sides_oblivious_category=
Bottom_side_category, typename Arr_all_sides_oblivious_category<Left_side_category,
Top_side_category, Bottom_side_category,
Right_side_category>::result Top_side_category,
All_sides_oblivious_category; Right_side_category>::result;
// Data members: // Data members:
const Traits_adaptor_2* m_traits; // Its associated traits object. const Traits_adaptor_2* m_traits; // Its associated traits object.
TD td; // instance of trapezoidal decomposition TD td; // instance of trapezoidal decomposition
bool m_with_guarantees; bool m_with_guarantees;
//for the notification functions //for the notification functions
X_monotone_curve_2 m_cv_before_split; X_monotone_curve_2 m_cv_before_split;
Halfedge_handle m_he_after_merge; Halfedge_handle m_he_after_merge;
//X_monotone_curve_2 m_cv_before_merge1; //X_monotone_curve_2 m_cv_before_merge1;
//X_monotone_curve_2 m_cv_before_merge2; //X_monotone_curve_2 m_cv_before_merge2;
template <typename T> template <typename T>
Result_type make_result(T t) const { return Result::make_result(t); } Result_type make_result(T t) const { return Result::make_result(t); }
@ -133,26 +131,25 @@ protected:
public: public:
/*! Default constructor. */ /*! Default constructor. */
Arr_trapezoid_ric_point_location(bool with_guarantees = true, Arr_trapezoid_ric_point_location
double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, (bool with_guarantees = true,
double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD,
m_traits(nullptr), m_with_guarantees(with_guarantees) double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) :
{ m_traits(nullptr), m_with_guarantees(with_guarantees) {
td.set_with_guarantees(with_guarantees); td.set_with_guarantees(with_guarantees);
td.depth_threshold(depth_thrs); td.depth_threshold(depth_thrs);
td.size_threshold(size_thrs); td.size_threshold(size_thrs);
} }
/*! Constructor given an arrangement. */ /*! Constructor given an arrangement. */
Arr_trapezoid_ric_point_location (const Arrangement_on_surface_2& arr, Arr_trapezoid_ric_point_location
bool with_guarantees = true, (const Base_aos& arr,
double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, bool with_guarantees = true,
double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD,
Arr_observer<Arrangement_on_surface_2> double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) :
(const_cast<Arrangement_on_surface_2 &>(arr)), Base_aos::Observer(const_cast<Base_aos&>(arr)),
m_with_guarantees(with_guarantees) m_with_guarantees(with_guarantees) {
{ m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits());
m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits());
td.set_with_guarantees(with_guarantees); td.set_with_guarantees(with_guarantees);
td.init_arrangement_and_traits(&arr); td.init_arrangement_and_traits(&arr);
td.depth_threshold(depth_thrs); td.depth_threshold(depth_thrs);
@ -161,17 +158,15 @@ public:
} }
/*! Destructor. */ /*! Destructor. */
~Arr_trapezoid_ric_point_location () { } ~Arr_trapezoid_ric_point_location() { }
/*! defines whether the underlying search structure guarantees logarithmic /*! defines whether the underlying search structure guarantees logarithmic
* query time and linear size */ * query time and linear size */
void with_guarantees (bool with_guarantees) void with_guarantees(bool with_guarantees) {
{
//if with_guarantees was changed from false to true - reconstruct //if with_guarantees was changed from false to true - reconstruct
// the search structure with guarantees // the search structure with guarantees
td.set_with_guarantees(with_guarantees); td.set_with_guarantees(with_guarantees);
if (with_guarantees && !m_with_guarantees) if (with_guarantees && !m_with_guarantees) {
{
td.clear(); td.clear();
_construct_td(); _construct_td();
} }
@ -182,30 +177,20 @@ public:
* (the longest path in the DAG) * (the longest path in the DAG)
*/ */
unsigned long depth() //longest_dag_path() unsigned long depth() //longest_dag_path()
{ { return td.largest_leaf_depth() + 1; }
return td.largest_leaf_depth() + 1;
}
/*! returns the longest query path in the underlying search structure */ /*! returns the longest query path in the underlying search structure */
unsigned long longest_query_path_length() unsigned long longest_query_path_length()
{ { return td.longest_query_path_length(); }
return td.longest_query_path_length();
}
#ifdef CGAL_TD_DEBUG #ifdef CGAL_TD_DEBUG
//void locate_and_print (std::ostream& out, const Point_2& p) const //void locate_and_print (std::ostream& out, const Point_2& p) const
//{ //{ td.locate_and_print(out, p); }
// td.locate_and_print(out, p);
//}
void print_dag(std::ostream& out) const void print_dag(std::ostream& out) const { td.print_dag(out); }
{
td.print_dag(out);
}
#endif #endif
/*! /*! Locate the arrangement feature containing the given point.
* Locate the arrangement feature containing the given point.
* \param p The query point. * \param p The query point.
* \return An object representing the arrangement feature containing the * \return An object representing the arrangement feature containing the
* query point. This object is either a Face_const_handle or a * query point. This object is either a Face_const_handle or a
@ -213,8 +198,7 @@ public:
*/ */
result_type locate(const Point_2& p) const; result_type locate(const Point_2& p) const;
/*! /*! Locate the arrangement feature which a upward vertical ray emanating from
* Locate the arrangement feature which a upward vertical ray emanating from
* the given point hits. * the given point hits.
* \param p The query point. * \param p The query point.
* \return An object representing the arrangement feature the ray hits. * \return An object representing the arrangement feature the ray hits.
@ -224,8 +208,7 @@ public:
result_type ray_shoot_up(const Point_2& p) const result_type ray_shoot_up(const Point_2& p) const
{ return (_vertical_ray_shoot(p, true)); } { return (_vertical_ray_shoot(p, true)); }
/*! /*! Locate the arrangement feature which a downward vertical ray emanating
* Locate the arrangement feature which a downward vertical ray emanating
* from the given point hits. * from the given point hits.
* \param p The query point. * \param p The query point.
* \return An object representing the arrangement feature the ray hits. * \return An object representing the arrangement feature the ray hits.
@ -239,72 +222,62 @@ public:
// base observer. // base observer.
//@{ //@{
virtual void before_assign (const Arrangement_on_surface_2& arr) /*! Notification before the arrangement is assigned with the content of
{ * another arrangement.
* \param arr The other arrangement. Notice that the arrangement type is the
* type used to instantiate the observer, which is conveniently
* defined as `Arrangement_2::Base_aos`.
*/
virtual void before_assign(const Base_aos& arr) override {
td.clear(); td.clear();
m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits()); m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits());
td.init_arrangement_and_traits(&arr, false); td.init_arrangement_and_traits(&arr, false);
} }
virtual void after_assign () virtual void after_assign() override { _construct_td(); }
{
_construct_td();
}
virtual void before_clear () virtual void before_clear() override { td.clear(); }
{
td.clear();
}
virtual void after_clear () virtual void after_clear() override { _construct_td(); }
{
_construct_td();
}
virtual void before_attach (const Arrangement_on_surface_2& arr) /*! Notification before the observer is attached to an arrangement.
{ * \param arr The arrangement that is about to attach the observer. Notice
* that the arrangement type is the type used to instantiate the
* observer, which is conveniently defined as
* `Arrangement_2::Base_aos`.
*/
virtual void before_attach(const Base_aos& arr) override {
td.clear(); td.clear();
m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits()); m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits());
td.init_arrangement_and_traits(&arr); td.init_arrangement_and_traits(&arr);
} }
virtual void after_attach () virtual void after_attach() override { _construct_td(); }
{
_construct_td();
}
virtual void before_detach () virtual void before_detach() override { td.clear(); }
{
td.clear();
}
virtual void after_create_edge (Halfedge_handle e) virtual void after_create_edge(Halfedge_handle e) override { td.insert(e); }
{
td.insert(e);
}
//TODO IDIT OREN: what can be done in order to avoid the need //TODO IDIT OREN: what can be done in order to avoid the need
//to save the original curve is to find the common endpoint of the //to save the original curve is to find the common endpoint of the
//two new halfedges, locate it in the trapezoid in order to find the //two new halfedges, locate it in the trapezoid in order to find the
//curve it lies on, which is the curve that was split, and then remove //curve it lies on, which is the curve that was split, and then remove
//this curve. //this curve.
virtual void before_split_edge (Halfedge_handle e, virtual void before_split_edge(Halfedge_handle e,
Vertex_handle /* v */, Vertex_handle /* v */,
const X_monotone_curve_2& /* cv1 */ , const X_monotone_curve_2& /* cv1 */,
const X_monotone_curve_2& /* cv2 */ ) const X_monotone_curve_2& /* cv2 */) override {
{
////MICHAL: commented due to inefficient depth update, remove and insert instead ////MICHAL: commented due to inefficient depth update, remove and insert
////save the curve for the "after" function. ////instead save the curve for the "after" function.
//m_cv_before_split = e->curve(); //m_cv_before_split = e->curve();
//td.before_split_edge(m_cv_before_split, cv1, cv2); //td.before_split_edge(m_cv_before_split, cv1, cv2);
td.remove(e); td.remove(e);
} }
virtual void after_split_edge (Halfedge_handle e1, virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2)
Halfedge_handle e2) override {
{
//MICHAL: commented due to inefficient depth update, remove and insert instead //MICHAL: commented due to inefficient depth update, remove and insert instead
//td.split_edge(m_cv_before_split,e1,e2); //td.split_edge(m_cv_before_split,e1,e2);
@ -312,29 +285,20 @@ public:
td.insert(e2); td.insert(e2);
} }
virtual void before_merge_edge (Halfedge_handle e1, virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2,
Halfedge_handle e2, const X_monotone_curve_2& cv) override {
const X_monotone_curve_2& cv)
{
//save the halfedge handle for the "after" function. //save the halfedge handle for the "after" function.
m_he_after_merge = e1; m_he_after_merge = e1;
td.merge_edge (e1, e2, cv); td.merge_edge (e1, e2, cv);
} }
virtual void after_merge_edge (Halfedge_handle e) virtual void after_merge_edge(Halfedge_handle e) override
{ { td.after_merge_edge(e, m_he_after_merge); }
td.after_merge_edge(e, m_he_after_merge);
}
virtual void before_remove_edge (Halfedge_handle e) virtual void before_remove_edge(Halfedge_handle e) override { td.remove(e); }
{
//called before combinatoric deletion
td.remove(e);
}
//@} //@}
public: public:
//#ifdef CGAL_TD_DEBUG //#ifdef CGAL_TD_DEBUG
// void debug() // void debug()
// { // {
@ -343,27 +307,22 @@ public:
//#endif //#endif
protected: protected:
/*! Construct the trapezoidal decomposition. */ /*! Construct the trapezoidal decomposition. */
void _construct_td () void _construct_td() {
{
td.clear(); td.clear();
std::vector<Halfedge_const_handle> he_container; std::vector<Halfedge_const_handle> he_container;
Edge_const_iterator eit; auto* arr = this->arrangement();
Halfedge_const_handle he_cst;
Arrangement_on_surface_2 *arr = this->arrangement();
//collect the arrangement halfedges //collect the arrangement halfedges
for (eit = arr->edges_begin(); eit != arr->edges_end(); ++eit) for (auto eit = arr->edges_begin(); eit != arr->edges_end(); ++eit) {
{ Halfedge_const_handle he_cst = eit;
he_cst = eit;
he_container.push_back(he_cst); he_container.push_back(he_cst);
} }
//container insertion //container insertion
td.insert(he_container.begin(), he_container.end()); td.insert(he_container.begin(), he_container.end());
} }
/*! gets the unbounded face that contains the point when the trapezoid is /*! Obtain the unbounded face that contains the point when the trapezoid is
* unbounded * unbounded
* \param tr The unbounded trapezoid whose face we should get * \param tr The unbounded trapezoid whose face we should get
* \param p The query point. * \param p The query point.
@ -371,24 +330,23 @@ protected:
* \return A Face_const_handle representing the arrangement unbounded face in * \return A Face_const_handle representing the arrangement unbounded face in
* which the point p lies * which the point p lies
*/ */
Face_const_handle _get_unbounded_face (const Td_map_item& tr, Face_const_handle _get_unbounded_face(const Td_map_item& tr,
const Point_2& p, const Point_2& p,
Arr_all_sides_oblivious_tag) const; Arr_all_sides_oblivious_tag) const;
/*! gets the unbounded face that contains the point when the trapezoid is /*! Obtain the unbounded face that contains the point when the trapezoid is
* unbounded * unbounded
* \param tr The unbounded trapezoid whose face we should get * \param tr The unbounded trapezoid whose face we should get
* \param p The query point. * \param p The query point.
* \param Arr_not_all_sides_oblivious_tag * \param Arr_not_all_sides_oblivious_tag
* \return A Face_const_handle representing the arrangement unbounded face in which * \return A Face_const_handle representing the arrangement unbounded face in
* the point p lies * which the point p lies
*/ */
Face_const_handle _get_unbounded_face (const Td_map_item& tr, Face_const_handle _get_unbounded_face(const Td_map_item& tr,
const Point_2& p, const Point_2& p,
Arr_not_all_sides_oblivious_tag) const; Arr_not_all_sides_oblivious_tag) const;
/*! /*! Locate the arrangement feature which a vertical ray emanating from the
* Locate the arrangement feature which a vertical ray emanating from the
* given point hits, considering isolated vertices. * given point hits, considering isolated vertices.
* \param p The query point. * \param p The query point.
* \param shoot_up Indicates whether the ray is directed upward or downward. * \param shoot_up Indicates whether the ray is directed upward or downward.
@ -403,11 +361,10 @@ protected:
* we check the isolated vertices inside the face to check whether there * we check the isolated vertices inside the face to check whether there
* is an isolated vertex right above/below the query point. * is an isolated vertex right above/below the query point.
*/ */
result_type result_type _check_isolated_for_vertical_ray_shoot
_check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found,
(Halfedge_const_handle halfedge_found, const Point_2& p, bool shoot_up,
const Point_2& p, bool shoot_up, const Td_map_item& tr) const;
const Td_map_item& tr) const;
}; };
} //namespace CGAL } //namespace CGAL

View File

@ -21,7 +21,6 @@
* Definition of the Arr_triangulation_point_location<Arrangement> template. * Definition of the Arr_triangulation_point_location<Arrangement> template.
*/ */
#include <CGAL/Arr_observer.h>
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h> #include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
#include <CGAL/Arr_point_location_result.h> #include <CGAL/Arr_point_location_result.h>
@ -39,73 +38,70 @@ namespace CGAL {
* triangulation algorithm. * triangulation algorithm.
*/ */
template <typename Arrangement_> template <typename Arrangement_>
class Arr_triangulation_point_location : public Arr_observer<Arrangement_> class Arr_triangulation_point_location : public Arrangement_::Observer {
{
public: public:
typedef Arrangement_ Arrangement_2; using Arrangement_2 = Arrangement_;
using Base_aos = typename Arrangement_2::Base_aos;
typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; using Geometry_traits_2 = typename Base_aos::Geometry_traits_2;
typedef typename Geometry_traits_2::Kernel Kernel; using Kernel = typename Geometry_traits_2::Kernel;
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; using Vertex_const_handle = typename Base_aos::Vertex_const_handle;
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; using Halfedge_const_handle = typename Base_aos::Halfedge_const_handle;
typedef typename Arrangement_2::Face_const_handle Face_const_handle; using Face_const_handle = typename Base_aos::Face_const_handle;
typedef typename Arrangement_2::Vertex_handle Vertex_handle; using Vertex_handle = typename Base_aos::Vertex_handle;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; using Halfedge_handle = typename Base_aos::Halfedge_handle;
typedef typename Arrangement_2::Face_handle Face_handle; using Face_handle = typename Base_aos::Face_handle;
typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; using Vertex_const_iterator = typename Base_aos::Vertex_const_iterator;
typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; using Edge_const_iterator = typename Base_aos::Edge_const_iterator;
typedef typename Arrangement_2::Face_const_iterator Face_const_iterator; using Face_const_iterator = typename Base_aos::Face_const_iterator;
typedef typename Arrangement_2::Halfedge_const_iterator using Halfedge_const_iterator = typename Base_aos::Halfedge_const_iterator;
Halfedge_const_iterator; using Halfedge_around_vertex_const_circulator =
typedef typename Arrangement_2::Halfedge_around_vertex_const_circulator typename Base_aos::Halfedge_around_vertex_const_circulator;
Halfedge_around_vertex_const_circulator; using Ccb_halfedge_const_circulator =
typedef typename Arrangement_2::Ccb_halfedge_const_circulator typename Base_aos::Ccb_halfedge_const_circulator;
Ccb_halfedge_const_circulator; using Ccb_halfedge_circulator = typename Base_aos::Ccb_halfedge_circulator;
typedef typename Arrangement_2::Ccb_halfedge_circulator using Isolated_vertex_const_iterator =
Ccb_halfedge_circulator; typename Base_aos::Isolated_vertex_const_iterator;
typedef typename Arrangement_2::Isolated_vertex_const_iterator
Isolated_vertex_const_iterator;
typedef typename Geometry_traits_2::Point_2 Point_2; using Point_2 = typename Geometry_traits_2::Point_2;
typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; using X_monotone_curve_2 = typename Geometry_traits_2::X_monotone_curve_2;
typedef std::list<Halfedge_const_handle> Edge_list; using Edge_list = std::list<Halfedge_const_handle>;
typedef typename Edge_list::iterator Std_edge_iterator; using Std_edge_iterator = typename Edge_list::iterator;
//---------------------------------------------------------- //----------------------------------------------------------
// Triangulation Types // Triangulation Types
//---------------------------------------------------------- //----------------------------------------------------------
typedef Triangulation_vertex_base_with_info_2<Vertex_const_handle, Kernel> using Vbb = Triangulation_vertex_base_with_info_2<Vertex_const_handle, Kernel>;
Vbb; using Vb = Triangulation_hierarchy_vertex_base_2<Vbb>;
typedef Triangulation_hierarchy_vertex_base_2<Vbb> Vb;
//typedef Triangulation_face_base_with_info_2<CGAL::IO::Color,Kernel> Fbt; //typedef Triangulation_face_base_with_info_2<CGAL::IO::Color,Kernel> Fbt;
typedef Constrained_triangulation_face_base_2<Kernel> Fb; using Fb = Constrained_triangulation_face_base_2<Kernel>;
typedef Triangulation_data_structure_2<Vb,Fb> TDS; using TDS = Triangulation_data_structure_2<Vb,Fb>;
typedef Exact_predicates_tag Itag; using Itag = Exact_predicates_tag;
//typedef Constrained_Delaunay_triangulation_2<Kernel, TDS, Itag> CDT; //typedef Constrained_Delaunay_triangulation_2<Kernel, TDS, Itag> CDT;
typedef Constrained_Delaunay_triangulation_2<Kernel, TDS, Itag> CDT_t; using CDT_t = Constrained_Delaunay_triangulation_2<Kernel, TDS, Itag>;
typedef Triangulation_hierarchy_2<CDT_t> CDTH; using CDTH = Triangulation_hierarchy_2<CDT_t>;
typedef Constrained_triangulation_plus_2<CDTH> CDT; using CDT = Constrained_triangulation_plus_2<CDTH>;
typedef typename CDT::Point CDT_Point; using CDT_Point = typename CDT::Point;
typedef typename CDT::Edge CDT_Edge; using CDT_Edge = typename CDT::Edge;
typedef typename CDT::Face_handle CDT_Face_handle; using CDT_Face_handle = typename CDT::Face_handle;
typedef typename CDT::Vertex_handle CDT_Vertex_handle; using CDT_Vertex_handle = typename CDT::Vertex_handle;
typedef typename CDT::Finite_faces_iterator CDT_Finite_faces_iterator; using CDT_Finite_faces_iterator = typename CDT::Finite_faces_iterator;
typedef typename CDT::Finite_vertices_iterator CDT_Finite_vertices_iterator; using CDT_Finite_vertices_iterator = typename CDT::Finite_vertices_iterator;
typedef typename CDT::Finite_edges_iterator CDT_Finite_edges_iterator; using CDT_Finite_edges_iterator = typename CDT::Finite_edges_iterator;
typedef typename CDT::Locate_type CDT_Locate_type; using CDT_Locate_type = typename CDT::Locate_type;
typedef Arr_point_location_result<Arrangement_2> Result; using Result = Arr_point_location_result<Base_aos>;
typedef typename Result::Type Result_type; using Result_type = typename Result::Type;
// Support cpp11::result_of // Support cpp11::result_of
typedef Result_type result_type; using result_type = Result_type;
protected: protected:
typedef Arr_traits_basic_adaptor_2<Geometry_traits_2> Traits_adaptor_2; using Traits_adaptor_2 = Arr_traits_basic_adaptor_2<Geometry_traits_2>;
// Data members: // Data members:
const Traits_adaptor_2* m_traits; // Its associated traits object. const Traits_adaptor_2* m_traits; // Its associated traits object.
@ -128,8 +124,8 @@ public:
/*! Constructor from an arrangement. /*! Constructor from an arrangement.
* \param arr (in) The arrangement. * \param arr (in) The arrangement.
*/ */
Arr_triangulation_point_location(const Arrangement_2& arr) : Arr_triangulation_point_location(const Base_aos& arr) :
Arr_observer<Arrangement_2>(const_cast<Arrangement_2&>(arr)), Base_aos::Observer(const_cast<Base_aos&>(arr)),
m_traits(static_cast<const Traits_adaptor_2*>(arr.geometry_traits())), m_traits(static_cast<const Traits_adaptor_2*>(arr.geometry_traits())),
m_ignore_notifications(false), m_ignore_notifications(false),
m_ignore_remove_edge(false) m_ignore_remove_edge(false)
@ -149,12 +145,12 @@ public:
/*! Attach an arrangement. /*! Attach an arrangement.
* \param arr (in) The arrangement. * \param arr (in) The arrangement.
*/ */
virtual void before_attach(const Arrangement_2& arr) virtual void before_attach(const Base_aos& arr) override
{ m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits()); } { m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits()); }
virtual void after_attach() { build_triangulation(); } virtual void after_attach() override { build_triangulation(); }
virtual void before_detach() { clear_triangulation(); } virtual void before_detach() override { clear_triangulation(); }
/// \name Overloaded observer functions on global changes. /// \name Overloaded observer functions on global changes.
//@{ //@{
@ -162,32 +158,28 @@ public:
/*! Notification after the arrangement has been assigned with another /*! Notification after the arrangement has been assigned with another
* arrangement. * arrangement.
*/ */
virtual void after_assign() virtual void after_assign() override {
{
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
} }
/*! Notification after the arrangement is cleared. /*! Notification after the arrangement is cleared.
*/ */
virtual void after_clear() virtual void after_clear() override {
{
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
} }
/*! Notification before a global operation modifies the arrangement. /*! Notification before a global operation modifies the arrangement.
*/ */
virtual void before_global_change() virtual void before_global_change() override {
{
clear_triangulation(); clear_triangulation();
m_ignore_notifications = true; m_ignore_notifications = true;
} }
/*! Notification after a global operation is completed. /*! Notification after a global operation is completed.
*/ */
virtual void after_global_change() virtual void after_global_change() override {
{
build_triangulation(); build_triangulation();
m_ignore_notifications = false; m_ignore_notifications = false;
} }
@ -199,14 +191,13 @@ public:
/*! Notification before the removal of an edge. /*! Notification before the removal of an edge.
* \param e (in) A handle to one of the twin halfedges to be removed. * \param e (in) A handle to one of the twin halfedges to be removed.
*/ */
virtual void before_remove_edge(Halfedge_handle /* e */) virtual void before_remove_edge(Halfedge_handle /* e */) override
{ m_ignore_remove_edge = true; } { m_ignore_remove_edge = true; }
/*! Notification after the creation of a new vertex. /*! Notification after the creation of a new vertex.
* \param v (in) A handle to the created vertex. * \param v (in) A handle to the created vertex.
*/ */
virtual void after_create_vertex(Vertex_handle /* v */) virtual void after_create_vertex(Vertex_handle /* v */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -216,8 +207,7 @@ public:
/*! Notification after the creation of a new edge. /*! Notification after the creation of a new edge.
* \param e (in) A handle to one of the twin halfedges that were created. * \param e (in) A handle to one of the twin halfedges that were created.
*/ */
virtual void after_create_edge(Halfedge_handle /* e */) virtual void after_create_edge(Halfedge_handle /* e */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -229,8 +219,7 @@ public:
* \param e2 (in) A handle to one of the twin halfedges forming the second edge. * \param e2 (in) A handle to one of the twin halfedges forming the second edge.
*/ */
virtual void after_split_edge(Halfedge_handle /* e1 */, virtual void after_split_edge(Halfedge_handle /* e1 */,
Halfedge_handle /* e2 */) Halfedge_handle /* e2 */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -244,8 +233,7 @@ public:
*/ */
virtual void after_split_face(Face_handle /* f */, virtual void after_split_face(Face_handle /* f */,
Face_handle /* new_f */, Face_handle /* new_f */,
bool /* is_hole */) bool /* is_hole */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -255,8 +243,7 @@ public:
/*! Notification after an outer CCB was created inside a face. /*! Notification after an outer CCB was created inside a face.
* \param h (in) A circulator representing the boundary of the new outer CCB. * \param h (in) A circulator representing the boundary of the new outer CCB.
*/ */
virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -266,8 +253,7 @@ public:
/*! Notification after an edge was merged. /*! Notification after an edge was merged.
* \param e (in) A handle to one of the twin halfedges forming the merged edge. * \param e (in) A handle to one of the twin halfedges forming the merged edge.
*/ */
virtual void after_merge_edge(Halfedge_handle /* e */) virtual void after_merge_edge(Halfedge_handle /* e */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -277,8 +263,7 @@ public:
/*! Notification after a face was merged. /*! Notification after a face was merged.
* \param f (in) A handle to the merged face. * \param f (in) A handle to the merged face.
*/ */
virtual void after_merge_face(Face_handle /* f */) virtual void after_merge_face(Face_handle /* f */) override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -288,8 +273,7 @@ public:
/*! Notification after an outer CCB is moved from one face to another. /*! Notification after an outer CCB is moved from one face to another.
* \param h (in) A circulator representing the boundary of the component. * \param h (in) A circulator representing the boundary of the component.
*/ */
virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -299,8 +283,7 @@ public:
/*! Notificaion before the removal of a vertex. /*! Notificaion before the removal of a vertex.
* \param v (in) A handle to the vertex to be deleted. * \param v (in) A handle to the vertex to be deleted.
*/ */
virtual void after_remove_vertex() virtual void after_remove_vertex() override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -310,8 +293,7 @@ public:
/*! Notification before the removal of an edge. /*! Notification before the removal of an edge.
* \param e (in) A handle to one of the twin halfedges to be deleted. * \param e (in) A handle to one of the twin halfedges to be deleted.
*/ */
virtual void after_remove_edge() virtual void after_remove_edge() override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -322,8 +304,7 @@ public:
/*! Notification before the removal of an outer CCB. /*! Notification before the removal of an outer CCB.
* \param f (in) The face that used to own the outer CCB. * \param f (in) The face that used to own the outer CCB.
*/ */
virtual void after_remove_outer_ccb(Face_handle /* f */) virtual void after_remove_outer_ccb(Face_handle /* f */) override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -333,8 +314,7 @@ public:
/*! Notification after an inner CCB was created inside a face. /*! Notification after an inner CCB was created inside a face.
* \param h (in) A circulator representing the boundary of the new inner CCB. * \param h (in) A circulator representing the boundary of the new inner CCB.
*/ */
virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -344,8 +324,7 @@ public:
/*! Notification after an inner CCB is moved from one face to another. /*! Notification after an inner CCB is moved from one face to another.
* \param h (in) A circulator representing the boundary of the component. * \param h (in) A circulator representing the boundary of the component.
*/ */
virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) override {
{
if (! m_ignore_notifications) { if (! m_ignore_notifications) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();
@ -355,8 +334,7 @@ public:
/*! Notificaion after the removal of an inner CCB. /*! Notificaion after the removal of an inner CCB.
* \param f (in) The face that used to contain the inner CCB. * \param f (in) The face that used to contain the inner CCB.
*/ */
virtual void after_remove_inner_ccb(Face_handle /* f */) virtual void after_remove_inner_ccb(Face_handle /* f */) override {
{
if (! m_ignore_notifications && ! m_ignore_remove_edge) { if (! m_ignore_notifications && ! m_ignore_remove_edge) {
clear_triangulation(); clear_triangulation();
build_triangulation(); build_triangulation();

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

@ -22,7 +22,6 @@
/*! \file /*! \file
* Definition of the Arr_vertex_index_map<Arrangement> class. * Definition of the Arr_vertex_index_map<Arrangement> class.
*/ */
#include <CGAL/Arr_observer.h>
#include <CGAL/Unique_hash_map.h> #include <CGAL/Unique_hash_map.h>
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
@ -35,136 +34,120 @@ namespace CGAL {
* arrangement vertices to the indices 0, ..., (n -1), where n is the number * arrangement vertices to the indices 0, ..., (n -1), where n is the number
* of vertices in the arrangement. * of vertices in the arrangement.
*/ */
template <class Arrangement_> template <typename Arrangement_>
class Arr_vertex_index_map : public Arr_observer<Arrangement_> class Arr_vertex_index_map : public Arrangement_::Observer {
{
public: public:
using Arrangement_2 = Arrangement_;
using Base_aos = typename Arrangement_2::Base_aos;
typedef Arrangement_ Arrangement_2; using Vertex_handle = typename Base_aos::Vertex_handle;
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
// Boost property type definitions: // Boost property type definitions:
typedef boost::readable_property_map_tag category; using category = boost::readable_property_map_tag;
typedef unsigned int value_type; using value_type = unsigned int;
typedef value_type reference; using reference = value_type;
typedef Vertex_handle key_type; using key_type = Vertex_handle;
private: private:
using Self = Arr_vertex_index_map<Arrangement_2>;
using Base = typename Arrangement_2::Observer;
typedef Arr_vertex_index_map<Arrangement_2> Self; using Index_map = Unique_hash_map<Vertex_handle, unsigned int>;
typedef Arr_observer<Arrangement_2> Base;
typedef Unique_hash_map<Vertex_handle, unsigned int> Index_map;
// Data members: // Data members:
unsigned int n_vertices; // The current number of vertices. unsigned int n_vertices; // The current number of vertices.
Index_map index_map; // Mapping vertices to indices. Index_map index_map; // Mapping vertices to indices.
std::vector<Vertex_handle> rev_map; // Mapping indices to vertices. std::vector<Vertex_handle> rev_map; // Mapping indices to vertices.
enum {MIN_REV_MAP_SIZE = 32}; enum {MIN_REV_MAP_SIZE = 32};
public: public:
/*! Default constructor. */ /*! Default constructor. */
Arr_vertex_index_map () : Arr_vertex_index_map() :
Base (), Base(),
n_vertices (0), n_vertices(0),
rev_map (MIN_REV_MAP_SIZE) rev_map(MIN_REV_MAP_SIZE)
{} {}
/*! Constructor with an associated arrangement. */ /*! Constructor with an associated arrangement. */
Arr_vertex_index_map (const Arrangement_2& arr) : Arr_vertex_index_map(const Base_aos& arr) :
Base (const_cast<Arrangement_2&> (arr)) Base(const_cast<Base_aos&>(arr))
{ { _init(); }
_init();
}
/*! Copy constructor. */ /*! Copy constructor. */
Arr_vertex_index_map (const Self& other) : Arr_vertex_index_map(const Self& other) :
Base (const_cast<Arrangement_2&> (*(other.arrangement()))) Base(const_cast<Base_aos&>(*(other.arrangement())))
{ { _init(); }
_init();
}
/*! Assignment operator. */ /*! Assignment operator. */
Self& operator= (const Self& other) Self& operator= (const Self& other) {
{ if (this == &other) return (*this);
if (this == &other)
return (*this);
this->detach(); this->detach();
this->attach (const_cast<Arrangement_2&> (*(other.arrangement()))); this->attach(const_cast<Base_aos&>(*(other.arrangement())));
return (*this); return (*this);
} }
/*! /*! Get the index of a given vertex.
* Get the index of a given vertex.
* \param v A handle to the vertex. * \param v A handle to the vertex.
* \pre v is a valid vertex in the arrangement. * \pre v is a valid vertex in the arrangement.
*/ */
unsigned int operator[] (Vertex_handle v) const unsigned int operator[](Vertex_handle v) const { return index_map[v]; }
{
return index_map[v];
}
/*! /*! Get the vertex given its index.
* Get the vertex given its index.
* \param i The index of the vertex. * \param i The index of the vertex.
* \pre i is less than the number of vertices in the graph. * \pre i is less than the number of vertices in the graph.
*/ */
Vertex_handle vertex (const int i) const Vertex_handle vertex(const int i) const {
{ CGAL_precondition(i < n_vertices);
CGAL_precondition (i < n_vertices);
return rev_map[i]; return rev_map[i];
} }
/// \name Notification functions, to keep the mapping up-to-date. /// \name Notification functions, to keep the mapping up-to-date.
//@{ //@{
/*! /*! Update the mapping after the arrangement has been assigned with another
* Update the mapping after the arrangement has been assigned with another
* arrangement. * arrangement.
*/ */
virtual void after_assign () virtual void after_assign() override { _init(); }
{
_init();
}
/*! /*! Update the mapping after the arrangement is cleared.
* Update the mapping after the arrangement is cleared.
*/ */
virtual void after_clear () virtual void after_clear() override { _init(); }
{
_init();
}
/*! /*! Update the mapping after attaching to a new arrangement.
* Update the mapping after attaching to a new arrangement.
*/ */
virtual void after_attach () virtual void after_attach() override { _init(); }
{
_init();
}
/*! /*! Update the mapping after detaching the arrangement.
* Update the mapping after detaching the arrangement.
*/ */
virtual void after_detach () virtual void after_detach() override {
{
n_vertices = 0; n_vertices = 0;
index_map.clear(); index_map.clear();
} }
/*! /*! Update the mapping after the creation of a new vertex.
* Update the mapping after the creation of a new vertex.
* \param v A handle to the created vertex. * \param v A handle to the created vertex.
*/ */
virtual void after_create_vertex (Vertex_handle v) virtual void after_create_vertex(Vertex_handle v) override {
{
// Update the number of vertices. // Update the number of vertices.
n_vertices++; ++n_vertices;
// If necessary, allocate memory for the reverse mapping.
if (rev_map.size() < n_vertices) rev_map.resize(2 * n_vertices);
// Update the mapping of the newly created vertex.
index_map[v] = n_vertices - 1;
rev_map[n_vertices - 1] = v;
}
/*! Update the mapping after the creation of a new boundary vertex.
* \param v A handle to the created vertex.
*/
virtual void after_create_boundary_vertex(Vertex_handle v) override {
// Update the number of vertices.
++n_vertices;
// If necessary, allocate memory for the reverse mapping. // If necessary, allocate memory for the reverse mapping.
if (rev_map.size() < n_vertices) if (rev_map.size() < n_vertices)
@ -175,49 +158,28 @@ public:
rev_map[n_vertices - 1] = v; rev_map[n_vertices - 1] = v;
} }
/*! /*! Update the mapping before the removal of a vertex.
* Update the mapping after the creation of a new boundary vertex.
* \param v A handle to the created vertex.
*/
virtual void after_create_boundary_vertex (Vertex_handle v)
{
// Update the number of vertices.
n_vertices++;
// If necessary, allocate memory for the reverse mapping.
if (rev_map.size() < n_vertices)
rev_map.resize (2 * n_vertices);
// Update the mapping of the newly created vertex.
index_map[v] = n_vertices - 1;
rev_map[n_vertices - 1] = v;
}
/*!
* Update the mapping before the removal of a vertex.
* \param v A handle to the vertex to be removed. * \param v A handle to the vertex to be removed.
*/ */
virtual void before_remove_vertex (Vertex_handle v) virtual void before_remove_vertex(Vertex_handle v) override {
{
// Update the number of vertices. // Update the number of vertices.
n_vertices--; --n_vertices;
// Reduce memory consumption in case the number of vertices has // Reduce memory consumption in case the number of vertices has
// drastically decreased. // drastically decreased.
if (2*n_vertices+1 < rev_map.size() && if (2*n_vertices+1 < rev_map.size() &&
rev_map.size() / 2 >= MIN_REV_MAP_SIZE) rev_map.size() / 2 >= MIN_REV_MAP_SIZE)
{ {
rev_map.resize (rev_map.size() / 2); rev_map.resize(rev_map.size() / 2);
} }
// Get the current vertex index, and assign this index to the vertex // Get the current vertex index, and assign this index to the vertex
// currently indexed (n - 1). // currently indexed (n - 1).
unsigned int index = index_map[v]; unsigned int index = index_map[v];
if (index == n_vertices) if (index == n_vertices) return;
return;
Vertex_handle last_v = rev_map[n_vertices]; Vertex_handle last_v = rev_map[n_vertices];
index_map[last_v] = index; index_map[last_v] = index;
rev_map[index] = last_v; rev_map[index] = last_v;
@ -227,51 +189,42 @@ public:
//@} //@}
private: private:
/*! Initialize the map for the given arrangement. */ /*! Initialize the map for the given arrangement. */
void _init () void _init() {
{
// Get the number of vertices and allocate the reverse map accordingly. // Get the number of vertices and allocate the reverse map accordingly.
n_vertices = static_cast<unsigned int>(this->arrangement()->number_of_vertices()); n_vertices =
static_cast<unsigned int>(this->arrangement()->number_of_vertices());
if (n_vertices < MIN_REV_MAP_SIZE) if (n_vertices < MIN_REV_MAP_SIZE) rev_map.resize (MIN_REV_MAP_SIZE);
rev_map.resize (MIN_REV_MAP_SIZE); else rev_map.resize (n_vertices);
else
rev_map.resize (n_vertices);
// Clear the current mapping. // Clear the current mapping.
index_map.clear(); index_map.clear();
// Create the initial mapping. // Create the initial mapping.
typename Arrangement_2::Vertex_iterator vit; Vertex_handle vh;
Vertex_handle vh; unsigned int index = 0;
unsigned int index = 0;
for (vit = this->arrangement()->vertices_begin(); for (auto vit = this->arrangement()->vertices_begin();
vit != this->arrangement()->vertices_end(); ++vit, ++index) vit != this->arrangement()->vertices_end(); ++vit, ++index) {
{
// Map the current vertex to the current index. // Map the current vertex to the current index.
vh = vit; vh = vit;
index_map[vh] = index; index_map[vh] = index;
rev_map[index] = vh; rev_map[index] = vh;
} }
} }
}; };
/*! /*! Get the index property-map function. Provided so that boost is able to
* Get the index property-map function. Provided so that boost is able to
* access the Arr_vertex_index_map above. * access the Arr_vertex_index_map above.
* \param index_map The index map. * \param index_map The index map.
* \param v A vertex handle. * \param v A vertex handle.
* \return The vertex index. * \return The vertex index.
*/ */
template<class Arrangement> template <typename Arrangement>
unsigned int get (const CGAL::Arr_vertex_index_map<Arrangement>& index_map, unsigned int get(const CGAL::Arr_vertex_index_map<Arrangement>& index_map,
typename Arrangement::Vertex_handle v) typename Arrangement::Vertex_handle v)
{ { return index_map[v]; }
return index_map[v];
}
} //namespace CGAL } //namespace CGAL

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 {
@ -115,12 +116,9 @@ public:
typedef typename Base::Inner_ccb_const_iterator Hole_const_iterator; typedef typename Base::Inner_ccb_const_iterator Hole_const_iterator;
private: private:
friend class Arr_observer<Self>;
friend class Arr_accessor<Self>; friend class Arr_accessor<Self>;
public: public:
/// \name Constructors. /// \name Constructors.
//@{ //@{
@ -215,34 +213,6 @@ public:
} }
//@} //@}
protected:
/// \name Managing and notifying the arrangement observers.
//@{
typedef Arr_observer<Self> Observer;
/*!
* Register a new observer (so it starts receiving notifications).
* \param p_obs A pointer to the observer object.
*/
void _register_observer (Observer *p_obs)
{
Base::_register_observer ((typename Base::Observer*)p_obs);
return;
}
/*!
* Unregister a new observer (so it stops receiving notifications).
* \param p_obs A pointer to the observer object.
* \return Whether the observer was successfully unregistered.
*/
bool _unregister_observer (Observer *p_obs)
{
return (Base::_unregister_observer ((typename Base::Observer*)p_obs));
}
//@}
}; };
} //namespace CGAL } //namespace CGAL

View File

@ -273,29 +273,6 @@ bool Arrangement_on_surface_with_history_2<GeomTr,TopTr>::are_mergeable
e2->curve())); e2->curve()));
} }
//-----------------------------------------------------------------------------
// Register a new observer (so it starts receiving notifications).
//
template<class GeomTr, class TopTr>
void Arrangement_on_surface_with_history_2<GeomTr,TopTr>::
_register_observer(Arr_observer<Self> *p_obs)
{
Base_arr_2::_register_observer
(reinterpret_cast<Arr_observer<Base_arr_2>*>(p_obs));
return;
}
//-----------------------------------------------------------------------------
// Unregister an observer (so it stops receiving notifications).
//
template<class GeomTr, class TopTr>
bool Arrangement_on_surface_with_history_2<GeomTr,TopTr>::
_unregister_observer(Arr_observer<Self> *p_obs)
{
return (Base_arr_2::_unregister_observer
(reinterpret_cast<Arr_observer<Base_arr_2>*>(p_obs)));
}
} //namespace CGAL } //namespace CGAL
#endif #endif

View File

@ -577,7 +577,7 @@ public:
return (m_self->compare_y_at_x_right_2_object()(xcv1, xcv2, left1)); return (m_self->compare_y_at_x_right_2_object()(xcv1, xcv2, left1));
} }
// We now that the curves do not share a common endpoint, and we can // We know that the curves do not share a common endpoint, and we can
// compare their relative y-position (which does not change to the left // compare their relative y-position (which does not change to the left
// of the given point p). // of the given point p).
return (m_self->compare_y_position_2_object()(xcv1, xcv2)); return (m_self->compare_y_position_2_object()(xcv1, xcv2));

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/Aos_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>
@ -109,8 +109,11 @@ public:
typedef typename Topology_traits::Dcel Dcel; typedef typename Topology_traits::Dcel Dcel;
typedef typename Dcel::Size Size; typedef typename Dcel::Size Size;
using Observer = Aos_observer<Self>;
using Base_aos = Self;
protected: protected:
friend class Arr_observer<Self>; friend class Aos_observer<Self>;
friend class Arr_accessor<Self>; friend class Arr_accessor<Self>;
// Internal DCEL types: // Internal DCEL types:
@ -892,7 +895,6 @@ protected:
typedef CGAL_ALLOCATOR(Point_2) Points_alloc; typedef CGAL_ALLOCATOR(Point_2) Points_alloc;
typedef CGAL_ALLOCATOR(X_monotone_curve_2) Curves_alloc; typedef CGAL_ALLOCATOR(X_monotone_curve_2) Curves_alloc;
typedef Arr_observer<Self> Observer;
typedef std::list<Observer*> Observers_container; typedef std::list<Observer*> Observers_container;
typedef typename Observers_container::iterator Observers_iterator; typedef typename Observers_container::iterator Observers_iterator;

View File

@ -26,7 +26,6 @@
#include <CGAL/Arrangement_on_surface_2.h> #include <CGAL/Arrangement_on_surface_2.h>
#include <CGAL/Arr_overlay_2.h> #include <CGAL/Arr_overlay_2.h>
#include <CGAL/Arr_consolidated_curve_data_traits_2.h> #include <CGAL/Arr_consolidated_curve_data_traits_2.h>
#include <CGAL/Arr_observer.h>
#include <CGAL/In_place_list.h> #include <CGAL/In_place_list.h>
#include <CGAL/Arrangement_2/Arr_with_history_accessor.h> #include <CGAL/Arrangement_2/Arr_with_history_accessor.h>
@ -75,10 +74,7 @@ public:
typedef typename Geometry_traits_2::Curve_2 Curve_2; typedef typename Geometry_traits_2::Curve_2 Curve_2;
typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2;
typedef Arr_observer<Self> Observer;
protected: protected:
friend class Arr_observer<Self>;
friend class Arr_accessor<Self>; friend class Arr_accessor<Self>;
friend class Arr_with_history_accessor<Self>; friend class Arr_with_history_accessor<Self>;
@ -170,104 +166,75 @@ protected:
// Forward declaration: // Forward declaration:
class Curve_halfedges_observer; class Curve_halfedges_observer;
public:
/*! \class /*! \class
* Extension of a curve with the set of edges that it induces. * Extension of a curve with the set of edges that it induces.
* Each edge is represented by one of the halfedges. * Each edge is represented by one of the halfedges.
*/ */
class Curve_halfedges : public Curve_2, class Curve_halfedges : public Curve_2,
public In_place_list_base<Curve_halfedges> public In_place_list_base<Curve_halfedges> {
{ using Gt = Geometry_traits_2;
using Btt = Base_topology_traits;
using Aos_wh = Arrangement_on_surface_with_history_2<Gt, Btt>;
friend class Curve_halfedges_observer; friend class Curve_halfedges_observer;
friend class Arrangement_on_surface_with_history_2<Geometry_traits_2, friend class Arrangement_on_surface_with_history_2<Gt, Btt>;
Base_topology_traits>; friend class Arr_with_history_accessor<Aos_wh>;
friend class Arr_with_history_accessor<
Arrangement_on_surface_with_history_2<Geometry_traits_2,
Base_topology_traits> >;
private: private:
typedef std::set<Halfedge_handle, Less_halfedge_handle> Halfedges_set; using Halfedges_set = std::set<Halfedge_handle, Less_halfedge_handle>;
// Data members: // Data members:
Halfedges_set m_halfedges; Halfedges_set m_halfedges;
public: public:
/*! Default constructor. */ /*! Default constructor. */
Curve_halfedges () Curve_halfedges() {}
{}
/*! Constructor from a given curve. */ /*! Constructor from a given curve. */
Curve_halfedges (const Curve_2& curve) : Curve_halfedges(const Curve_2& curve) : Curve_2(curve) {}
Curve_2(curve)
{}
typedef typename Halfedges_set::iterator iterator; using iterator = typename Halfedges_set::iterator;
typedef typename Halfedges_set::const_iterator const_iterator; using const_iterator = typename Halfedges_set::const_iterator;
private: private:
/*! Get the number of edges induced by the curve. */ /*! Get the number of edges induced by the curve. */
Size _size () const Size size() const { return m_halfedges.size(); }
{
return (m_halfedges.size());
}
/*! Get an iterator for the first edge in the set (const version). */ /*! Get an iterator for the first edge in the set (const version). */
const_iterator _begin () const const_iterator begin() const { return m_halfedges.begin(); }
{
return m_halfedges.begin();
}
/*! Get an iterator for the first edge in the set (non-const version). */ /*! Get an iterator for the first edge in the set (non-const version). */
iterator _begin () iterator begin() { return m_halfedges.begin(); }
{
return m_halfedges.begin();
}
/*! Get a past-the-end iterator for the set edges (const version). */ /*! Get a past-the-end iterator for the set edges (const version). */
const_iterator _end () const const_iterator end() const { return m_halfedges.end(); }
{
return m_halfedges.end();
}
/*! Get a past-the-end iterator for the set edges (non-const version). */ /*! Get a past-the-end iterator for the set edges (non-const version). */
iterator _end () iterator end() { return m_halfedges.end(); }
{
return m_halfedges.end();
}
/*! Insert an edge to the set. */ /*! Insert an edge to the set. */
iterator _insert (Halfedge_handle he) iterator _insert(Halfedge_handle he) {
{
std::pair<iterator, bool> res = m_halfedges.insert(he); std::pair<iterator, bool> res = m_halfedges.insert(he);
CGAL_assertion(res.second); CGAL_assertion(res.second);
return (res.first); return res.first;
} }
/*! Erase an edge, given by its position, from the set. */ /*! Erase an edge, given by its position, from the set. */
void _erase(iterator pos) void erase(iterator pos) { m_halfedges.erase(pos); }
{
m_halfedges.erase(pos);
return;
}
/*! Erase an edge from the set. */ /*! Erase an edge from the set. */
void _erase (Halfedge_handle he) void _erase(Halfedge_handle he) {
{
size_t res = m_halfedges.erase(he); size_t res = m_halfedges.erase(he);
if (res == 0) if (res == 0) res = m_halfedges.erase(he->twin());
res = m_halfedges.erase(he->twin());
CGAL_assertion(res != 0); CGAL_assertion(res != 0);
return;
} }
/*! Cleat the edges set. */ /*! Cleat the edges set. */
void _clear () void clear() { m_halfedges.clear(); }
{
m_halfedges.clear();
return;
}
}; };
protected:
typedef CGAL_ALLOCATOR(Curve_halfedges) Curves_alloc; typedef CGAL_ALLOCATOR(Curve_halfedges) Curves_alloc;
typedef In_place_list<Curve_halfedges, false> Curve_halfedges_list; typedef In_place_list<Curve_halfedges, false> Curve_halfedges_list;
@ -276,111 +243,87 @@ protected:
* involving edges and updates the list of halfedges associated with the * involving edges and updates the list of halfedges associated with the
* input curves accordingly. * input curves accordingly.
*/ */
class Curve_halfedges_observer : public Arr_observer<Base_arr_2> { class Curve_halfedges_observer : public Base_arr_2::Observer {
public: public:
using Base_aos = typename Base_arr_2::Base_aos;
typedef typename Base_arr_2::Halfedge_handle Halfedge_handle; using Vertex_handle = typename Base_aos::Vertex_handle;
typedef typename Base_arr_2::Vertex_handle Vertex_handle; using Halfedge_handle = typename Base_aos::Halfedge_handle;
typedef typename Base_arr_2::X_monotone_curve_2 X_monotone_curve_2; using X_monotone_curve_2 = typename Base_aos::X_monotone_curve_2;
/*! /*! Notification after the creation of a new edge.
* Notification after the creation of a new edge.
* \param e A handle to one of the twin halfedges that were created. * \param e A handle to one of the twin halfedges that were created.
*/ */
virtual void after_create_edge (Halfedge_handle e) virtual void after_create_edge(Halfedge_handle e) override
{ { _register_edge(e); }
_register_edge(e);
}
/*! /*!
* Notification before the modification of an existing edge. * Notification before the modification of an existing edge.
* \param e A handle to one of the twin halfedges to be updated. * \param e A handle to one of the twin halfedges to be updated.
* \param c The x-monotone curve to be associated with the edge. * \param c The x-monotone curve to be associated with the edge.
*/ */
virtual void before_modify_edge (Halfedge_handle e, virtual void before_modify_edge(Halfedge_handle e,
const X_monotone_curve_2& /* c */) const X_monotone_curve_2& /* c */) override
{ { _unregister_edge(e); }
_unregister_edge(e);
}
/*! /*! Notification after an edge was modified.
* Notification after an edge was modified.
* \param e A handle to one of the twin halfedges that were updated. * \param e A handle to one of the twin halfedges that were updated.
*/ */
virtual void after_modify_edge (Halfedge_handle e) virtual void after_modify_edge(Halfedge_handle e) override
{ { _register_edge(e); }
_register_edge(e);
}
/*! /*! Notification before the splitting of an edge into two.
* Notification before the splitting of an edge into two.
* \param e A handle to one of the existing halfedges. * \param e A handle to one of the existing halfedges.
* \param c1 The x-monotone curve to be associated with the first edge. * \param c1 The x-monotone curve to be associated with the first edge.
* \param c2 The x-monotone curve to be associated with the second edge. * \param c2 The x-monotone curve to be associated with the second edge.
*/ */
virtual void before_split_edge (Halfedge_handle e, virtual void before_split_edge(Halfedge_handle e,
Vertex_handle /* v */, Vertex_handle /* v */,
const X_monotone_curve_2& /* c1 */, const X_monotone_curve_2& /* c1 */,
const X_monotone_curve_2& /* c2 */) const X_monotone_curve_2& /* c2 */) override
{ { _unregister_edge(e); }
_unregister_edge(e);
}
/*! /*! Notification after an edge was split.
* Notification after an edge was split.
* \param e1 A handle to one of the twin halfedges forming the first edge. * \param e1 A handle to one of the twin halfedges forming the first edge.
* \param e2 A handle to one of the twin halfedges forming the second edge. * \param e2 A handle to one of the twin halfedges forming the second edge.
*/ */
virtual void after_split_edge (Halfedge_handle e1, Halfedge_handle e2) virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2)
{ override {
_register_edge(e1); _register_edge(e1);
_register_edge(e2); _register_edge(e2);
} }
/*! /*! Notification before the merging of two edges.
* Notification before the merging of two edges.
* \param e1 A handle to one of the halfedges forming the first edge. * \param e1 A handle to one of the halfedges forming the first edge.
* \param e2 A handle to one of the halfedges forming the second edge. * \param e2 A handle to one of the halfedges forming the second edge.
* \param c The x-monotone curve to be associated with the merged edge. * \param c The x-monotone curve to be associated with the merged edge.
*/ */
virtual void before_merge_edge (Halfedge_handle e1, Halfedge_handle e2, virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2,
const X_monotone_curve_2& /* c */) const X_monotone_curve_2& /* c */) override {
{
_unregister_edge(e1); _unregister_edge(e1);
_unregister_edge(e2); _unregister_edge(e2);
} }
/*! /*! Notification after an edge was merged.
* Notification after an edge was merged.
* \param e A handle to one of the twin halfedges forming the merged edge. * \param e A handle to one of the twin halfedges forming the merged edge.
*/ */
virtual void after_merge_edge (Halfedge_handle e) virtual void after_merge_edge(Halfedge_handle e) override
{ { _register_edge(e); }
_register_edge(e);
}
/*! /*! Notification before the removal of an edge.
* Notification before the removal of an edge.
* \param e A handle to one of the twin halfedges to be deleted. * \param e A handle to one of the twin halfedges to be deleted.
*/ */
virtual void before_remove_edge (Halfedge_handle e) virtual void before_remove_edge(Halfedge_handle e) override
{ { _unregister_edge(e); }
_unregister_edge(e);
}
private: private:
/*! /*! Register the given halfedge in the set(s) associated with its curve.
* Register the given halfedge in the set(s) associated with its curve.
*/ */
void _register_edge (Halfedge_handle e) void _register_edge(Halfedge_handle e) {
{ for (auto di = e->curve().data().begin(); di != e->curve().data().end();
Curve_halfedges *curve_halfedges; ++di) {
Data_iterator di; Curve_halfedges* curve_halfedges = static_cast<Curve_halfedges*>(*di);
for (di = e->curve().data().begin(); di != e->curve().data().end(); ++di)
{
curve_halfedges = static_cast<Curve_halfedges*>(*di);
curve_halfedges->_insert(e); curve_halfedges->_insert(e);
} }
} }
@ -388,14 +331,10 @@ protected:
/*! /*!
* Unregister the given halfedge from the set(s) associated with its curve. * Unregister the given halfedge from the set(s) associated with its curve.
*/ */
void _unregister_edge (Halfedge_handle e) void _unregister_edge(Halfedge_handle e) {
{ for (auto di = e->curve().data().begin(); di != e->curve().data().end();
Curve_halfedges *curve_halfedges; ++di) {
Data_iterator di; Curve_halfedges* curve_halfedges = static_cast<Curve_halfedges*>(*di);
for (di = e->curve().data().begin(); di != e->curve().data().end(); ++di)
{
curve_halfedges = static_cast<Curve_halfedges*>(*di);
curve_halfedges->_erase(e); curve_halfedges->_erase(e);
} }
} }
@ -537,16 +476,13 @@ public:
/// \name Traversal of the edges induced by a curve. /// \name Traversal of the edges induced by a curve.
//@{ //@{
Size number_of_induced_edges (Curve_const_handle c) const Size number_of_induced_edges (Curve_const_handle c) const { return c->size(); }
{
return (c->_size());
}
Induced_edge_iterator Induced_edge_iterator
induced_edges_begin (Curve_const_handle c) const { return (c->_begin()); } induced_edges_begin (Curve_const_handle c) const { return (c->begin()); }
Induced_edge_iterator Induced_edge_iterator
induced_edges_end (Curve_const_handle c) const { return (c->_end()); } induced_edges_end (Curve_const_handle c) const { return (c->end()); }
//@} //@}
/// \name Manipulating edges. /// \name Manipulating edges.
@ -582,24 +518,6 @@ public:
//@} //@}
protected: protected:
/// \name Managing and notifying the arrangement observers.
//@{
/*!
* Register a new observer (so it starts receiving notifications).
* \param p_obs A pointer to the observer object.
*/
void _register_observer (Observer *p_obs);
/*!
* Unregister an observer (so it stops receiving notifications).
* \param p_obs A pointer to the observer object.
* \return Whether the observer was successfully unregistered.
*/
bool _unregister_observer (Observer *p_obs);
//@}
/// \name Curve insertion and deletion. /// \name Curve insertion and deletion.
//@{ //@{
@ -696,12 +614,12 @@ protected:
Size _remove_curve (Curve_handle ch) Size _remove_curve (Curve_handle ch)
{ {
// Go over all edges the given curve induces. // Go over all edges the given curve induces.
Curve_halfedges *p_cv = &(*ch); Curve_halfedges* p_cv = &(*ch);
typename Curve_halfedges::const_iterator it = ch->_begin(); Halfedge_handle he;
Halfedge_handle he; Size n_removed = 0;
Size n_removed = 0;
while (it != ch->_end()) { typename Curve_halfedges::const_iterator it = ch->begin();
while (it != ch->end()) {
// Check how many curves have originated the current edge. // Check how many curves have originated the current edge.
// Note we increment the iterator now, as the edge may be removed. // Note we increment the iterator now, as the edge may be removed.
he = *it; he = *it;

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 {
@ -119,7 +121,6 @@ public:
private: private:
typedef Arrangement_with_history_2<Geometry_traits_2, Dcel> Self; typedef Arrangement_with_history_2<Geometry_traits_2, Dcel> Self;
friend class Arr_observer<Self>;
friend class Arr_accessor<Self>; friend class Arr_accessor<Self>;
public: public:
@ -233,35 +234,8 @@ public:
return (Face_const_handle (p_oc->face())); return (Face_const_handle (p_oc->face()));
} }
//@} //@}
protected:
/// \name Managing and notifying the arrangement observers.
//@{
typedef Arr_observer<Self> Observer;
/*!
* Register a new observer (so it starts receiving notifications).
* \param p_obs A pointer to the observer object.
*/
void _register_observer (Observer *p_obs)
{
Base::_register_observer ((typename Base::Observer*)p_obs);
return;
}
/*!
* Unregister a new observer (so it stops receiving notifications).
* \param p_obs A pointer to the observer object.
* \return Whether the observer was successfully unregistered.
*/
bool _unregister_observer (Observer *p_obs)
{
return (Base::_unregister_observer ((typename Base::Observer*)p_obs));
}
//@}
}; };
} //namespace CGAL } //namespace CGAL

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Eric Berberich <eric@mpi-inf.mpg.de> // Author(s) : Eric Berberich <eric@mpi-inf.mpg.de>
// Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
@ -13,6 +13,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_ARC_2_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_ARC_2_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_ARC_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_ARC_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h
*\brief defines class \c Arc_2 that represents an arc on a curve that *\brief defines class \c Arc_2 that represents an arc on a curve that
* can be analyzed. * can be analyzed.

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
@ -13,6 +13,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h
* \brief defines \c Curve_interval_arcno_cache functor * \brief defines \c Curve_interval_arcno_cache functor
*/ */

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
// //
@ -21,6 +21,9 @@
#ifndef CGAL_CKVA_CURVE_RENDERER_FACADE_H #ifndef CGAL_CKVA_CURVE_RENDERER_FACADE_H
#define CGAL_CKVA_CURVE_RENDERER_FACADE_H #define CGAL_CKVA_CURVE_RENDERER_FACADE_H
#include <CGAL/license/Arrangement_on_surface_2.h>
// do not compile curve renderer code (for fast debugging) // do not compile curve renderer code (for fast debugging)
//#define CGAL_CKVA_DUMMY_RENDERER //#define CGAL_CKVA_DUMMY_RENDERER

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Eric Berberich <eric@mpi-inf.mpg.de> // Author(s) : Eric Berberich <eric@mpi-inf.mpg.de>
@ -14,6 +14,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_FUNCTORS_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_FUNCTORS_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_FUNCTORS_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_FUNCTORS_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h
* \brief defines Curved_kernel_via_analysis_2 function objects + class * \brief defines Curved_kernel_via_analysis_2 function objects + class
*/ */

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Eric Berberich <eric@mpi-inf.mpg.de> // Author(s) : Eric Berberich <eric@mpi-inf.mpg.de>
@ -14,6 +14,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2.h
* \brief defines class \c Curved_kernel_via_analysis_2 * \brief defines class \c Curved_kernel_via_analysis_2
* *

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Eric Berberich <eric@mpi-inf.mpg.de> // Author(s) : Eric Berberich <eric@mpi-inf.mpg.de>
@ -15,6 +15,9 @@
#ifndef CGAL_FILTERED_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H #ifndef CGAL_FILTERED_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H
#define CGAL_FILTERED_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H #define CGAL_FILTERED_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Filtered_curved_kernel_via_analysis_2.h /*!\file include/CGAL/Filtered_curved_kernel_via_analysis_2.h
* \brief defines class \c Filtered_curved_kernel_via_analysis_2 * \brief defines class \c Filtered_curved_kernel_via_analysis_2
* *

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
@ -14,6 +14,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_ARC_2_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_ARC_2_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_ARC_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_ARC_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h
* \brief defines class \c Generic_arc_2 * \brief defines class \c Generic_arc_2
* *

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
@ -13,6 +13,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_POINT_2_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_POINT_2_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_POINT_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_POINT_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h
* \brief defines class \c Generic_point_2 * \brief defines class \c Generic_point_2
* *

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Eric Berberich <eric@mpi-inf.mpg.de> // Author(s) : Eric Berberich <eric@mpi-inf.mpg.de>
@ -17,6 +17,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_MAKE_X_MONOTONE_2_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_MAKE_X_MONOTONE_2_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_MAKE_X_MONOTONE_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_MAKE_X_MONOTONE_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h
* \brief defines \c Make_x_monotone_2 functor * \brief defines \c Make_x_monotone_2 functor
*/ */

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
@ -13,6 +13,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_NON_X_MONOTONE_ARC_2_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_NON_X_MONOTONE_ARC_2_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_NON_X_MONOTONE_ARC_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_NON_X_MONOTONE_ARC_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h
* \brief defines class \c Non_x_monotone_arc_2 * \brief defines class \c Non_x_monotone_arc_2
* *

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Eric Berberich <eric@mpi-inf.mpg.de> // Author(s) : Eric Berberich <eric@mpi-inf.mpg.de>
@ -14,6 +14,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_POINT_2_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_POINT_2_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_POINT_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_POINT_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Point_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Point_2.h
* \brief defines class \c Point_2 that represents a point on a curve that can * \brief defines class \c Point_2 that represents a point on a curve that can
* be analyzed. * be analyzed.

View File

@ -5,13 +5,16 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_SWEEP_CURVES_ADAPTER_2_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_SWEEP_CURVES_ADAPTER_2_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_SWEEP_CURVES_ADAPTER_2_H 1 #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_SWEEP_CURVES_ADAPTER_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h
* \brief defines class \c Sweep_curves_adapter_2 * \brief defines class \c Sweep_curves_adapter_2

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
// //
@ -19,6 +19,9 @@
#ifndef CGAL_CKVA_CURVE_RENDERER_2_H #ifndef CGAL_CKVA_CURVE_RENDERER_2_H
#define CGAL_CKVA_CURVE_RENDERER_2_H #define CGAL_CKVA_CURVE_RENDERER_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE #ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE
#define CGAL_AK_ENABLE_DEPRECATED_INTERFACE 1 #define CGAL_AK_ENABLE_DEPRECATED_INTERFACE 1
#endif #endif

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
// //
@ -22,7 +22,10 @@
*/ */
#ifndef CGAL_CKVA_CURVE_RENDERER_INTERNALS_H #ifndef CGAL_CKVA_CURVE_RENDERER_INTERNALS_H
#define CGAL_CKVA_CURVE_RENDERER_INTERNALS_H 1 #define CGAL_CKVA_CURVE_RENDERER_INTERNALS_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <vector> #include <vector>
#include <stack> #include <stack>
@ -88,8 +91,6 @@ struct Pixel_2_
Integer sub_x, sub_y; // subpixel coordinates relative to pixel's boundary Integer sub_x, sub_y; // subpixel coordinates relative to pixel's boundary
// (always 0 for pixels) // (always 0 for pixels)
Pixel_2_& operator =(const Pixel_2_& pix) = default;
bool operator ==(const Pixel_2_& pix) const { bool operator ==(const Pixel_2_& pix) const {
return ( return (
x == pix.x && y == pix.y && level == pix.level && x == pix.x && y == pix.y && level == pix.level &&

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
// //
@ -14,6 +14,9 @@
#ifndef CGAL_CKVA_CURVE_RENDERER_TRAITS_H #ifndef CGAL_CKVA_CURVE_RENDERER_TRAITS_H
#define CGAL_CKVA_CURVE_RENDERER_TRAITS_H #define CGAL_CKVA_CURVE_RENDERER_TRAITS_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/function_objects.h> #include <CGAL/function_objects.h>

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
// //
@ -17,7 +17,10 @@
*/ */
#ifndef CGAL_CKVA_SUBDIVISION_1_H #ifndef CGAL_CKVA_SUBDIVISION_1_H
#define CGAL_CKVA_SUBDIVISION_1_H 1 #define CGAL_CKVA_SUBDIVISION_1_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <vector> #include <vector>
#include <boost/multi_index_container.hpp> #include <boost/multi_index_container.hpp>

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
// //
@ -17,7 +17,10 @@
*/ */
#ifndef CGAL_CKVA_SUBDIVISION_2_H #ifndef CGAL_CKVA_SUBDIVISION_2_H
#define CGAL_CKVA_SUBDIVISION_2_H 1 #define CGAL_CKVA_SUBDIVISION_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#warning this file is considered obsolete #warning this file is considered obsolete

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de> // Author(s) : Pavel Emeliyanenko <asm@mpi-sb.mpg.de>
@ -13,6 +13,9 @@
#ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_TEST_SIMPLE_MODELS_H #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_TEST_SIMPLE_MODELS_H
#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_TEST_SIMPLE_MODELS_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_TEST_SIMPLE_MODELS_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*!\file include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h /*!\file include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h
* \brief defines dummy implementations satisfying Curve_kernel_2 * \brief defines dummy implementations satisfying Curve_kernel_2
* concept requirenments * concept requirenments

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-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) : Ron Wein <wein@post.tau.ac.il>
@ -14,6 +14,9 @@
#ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H
#define CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/graph_traits_Arrangement_2.h> #include <CGAL/graph_traits_Arrangement_2.h>
#endif //CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H #endif //CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H

View File

@ -5,7 +5,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-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) : Ron Wein <wein@post.tau.ac.il>
@ -14,6 +14,9 @@
#ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H
#define CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/graph_traits_dual_arrangement_2.h> #include <CGAL/graph_traits_dual_arrangement_2.h>
#endif //CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H #endif //CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H

View File

@ -9,7 +9,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s): Efi Fogel <efifogel@gmail.com> // Author(s): Efi Fogel <efifogel@gmail.com>
@ -17,6 +17,9 @@
#ifndef CGAL_DRAW_ARRANGEMENT_2_H #ifndef CGAL_DRAW_ARRANGEMENT_2_H
#define CGAL_DRAW_ARRANGEMENT_2_H #define CGAL_DRAW_ARRANGEMENT_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
#include <CGAL/config.h> #include <CGAL/config.h>
#include <unordered_map> #include <unordered_map>

View File

@ -72,13 +72,23 @@ if(CGAL_DISABLE_GMP)
endif() endif()
if(CGAL_DISABLE_GMP) if(CGAL_DISABLE_GMP)
message(STATUS "GMP is disable. Try to use LEDA instead.") if (CGAL_USE_LEDA)
set(GMPZ_NT ${LEDA_INT_NT}) message(STATUS "GMP is disabled, try to use LEDA instead.")
set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT}) set(GMPZ_NT ${LEDA_INT_NT})
set(CGAL_GMPQ_NT ${LEDA_RAT_NT}) set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT})
set(LAZY_CGAL_GMPQ_NT ${LAZY_LEDA_RAT_NT}) set(CGAL_GMPQ_NT ${LEDA_RAT_NT})
set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT}) set(LAZY_CGAL_GMPQ_NT ${LAZY_LEDA_RAT_NT})
set(CGAL_GMPZ_NT ${LEDA_INT_NT}) set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT})
set(CGAL_GMPZ_NT ${LEDA_INT_NT})
else()
message(STATUS "GMP is disabled, try to use MP float instead.")
set(GMPZ_NT ${MP_FLOAT_NT})
set(QUOTIENT_CGAL_GMPZ_NT ${QUOTIENT_MP_FLOAT_NT})
set(CGAL_GMPQ_NT ${QUOTIENT_MP_FLOAT_NT})
set(LAZY_CGAL_GMPQ_NT ${LAZY_QUOTIENT_MP_FLOAT_NT})
set(LAZY_GMPZ_NT ${LAZY_QUOTIENT_MP_FLOAT_NT})
set(CGAL_GMPZ_NT ${MP_FLOAT_NT})
endif()
endif() endif()
set(COMPARE 1) set(COMPARE 1)

View File

@ -78,13 +78,23 @@ CORE_INT_NT=15
CORE_RAT_NT=16 CORE_RAT_NT=16
if [ -n "${CGAL_DISABLE_GMP}" ]; then if [ -n "${CGAL_DISABLE_GMP}" ]; then
echo GMP is disable. Try to use LEDA instead. if [ -n "CGAL_USE_LEDA" ]; then
GMPZ_NT=$LEDA_INT_NT echo GMP is disabled, try to use LEDA instead.
QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT GMPZ_NT=$LEDA_INT_NT
CGAL_GMPQ_NT=$LEDA_RAT_NT QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT
LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT CGAL_GMPQ_NT=$LEDA_RAT_NT
LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT
CGAL_GMPZ_NT=$LEDA_INT_NT LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT
CGAL_GMPZ_NT=$LEDA_INT_NT
else
echo GMP is disabled, try to use MP float instead.
GMPZ_NT=$MP_FLOAT_NT
QUOTIENT_CGAL_GMPZ_NT=$QUOTIENT_MP_FLOAT_NT
CGAL_GMPQ_NT=$QUOTIENT_MP_FLOAT_NT
LAZY_CGAL_GMPQ_NT=$LAZY_QUOTIENT_MP_FLOAT_NT
LAZY_GMPZ_NT=$LAZY_QUOTIENT_MP_FLOAT_NT
CGAL_GMPZ_NT=$MP_FLOAT_NT
fi
fi fi
COMPARE=1 COMPARE=1

View File

@ -9,7 +9,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr> // Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
@ -17,6 +17,9 @@
#ifndef CGAL_DRAW_POLYGON_SET_2_H #ifndef CGAL_DRAW_POLYGON_SET_2_H
#define CGAL_DRAW_POLYGON_SET_2_H #define CGAL_DRAW_POLYGON_SET_2_H
#include <CGAL/license/Boolean_set_operations_2.h>
#include <CGAL/Qt/Basic_viewer_qt.h> #include <CGAL/Qt/Basic_viewer_qt.h>
#ifdef DOXYGEN_RUNNING #ifdef DOXYGEN_RUNNING

View File

@ -10,6 +10,10 @@
// //
// Author(s) : Kaspar Fischer <fischerk@inf.ethz.ch> // Author(s) : Kaspar Fischer <fischerk@inf.ethz.ch>
#ifndef CGAL_APPROXIMATE_MIN_ELLIPSOID_D_APPROXIMATE_MIN_ELLIPSOID_D_IMPL_H
#define CGAL_APPROXIMATE_MIN_ELLIPSOID_D_APPROXIMATE_MIN_ELLIPSOID_D_IMPL_H
#include <CGAL/license/Bounding_volumes.h>
#include <CGAL/Default_diagonalize_traits.h> #include <CGAL/Default_diagonalize_traits.h>
@ -272,3 +276,5 @@ namespace CGAL {
} }
} }
#endif //CGAL_APPROXIMATE_MIN_ELLIPSOID_D_APPROXIMATE_MIN_ELLIPSOID_D_IMPL_H

View File

@ -10,6 +10,11 @@
// //
// Author(s) : Kaspar Fischer <fischerk@inf.ethz.ch> // Author(s) : Kaspar Fischer <fischerk@inf.ethz.ch>
#ifndef CGAL_APPROX_MIN_ELLIPSOID_KHACHIYAN_APPROX_IMPL_H
#define CGAL_APPROX_MIN_ELLIPSOID_KHACHIYAN_APPROX_IMPL_H
#include <CGAL/license/Bounding_volumes.h>
// Note: whenever a comment refers to "Khachiyan's paper" then the // Note: whenever a comment refers to "Khachiyan's paper" then the
// paper "Rounding of polytopes in the real number model of // paper "Rounding of polytopes in the real number model of
// computation" is meant (Mathematics of Operations Research, Vol. 21, // computation" is meant (Mathematics of Operations Research, Vol. 21,
@ -663,3 +668,5 @@ namespace CGAL {
} }
} }
#endif // CGAL_APPROX_MIN_ELLIPSOID_KHACHIYAN_APPROX_IMPL_H

View File

@ -10,6 +10,11 @@
// //
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner // Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner
#ifndef CGAL_MIN_CIRCLE_2_MIN_CIRCLE_2_IMPL_H
#define CGAL_MIN_CIRCLE_2_MIN_CIRCLE_2_IMPL_H
#include <CGAL/license/Bounding_volumes.h>
#include <iterator> #include <iterator>
namespace CGAL { namespace CGAL {
@ -98,3 +103,5 @@ operator >> ( std::istream& is, CGAL::Min_circle_2<Traits_>& min_circle)
} //namespace CGAL } //namespace CGAL
// ===== EOF ================================================================== // ===== EOF ==================================================================
#endif // CGAL_MIN_CIRCLE_2_MIN_CIRCLE_2_IMPL_H

View File

@ -10,6 +10,11 @@
// //
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner // Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner
#ifndef CGAL_MIN_SPHERE_D_OPTIMISATION_CIRCLE_2_IMPL_H
#define CGAL_MIN_SPHERE_D_OPTIMISATION_CIRCLE_2_IMPL_H
#include <CGAL/license/Bounding_volumes.h>
// includes // includes
# include <CGAL/assertions.h> # include <CGAL/assertions.h>
@ -89,3 +94,5 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2<K_>& c)
} //namespace CGAL } //namespace CGAL
// ===== EOF ================================================================== // ===== EOF ==================================================================
#endif //CGAL_MIN_SPHERE_D_OPTIMISATION_CIRCLE_2_IMPL_H

View File

@ -10,6 +10,11 @@
// //
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner // Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner
#ifndef CGAL_MIN_ELLIPSE_2_MIN_ELLIPSE_2_IMP_H
#define CGAL_MIN_ELLIPSE_2_MIN_ELLIPSE_2_IMP_H
#include <CGAL/license/Bounding_volumes.h>
#include <iterator> #include <iterator>
namespace CGAL { namespace CGAL {
@ -98,3 +103,5 @@ operator >> ( std::istream& is, CGAL::Min_ellipse_2<Traits_>& min_ellipse)
} //namespace CGAL } //namespace CGAL
// ===== EOF ================================================================== // ===== EOF ==================================================================
#endif // CGAL_MIN_ELLIPSE_2_MIN_ELLIPSE_2_IMP_H

View File

@ -10,6 +10,11 @@
// //
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner // Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner
#ifndef CGAL_MIN_ELLIPSE_2_OPTIMISATION_ELLIPSE_2_IMPL_H
#define CGAL_MIN_ELLIPSE_2_OPTIMISATION_ELLIPSE_2_IMPL_H
#include <CGAL/license/Bounding_volumes.h>
namespace CGAL { namespace CGAL {
// Class implementation (continued) // Class implementation (continued)
@ -116,3 +121,5 @@ operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2<K_>& e)
} //namespace CGAL } //namespace CGAL
// ===== EOF ================================================================== // ===== EOF ==================================================================
#endif // CGAL_MIN_ELLIPSE_2_OPTIMISATION_ELLIPSE_2_IMPL_H

View File

@ -9,7 +9,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch> // Author(s) : Sven Schoenherr <sven@inf.ethz.ch>
@ -17,6 +17,9 @@
#ifndef CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_2_H #ifndef CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_2_H
#define CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_2_H #define CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_2_H
#include <CGAL/license/Bounding_volumes.h>
// includes // includes
# include <CGAL/Optimisation/Access_dimension_2.h> # include <CGAL/Optimisation/Access_dimension_2.h>
# include <CGAL/Optimisation/Access_coordinates_begin_2.h> # include <CGAL/Optimisation/Access_coordinates_begin_2.h>

View File

@ -9,7 +9,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch> // Author(s) : Sven Schoenherr <sven@inf.ethz.ch>
@ -17,6 +17,9 @@
#ifndef CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_3_H #ifndef CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_3_H
#define CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_3_H #define CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_3_H
#include <CGAL/license/Bounding_volumes.h>
// includes // includes
# include <CGAL/Optimisation/Access_dimension_3.h> # include <CGAL/Optimisation/Access_dimension_3.h>
# include <CGAL/Optimisation/Access_coordinates_begin_3.h> # include <CGAL/Optimisation/Access_coordinates_begin_3.h>

View File

@ -9,7 +9,7 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch> // Author(s) : Sven Schoenherr <sven@inf.ethz.ch>
@ -17,6 +17,9 @@
#ifndef CGAL_MIN_SPHERE_ANULUS_D_TRAITS_D_H #ifndef CGAL_MIN_SPHERE_ANULUS_D_TRAITS_D_H
#define CGAL_MIN_SPHERE_ANULUS_D_TRAITS_D_H #define CGAL_MIN_SPHERE_ANULUS_D_TRAITS_D_H
#include <CGAL/license/Bounding_volumes.h>
// includes // includes
# include <CGAL/Optimisation/Access_dimension_d.h> # include <CGAL/Optimisation/Access_dimension_d.h>
# include <CGAL/Optimisation/Access_coordinates_begin_d.h> # include <CGAL/Optimisation/Access_coordinates_begin_d.h>

View File

@ -11,6 +11,11 @@
// Author(s) : Sven Schoenherr <sven@inf.fu-berlin.de> // Author(s) : Sven Schoenherr <sven@inf.fu-berlin.de>
// Bernd Gaertner // Bernd Gaertner
#ifndef CGAL_MIN_SPHERE_D_MIN_SPHERE_D_IMPL_H
#define CGAL_MIN_SPHERE_D_MIN_SPHERE_D_IMPL_H
#include <CGAL/license/Bounding_volumes.h>
#include <iterator> #include <iterator>
namespace CGAL { namespace CGAL {
@ -105,3 +110,5 @@ operator >> ( std::istream& is, Min_sphere_d<Traits>& min_sphere)
} //namespace CGAL } //namespace CGAL
// ===== EOF ================================================================== // ===== EOF ==================================================================
#endif //CGAL_MIN_SPHERE_D_MIN_SPHERE_D_IMPL_H

View File

@ -463,60 +463,79 @@ int _readAnalyzeHeader( _image* im, const char* name,
for ( i=0; i<im->nuser; i++ ) im->user[i] = nullptr; for ( i=0; i<im->nuser; i++ ) im->user[i] = nullptr;
i = 0 ; i = 0 ;
im->user[i] = (char *) ImageIO_alloc((strlen("Data lost in the Analyze -> ImageIO conversion:") + 1)); size_t buffer_size;
sprintf( im->user[i++], "Data lost in the Analyze -> ImageIO conversion:" ); buffer_size = strlen("Data lost in the Analyze -> ImageIO conversion:") + 1;
im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, "Data lost in the Analyze -> ImageIO conversion:" );
im->user[i] = (char *) ImageIO_alloc((strlen(" descrip: ") + 1 + strlen(analyzeHeader->hist.descrip) )); buffer_size = snprintf(nullptr, 0, " descrip: %s", analyzeHeader->hist.descrip) + 1;
sprintf( im->user[i++], " descrip: %s", analyzeHeader->hist.descrip ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " descrip: %s", analyzeHeader->hist.descrip );
im->user[i] = (char *) ImageIO_alloc((strlen(" aux_file: ") + 1 + strlen(analyzeHeader->hist.descrip) )); buffer_size = snprintf(nullptr, 0, " aux_file: %s", analyzeHeader->hist.descrip ) + 1;
sprintf( im->user[i++], " aux_file: %s", analyzeHeader->hist.descrip ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " aux_file: %s", analyzeHeader->hist.descrip );
im->user[i] = (char *) ImageIO_alloc((strlen(" orient: ") + 1+ 2)); buffer_size = snprintf(nullptr, 0, " orient: %d", analyzeHeader->hist.orient ) + 1;
sprintf( im->user[i++], " orient: %d", analyzeHeader->hist.orient ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " orient: %d", analyzeHeader->hist.orient );
im->user[i] = (char *) ImageIO_alloc((strlen(" originator: ") + 1 + strlen(analyzeHeader->hist.originator) )); buffer_size = snprintf(nullptr, 0, " originator: %s", analyzeHeader->hist.originator ) + 1;
sprintf( im->user[i++], " originator: %s", analyzeHeader->hist.originator ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " originator: %s", analyzeHeader->hist.originator );
im->user[i] = (char *) ImageIO_alloc((strlen(" generated: ") + 1 + strlen(analyzeHeader->hist.generated) )); buffer_size = snprintf(nullptr, 0, " generated: %s", analyzeHeader->hist.generated ) + 1;
sprintf( im->user[i++], " generated: %s", analyzeHeader->hist.generated ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " generated: %s", analyzeHeader->hist.generated );
im->user[i] = (char *) ImageIO_alloc((strlen(" scannum: ") + 1 + strlen(analyzeHeader->hist.scannum) )); buffer_size = snprintf(nullptr, 0, " scannum: %s", analyzeHeader->hist.scannum ) + 1;
sprintf( im->user[i++], " scannum: %s", analyzeHeader->hist.scannum ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " scannum: %s", analyzeHeader->hist.scannum );
im->user[i] = (char *) ImageIO_alloc((strlen(" patient_id: ") + 1 + strlen(analyzeHeader->hist.patient_id) )); buffer_size = snprintf(nullptr, 0, " patient_id: %s", analyzeHeader->hist.patient_id ) +1;
sprintf( im->user[i++], " patient_id: %s", analyzeHeader->hist.patient_id ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " patient_id: %s", analyzeHeader->hist.patient_id );
im->user[i] = (char *) ImageIO_alloc((strlen(" exp_date: ") + 1 + strlen(analyzeHeader->hist.exp_date) )); buffer_size = snprintf(nullptr, 0, " exp_date: %s", analyzeHeader->hist.exp_date ) + 1;
sprintf( im->user[i++], " exp_date: %s", analyzeHeader->hist.exp_date ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " exp_date: %s", analyzeHeader->hist.exp_date );
im->user[i] = (char *) ImageIO_alloc((strlen(" exp_time: ") + 1 + strlen(analyzeHeader->hist.exp_time) )); buffer_size = snprintf(nullptr, 0, " exp_time: %s", analyzeHeader->hist.exp_time ) + 1;
sprintf( im->user[i++], " exp_time: %s", analyzeHeader->hist.exp_time ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " exp_time: %s", analyzeHeader->hist.exp_time );
buffer_size = snprintf(nullptr, 0, " views: %d", analyzeHeader->hist.views ) + 1;
/* A 32 bit int doesn't print on more than 11 chars */ /* A 32 bit int doesn't print on more than 11 chars */
im->user[i] = (char *) ImageIO_alloc((strlen(" views: ") + 11 + 1)); im->user[i] = (char *) ImageIO_alloc(buffer_size);
sprintf( im->user[i++], " views: %d", analyzeHeader->hist.views ); snprintf( im->user[i++], buffer_size, " views: %d", analyzeHeader->hist.views );
im->user[i] = (char *) ImageIO_alloc((strlen(" vols_added: ") + 11 + 1)); buffer_size = snprintf(nullptr, 0, " vols_added: %d", analyzeHeader->hist.vols_added ) + 1;
sprintf( im->user[i++], " vols_added: %d", analyzeHeader->hist.vols_added ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " vols_added: %d", analyzeHeader->hist.vols_added );
im->user[i] = (char *) ImageIO_alloc((strlen(" start_field: ") + 11 + 1)); buffer_size = snprintf(nullptr, 0, " start_field: %d", analyzeHeader->hist.start_field ) + 1;
sprintf( im->user[i++], " start_field: %d", analyzeHeader->hist.start_field ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " start_field: %d", analyzeHeader->hist.start_field );
im->user[i] = (char *) ImageIO_alloc((strlen(" field_skip: ") + 11 + 1)); buffer_size = snprintf(nullptr, 0, " field_skip: %d", analyzeHeader->hist.field_skip ) + 1;
sprintf( im->user[i++], " field_skip: %d", analyzeHeader->hist.field_skip ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " field_skip: %d", analyzeHeader->hist.field_skip );
im->user[i] = (char *) ImageIO_alloc((strlen(" omax: ") + 11 + 1)); buffer_size = snprintf(nullptr, 0, " omax: %d", analyzeHeader->hist.omax ) + 1;
sprintf( im->user[i++], " omax: %d", analyzeHeader->hist.omax ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " omax: %d", analyzeHeader->hist.omax );
im->user[i] = (char *) ImageIO_alloc((strlen(" omin: ") + 11 + 1)); buffer_size = snprintf(nullptr, 0, " omin: %d", analyzeHeader->hist.omin ) + 1;
sprintf( im->user[i++], " omin: %d", analyzeHeader->hist.omin ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " omin: %d", analyzeHeader->hist.omin );
im->user[i] = (char *) ImageIO_alloc((strlen(" smax: ") + 11 + 1)); buffer_size = snprintf(nullptr, 0, " smax: %d", analyzeHeader->hist.smax ) + 1;
sprintf( im->user[i++], " smax: %d", analyzeHeader->hist.smax ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " smax: %d", analyzeHeader->hist.smax );
im->user[i] = (char *) ImageIO_alloc((strlen(" smin: ") + 11 + 1)); buffer_size = snprintf(nullptr, 0, " smin: %d", analyzeHeader->hist.smin ) +1;
sprintf( im->user[i++], " smin: %d", analyzeHeader->hist.smin ); im->user[i] = (char *) ImageIO_alloc(buffer_size);
snprintf( im->user[i++], buffer_size, " smin: %d", analyzeHeader->hist.smin );
/* header is read. close header file and open data file. */ /* header is read. close header file and open data file. */

View File

@ -130,10 +130,10 @@ int writeGis( char *name, _image* im) {
do { do {
memset( str, 0, _LGTH_STRING_ ); memset( str, 0, _LGTH_STRING_ );
for ( j=0; j<n && i<size; j++, i++ ) { for ( j=0; j<n && i<size; j++, i++ ) {
sprintf( str+strlen(str), "%d", theBuf[i] ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "%d", theBuf[i] );
if ( j<n && i<size ) sprintf( str+strlen(str), " " ); if ( j<n && i<size ) snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), " " );
} }
sprintf( str+strlen(str), "\n" ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "\n" );
done = ImageIO_write( im, str, strlen( str ) ); done = ImageIO_write( im, str, strlen( str ) );
res = (done == strlen( str )) ? int(done) : -1; res = (done == strlen( str )) ? int(done) : -1;
if ( res <= 0 ) { if ( res <= 0 ) {
@ -150,10 +150,10 @@ int writeGis( char *name, _image* im) {
do { do {
memset( str, 0, _LGTH_STRING_ ); memset( str, 0, _LGTH_STRING_ );
for ( j=0; j<n && i<size; j++, i++ ) { for ( j=0; j<n && i<size; j++, i++ ) {
sprintf( str+strlen(str), "%d", theBuf[i] ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "%d", theBuf[i] );
if ( j<n && i<size ) sprintf( str+strlen(str), " " ); if ( j<n && i<size ) snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), " " );
} }
sprintf( str+strlen(str), "\n" ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "\n" );
done = ImageIO_write( im, str, strlen( str ) ); done = ImageIO_write( im, str, strlen( str ) );
res = (done == strlen( str )) ? int(done) : -1; res = (done == strlen( str )) ? int(done) : -1;
if ( res <= 0 ) { if ( res <= 0 ) {
@ -178,10 +178,10 @@ int writeGis( char *name, _image* im) {
do { do {
memset( str, 0, _LGTH_STRING_ ); memset( str, 0, _LGTH_STRING_ );
for ( j=0; j<n && i<size; j++, i++ ) { for ( j=0; j<n && i<size; j++, i++ ) {
sprintf( str+strlen(str), "%d", theBuf[i] ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "%d", theBuf[i] );
if ( j<n && i<size ) sprintf( str+strlen(str), " " ); if ( j<n && i<size ) snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), " " );
} }
sprintf( str+strlen(str), "\n" ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "\n" );
done = ImageIO_write( im, str, strlen( str ) ); done = ImageIO_write( im, str, strlen( str ) );
res = (done == strlen( str )) ? int(done) : -1; res = (done == strlen( str )) ? int(done) : -1;
if ( res <= 0 ) { if ( res <= 0 ) {
@ -198,10 +198,10 @@ int writeGis( char *name, _image* im) {
do { do {
memset( str, 0, _LGTH_STRING_ ); memset( str, 0, _LGTH_STRING_ );
for ( j=0; j<n && i<size; j++, i++ ) { for ( j=0; j<n && i<size; j++, i++ ) {
sprintf( str+strlen(str), "%d", theBuf[i] ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "%d", theBuf[i] );
if ( j<n && i<size ) sprintf( str+strlen(str), " " ); if ( j<n && i<size ) snprintf( str+strlen(str),_LGTH_STRING_ - strlen(str), " " );
} }
sprintf( str+strlen(str), "\n" ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "\n" );
done = ImageIO_write( im, str, strlen( str ) ); done = ImageIO_write( im, str, strlen( str ) );
res = (done == strlen( str )) ? int(done) : -1; res = (done == strlen( str )) ? int(done) : -1;
if ( res <= 0 ) { if ( res <= 0 ) {

View File

@ -77,22 +77,22 @@ int _writeInrimageHeader(const _image *im, ENDIANNESS end) {
switch(im->wordKind) { switch(im->wordKind) {
case WK_FLOAT: case WK_FLOAT:
sprintf(type, "float"); snprintf(type, 30, "float");
scale[0] = '\0'; scale[0] = '\0';
break; break;
case WK_FIXED: case WK_FIXED:
switch(im->sign) { switch(im->sign) {
case SGN_SIGNED: case SGN_SIGNED:
sprintf(type, "signed fixed"); snprintf(type, 30, "signed fixed");
break; break;
case SGN_UNSIGNED: case SGN_UNSIGNED:
sprintf(type, "unsigned fixed"); snprintf(type, 30, "unsigned fixed");
break; break;
default: default:
return -1; return -1;
} }
sprintf(scale, "SCALE=2**0\n"); snprintf(scale, 20, "SCALE=2**0\n");
break; break;
default: default:
@ -101,17 +101,17 @@ int _writeInrimageHeader(const _image *im, ENDIANNESS end) {
switch(end) { switch(end) {
case END_LITTLE: case END_LITTLE:
sprintf(endianness, "decm"); snprintf(endianness, 5, "decm");
break; break;
case END_BIG: case END_BIG:
sprintf(endianness, "sun"); snprintf(endianness, 5, "sun");
break; break;
default: default:
/* fix architecture endianness */ /* fix architecture endianness */
if( _getEndianness() == END_LITTLE) if( _getEndianness() == END_LITTLE)
sprintf(endianness, "decm"); snprintf(endianness, 5, "decm");
else else
sprintf(endianness, "sun"); snprintf(endianness, 5, "sun");
break; break;
} }

View File

@ -357,7 +357,7 @@ int writeMincFile( const _image* im, const char *filename,
strcat(newname, filename + i + 1); strcat(newname, filename + i + 1);
} }
else else
sprintf(newname, "#TMP#%s", filename); snprintf(newname,strlen(filename) + 10, "#TMP#%s", filename);
} }
} }

View File

@ -524,14 +524,14 @@ int writePgmImage(char *name,_image *im )
} }
if ( im->dataMode == DM_ASCII ) if ( im->dataMode == DM_ASCII )
sprintf( string, "%s\n", PGM_ASCII_MAGIC ); snprintf( string, 256, "%s\n", PGM_ASCII_MAGIC );
else else
sprintf( string, "%s\n", PGM_MAGIC ); snprintf( string, 256, "%s\n", PGM_MAGIC );
ImageIO_write( im, string, strlen( string ) ); ImageIO_write( im, string, strlen( string ) );
sprintf( string, "# CREATOR: pnm.c $Revision$ $Date$\n" ); snprintf( string, 256, "# CREATOR: pnm.c $Revision$ $Date$\n" );
ImageIO_write( im, string, strlen( string ) ); ImageIO_write( im, string, strlen( string ) );
sprintf( string, "%zu %zu\n", im->xdim, im->ydim ); snprintf( string, 256, "%zu %zu\n", im->xdim, im->ydim );
ImageIO_write( im, string, strlen( string ) ); ImageIO_write( im, string, strlen( string ) );
max = 0; max = 0;
switch ( im->wdim ) { switch ( im->wdim ) {
@ -552,7 +552,7 @@ int writePgmImage(char *name,_image *im )
} }
/* max == 0 causes problems for xv */ /* max == 0 causes problems for xv */
if ( max == 0 ) max = 1; if ( max == 0 ) max = 1;
sprintf( string, "%d\n", max ); snprintf( string, 256, "%d\n", max );
ImageIO_write( im, string, strlen( string ) ); ImageIO_write( im, string, strlen( string ) );
if ( im->dataMode == DM_ASCII ) { if ( im->dataMode == DM_ASCII ) {
@ -574,10 +574,10 @@ int writePgmImage(char *name,_image *im )
do { do {
memset( str, 0, _LGTH_STRING_ ); memset( str, 0, _LGTH_STRING_ );
for ( j=0; j<n && i<size; j++, i++ ) { for ( j=0; j<n && i<size; j++, i++ ) {
sprintf( str+strlen(str), "%d", theBuf[i] ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "%d", theBuf[i] );
if ( j<n && i<size ) sprintf( str+strlen(str), " " ); if ( j<n && i<size ) snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), " " );
} }
sprintf( str+strlen(str), "\n" ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "\n" );
if ( ImageIO_write( im, str, strlen( str ) ) <= 0 ) { if ( ImageIO_write( im, str, strlen( str ) ) <= 0 ) {
fprintf(stderr, "writePgmImage: error when writing data in \'%s\'\n", name ); fprintf(stderr, "writePgmImage: error when writing data in \'%s\'\n", name );
return( -3 ); return( -3 );
@ -591,10 +591,10 @@ int writePgmImage(char *name,_image *im )
do { do {
memset( str, 0, _LGTH_STRING_ ); memset( str, 0, _LGTH_STRING_ );
for ( j=0; j<n && i<size; j++, i++ ) { for ( j=0; j<n && i<size; j++, i++ ) {
sprintf( str+strlen(str), "%d", theBuf[i] ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "%d", theBuf[i] );
if ( j<n && i<size ) sprintf( str+strlen(str), " " ); if ( j<n && i<size ) snprintf( str+strlen(str), 2, " " );
} }
sprintf( str+strlen(str), "\n" ); snprintf( str+strlen(str), _LGTH_STRING_ - strlen(str), "\n" );
if ( ImageIO_write( im, str, strlen( str ) ) <= 0 ) { if ( ImageIO_write( im, str, strlen( str ) ) <= 0 ) {
fprintf(stderr, "writePgmImage: error when writing data in \'%s\'\n", name ); fprintf(stderr, "writePgmImage: error when writing data in \'%s\'\n", name );
return( -3 ); return( -3 );
@ -629,6 +629,3 @@ int writePgmImage(char *name,_image *im )
im->openMode = OM_CLOSE; im->openMode = OM_CLOSE;
return 1; return 1;
} }

View File

@ -5,11 +5,11 @@
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Philipp Möller and Sebastien Loriot // Author(s) : Philipp Möller and Sebastien Loriot
@ -17,6 +17,9 @@
#ifndef CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H #ifndef CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H
#define CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H #define CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H
#include <CGAL/license/Circular_kernel_2.h>
#include <CGAL/Intersection_traits.h> #include <CGAL/Intersection_traits.h>
#include <variant> #include <variant>

View File

@ -9,6 +9,8 @@
// //
// Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado
#include <CGAL/license/Circular_kernel_2.h>
// Partially supported by the IST Programme of the EU as a Shared-cost // Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473 // RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces) // (ECG - Effective Computational Geometry for Curves and Surfaces)

View File

@ -9,6 +9,8 @@
// //
// Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado
#include <CGAL/license/Circular_kernel_2.h>
// Partially supported by the IST Programme of the EU as a Shared-cost // Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473 // RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces) // (ECG - Effective Computational Geometry for Curves and Surfaces)

Some files were not shown because too many files have changed in this diff Show More