\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.4 - 2D Arrangements
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Arrangement_with_history_2< Traits, Dcel > Class Template Reference

#include <CGAL/Arrangement_with_history_2.h>

Inherits from

CGAL::Arrangement_2< Traits, Dcel >.

Definition

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:

  • The 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.
  • The Dcel template-parameter should be instantiated with a class that is a model of the ArrangementDcelWithRebind concept. The value of this parameter is by default Arr_default_dcel<Traits>.
See Also
ArrangementDcel
Arr_default_dcel<Traits>
ArrangementTraits_2
Arrangement_2<Traits,Dcel>
insertion functions
removal functions
overlaying arrangements
Examples:
Arrangement_on_surface_2/curve_history.cpp, Arrangement_on_surface_2/edge_manipulation_curve_history.cpp, and Arrangement_on_surface_2/io_curve_history.cpp.

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 Vertex, Halfedge and Face are defined, as well as all handle, iterator and circulator types, as defined by the Arrangement_2 class-template.

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

Selfoperator= (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 Arrangement_2 reference pages for the full list.

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 Arrangement_2 class, as they also maintain the cross-relationships between the input curves and the edges they induce.

See the Arrangement_2 reference pages for the full list of functions for modifying arrangement vertices

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...
 

Member Typedef Documentation

template<typename Traits , typename Dcel >
typedef Traits_2::Curve_2 CGAL::Arrangement_with_history_2< Traits, Dcel >::Curve_2

the curve type, as defined by the traits class.

template<typename Traits , typename Dcel >
typedef unspecified_type CGAL::Arrangement_with_history_2< Traits, Dcel >::Curve_handle

a handle for an input curve.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
typedef Traits_2::Point_2 CGAL::Arrangement_with_history_2< Traits, Dcel >::Point_2

the point type, as defined by the traits class.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
typedef unspecified_type CGAL::Arrangement_with_history_2< Traits, Dcel >::Traits_2

the traits class in use.

template<typename Traits , typename Dcel >
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.

Constructor & Destructor Documentation

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
CGAL::Arrangement_with_history_2< Traits, Dcel >::Arrangement_with_history_2 ( const Self other)

copy constructor.

template<typename Traits , typename Dcel >
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.

Member Function Documentation

template<typename Traits , typename Dcel >
void CGAL::Arrangement_with_history_2< Traits, Dcel >::assign ( const Self other)

assigns the contents of another arrangement.

template<typename Traits , typename Dcel >
void CGAL::Arrangement_with_history_2< Traits, Dcel >::clear ( )

clears the arrangement.

template<typename Traits , typename Dcel >
Curve_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::curves_begin ( )

returns the begin-iterator of the curves inducing the arrangement.

template<typename Traits , typename Dcel >
Curve_iterator CGAL::Arrangement_with_history_2< Traits, Dcel >::curves_end ( )

returns the past-the-end iterator of the curves inducing the arrangement.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

Precondition
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.
template<typename Traits , typename Dcel >
Size CGAL::Arrangement_with_history_2< Traits, Dcel >::number_of_curves ( ) const

returns the number of input curves that induce the arrangement.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
Self& CGAL::Arrangement_with_history_2< Traits, Dcel >::operator= ( other  )

assignment operator.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

template<typename Traits , typename Dcel >
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.

Precondition
p lies in the interior of the curve associated with e.