CGAL 4.4 - 2D Arrangements
|
#include <CGAL/Arrangement_with_history_2.h>
CGAL::Arrangement_2< Traits, Dcel >.
An object arr
of the class Arrangement_with_history_2
represents the planar subdivision induced by a set of input curves \( \cal C\). The arrangement is represented as a doubly-connected edge-list (Dcel). As is the case for the Arrangement_2<Traits,Dcel>
, each Dcel vertex is associated with a point and each edge is associated with an \( x\)-monotone curve whose interior is disjoint from all other edges and vertices. Each such \( x\)-monotone curve is a subcurve of some \( C \in \cal C\) - or may represent an overlap among several curves in \( \cal C\).
The Arrangement_with_history_2
class-template extends the Arrangement_2
class-template by keeping an additional container of input curves representing \( \cal C\), and by maintaining a cross-mapping between these curves and the arrangement edges they induce. This way it is possible to determine the inducing curve(s) of each arrangement edge. This mapping also allows the traversal of input curves, and the traversal of edges induced by each curve.
The Arrangement_with_history_2
template has two parameters:
Traits
template-parameter should be instantiated with a model of the ArrangementTraits_2
concept. The traits class defines the Curve_2
type, which represents an input curve. It also defines the types of \( x\)-monotone curves and two-dimensional points, namely ArrangementTraits_2::X_monotone_curve_2
and ArrangementTraits_2::Point_2
, respectively, and supports basic geometric predicates on them. Dcel
template-parameter should be instantiated with a class that is a model of the ArrangementDcelWithRebind
concept. The value of this parameter is by default Arr_default_dcel<Traits>
. ArrangementDcel
Arr_default_dcel<Traits>
ArrangementTraits_2
Arrangement_2<Traits,Dcel>
insertion functions
removal functions
overlaying arrangements
Types | |
typedef Arrangement_with_history_2 < Traits_2, Dcel > | Self |
a private type used as an abbreviation of the Arrangement_with_history_2 type hereafter. More... | |
typedef unspecified_type | Traits_2 |
the traits class in use. More... | |
typedef Traits_2::Point_2 | Point_2 |
the point type, as defined by the traits class. More... | |
typedef Traits_2::X_monotone_curve_2 | X_monotone_curve_2 |
the \( x\)-monotone curve type, as defined by the traits class. More... | |
typedef Traits_2::Curve_2 | Curve_2 |
the curve type, as defined by the traits class. More... | |
In addition, the nested types | |
typedef unspecified_type | Curve_handle |
a handle for an input curve. More... | |
typedef unspecified_type | Curve_iterator |
a bidirectional iterator over the curves that induce the arrangement. More... | |
typedef unspecified_type | Induced_edge_iterator |
an iterator over the edges induced by an input curve. More... | |
typedef unspecified_type | Originating_curve_iterator |
an iterator for the curves that originate a given arrangement edge. More... | |
Creation | |
Arrangement_with_history_2 () | |
constructs an empty arrangement containing one unbounded face, which corresponds to the whole plane. More... | |
Arrangement_with_history_2 (const Self &other) | |
copy constructor. More... | |
Arrangement_with_history_2 (Traits_2 *traits) | |
constructs an empty arrangement that uses the given traits instance for performing the geometric predicates. More... | |
Assignment Methods | |
Self & | operator= (other) |
assignment operator. More... | |
void | assign (const Self &other) |
assigns the contents of another arrangement. More... | |
void | clear () |
clears the arrangement. More... | |
Access Functions for Input Curves | |
See the | |
Size | number_of_curves () const |
returns the number of input curves that induce the arrangement. More... | |
Curve_iterator | curves_begin () |
returns the begin-iterator of the curves inducing the arrangement. More... | |
Curve_iterator | curves_end () |
returns the past-the-end iterator of the curves inducing the arrangement. More... | |
Size | number_of_induced_edges (Curve_handle ch) const |
returns the number of arrangement edges induced by the curve ch . More... | |
Induced_edge_iterator | induced_edges_begin (Curve_handle ch) const |
returns the begin-iterator of the edges induced by the curve ch . More... | |
Induced_edge_iterator | induced_edges_end (Curve_handle ch) const |
returns the past-the-end iterator of the edges induced by the curve ch . More... | |
Size | number_of_originating_curves (Halfedge_handle e) const |
returns the number of input curves that originate the edge e . More... | |
Originating_curve_iterator | originating_curves_begin (Halfedge_handle e) const |
returns the begin-iterator of the curves originating the edge e . More... | |
Originating_curve_iterator | originating_curves_end (Halfedge_handle e) const |
returns the past-the-end iterator of the curves originating the edge e . More... | |
Modifying Arrangement Edges | |
The following functions override their counterparts in the See the | |
Halfedge_handle | split_edge (Halfedge_handle e, const Point_2 &p) |
splits the edge e into two edges (more precisely, into two halfedge pairs), at a given split point p . More... | |
Halfedge_handle | merge_edge (Halfedge_handle e1, Halfedge_handle e2) |
merges the edges represented by e1 and e2 into a single edge. More... | |
Face_handle | remove_edge (Halfedge_handle e, bool remove_source=true, bool remove_target=true) |
removes the edge e from the arrangement. More... | |
typedef Traits_2::Curve_2 CGAL::Arrangement_with_history_2< Traits, Dcel >::Curve_2 |
the curve type, as defined by the traits class.
typedef unspecified_type CGAL::Arrangement_with_history_2< Traits, Dcel >::Curve_handle |
a handle for an input curve.
typedef unspecified_type CGAL::Arrangement_with_history_2< Traits, Dcel >::Curve_iterator |
a bidirectional iterator over the curves that induce the arrangement.
Its value-type is Curve_2
.
typedef unspecified_type CGAL::Arrangement_with_history_2< Traits, Dcel >::Induced_edge_iterator |
an iterator over the edges induced by an input curve.
Its value type is Halfedge_handle
.
typedef unspecified_type CGAL::Arrangement_with_history_2< Traits, Dcel >::Originating_curve_iterator |
an iterator for the curves that originate a given arrangement edge.
Its value type is Curve_handle
.
typedef Traits_2::Point_2 CGAL::Arrangement_with_history_2< Traits, Dcel >::Point_2 |
the point type, as defined by the traits class.
typedef Arrangement_with_history_2<Traits_2,Dcel> CGAL::Arrangement_with_history_2< Traits, Dcel >::Self |
a private type used as an abbreviation of the Arrangement_with_history_2
type hereafter.
typedef unspecified_type CGAL::Arrangement_with_history_2< Traits, Dcel >::Traits_2 |
the traits class in use.
typedef Traits_2::X_monotone_curve_2 CGAL::Arrangement_with_history_2< Traits, Dcel >::X_monotone_curve_2 |
the \( x\)-monotone curve type, as defined by the traits class.
CGAL::Arrangement_with_history_2< Traits, Dcel >::Arrangement_with_history_2 | ( | ) |
constructs an empty arrangement containing one unbounded face, which corresponds to the whole plane.
CGAL::Arrangement_with_history_2< Traits, Dcel >::Arrangement_with_history_2 | ( | const Self & | other | ) |
copy constructor.
CGAL::Arrangement_with_history_2< Traits, Dcel >::Arrangement_with_history_2 | ( | Traits_2 * | traits | ) |
constructs an empty arrangement that uses the given traits
instance for performing the geometric predicates.
void CGAL::Arrangement_with_history_2< Traits, Dcel >::assign | ( | const Self & | other | ) |
assigns the contents of another arrangement.
void CGAL::Arrangement_with_history_2< Traits, Dcel >::clear | ( | ) |
clears the arrangement.
Curve_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::curves_begin | ( | ) |
returns the begin-iterator of the curves inducing the arrangement.
Curve_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::curves_end | ( | ) |
returns the past-the-end iterator of the curves inducing the arrangement.
Induced_edge_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::induced_edges_begin | ( | Curve_handle | ch | ) | const |
returns the begin-iterator of the edges induced by the curve ch
.
Induced_edge_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::induced_edges_end | ( | Curve_handle | ch | ) | const |
returns the past-the-end iterator of the edges induced by the curve ch
.
Halfedge_handle CGAL::Arrangement_with_history_2< Traits, Dcel >::merge_edge | ( | Halfedge_handle | e1, |
Halfedge_handle | e2 | ||
) |
merges the edges represented by e1
and e2
into a single edge.
The function returns a handle for one of the merged halfedges.
e1
and e2
share a common end-vertex, of degree \( 2\), and the \( x\)-monotone curves associated with e1
and e2
are mergeable into a single \( x\)-monotone curves. Size CGAL::Arrangement_with_history_2< Traits, Dcel >::number_of_curves | ( | ) | const |
returns the number of input curves that induce the arrangement.
Size CGAL::Arrangement_with_history_2< Traits, Dcel >::number_of_induced_edges | ( | Curve_handle | ch | ) | const |
returns the number of arrangement edges induced by the curve ch
.
Size CGAL::Arrangement_with_history_2< Traits, Dcel >::number_of_originating_curves | ( | Halfedge_handle | e | ) | const |
returns the number of input curves that originate the edge e
.
Self& CGAL::Arrangement_with_history_2< Traits, Dcel >::operator= | ( | other | ) |
assignment operator.
Originating_curve_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::originating_curves_begin | ( | Halfedge_handle | e | ) | const |
returns the begin-iterator of the curves originating the edge e
.
Originating_curve_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::originating_curves_end | ( | Halfedge_handle | e | ) | const |
returns the past-the-end iterator of the curves originating the edge e
.
Face_handle CGAL::Arrangement_with_history_2< Traits, Dcel >::remove_edge | ( | Halfedge_handle | e, |
bool | remove_source = true , |
||
bool | remove_target = true |
||
) |
removes the edge e
from the arrangement.
Since the e
may be the only edge incident to its source vertex (or its target vertex), this vertex can be removed as well. The flags remove_source
and remove_target
indicate whether the endpoints of e
should be removed, or whether they should be left as isolated vertices in the arrangement. If the operation causes two faces to merge, the merged face is returned. Otherwise, the face to which the edge was incident is returned.
Halfedge_handle CGAL::Arrangement_with_history_2< Traits, Dcel >::split_edge | ( | Halfedge_handle | e, |
const Point_2 & | p | ||
) |
splits the edge e
into two edges (more precisely, into two halfedge pairs), at a given split point p
.
The function returns a handle for the halfedge whose source is the same as e->source()
and whose target vertex is the split point.
p
lies in the interior of the curve associated with e
.