CGAL 5.3.2 - 2D Arrangements
CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 > Class Template Reference

#include <CGAL/Arr_polycurve_traits_2.h>

Definition

The Curve_2 type nested in the Arr_polycurve_traits_2 represents general continuous piecewise-linear subcurves (a polycurve can be self-intersecting) and support their construction from range of subcurves.

Construction of polycurves in various ways is supported using the construction functors. It is strongly recommended to avoid construction of Curve_2 objects directly and prefer the usage of the construction functors. The type Curve_2 has two template parameters, namely SubcurveType_2 and PointType_2, which are SubcurveTraits_2::Curve_2 and SubcurveTraits_2::Point_2 types. Thus, in general, the subcurves that a Curve_2 instance comprises could be either \(x\)-monotone or not!

The copy and default constructor as well as the assignment operator are provided for polycurve subcurves. In addition, an operator<< for the subcurves is defined for standard output streams, and an operator>> for the subcurves is defined for standard input streams.

Types

typedef std::vector< Subcurve_2Subcurves_container
 The container of the subcurves that comprises the polycurve.
 
typedef Subcurves_container::size_type Size
 The size of the container that comprises the polycurve.
 
typedef Subcurves_container::size_type size_type
 
typedef unspecified_type const_iterator
 
typedef unspecified_type const_reverse_iterator
 
typedef unspecified_type Subcurve_const_iterator
 A bidirectional constant iterator that allows traversing the subcurves that comprise the polycurve.
 
typedef unspecified_type Subcurve_const_reverse_iterator
 A bidirectional constant iterator that allows traversing the subcurves that comprise the polycurve.
 

Creation

 Curve_2 ()
 Default constructor that constructs an empty polycurve.
 
 Curve_2 (const Subcurve_2 subcurve)
 Construct a polycurve from one subcurve.
 
template<typename InputIterator >
 Curve_2 (Iterator first, Iterator last)
 Construct a polycurve defined by the given range of subcurves [first, last) (the value-type of InputIterator must be SubcurveTraits_2::Curve_2. More...
 

Access Functions

unsigned_int points () const
 
const_iterator begin () const
 
Subcurve_const_iterator begin_subcurves () const
 Obtain an iterator pointing at the first subcurve of the polycurve.
 
const_iterator end () const
 
Subcurve_const_iterator end_subcurves () const
 Get an iterator pointing at the past-the-end subcurve of the polycurve.
 
const_iterator rbegin () const
 
Subcurve_const_reverse_iterator rbegin_subcurves () const
 Obtain an iterator pointing at the last subcurve of the polycurve.
 
const_iterator rend () const
 
Subcurve_const_reverse_iterator rend_subcurves () const
 Obtain an iterator pointing at the past-the-end subcurve of the polycurve in reverse order.
 
size_type size () const
 
size_type number_of_subcurves () const
 Obtain the number of subcurves that comprise the polycurve.
 
SubcurveTraits_2::X_monotone_curve_2 operator[] (size_t k) const
 Obtain the \( k\)th subcurve of the polycurve. More...
 
Bbox_2 bbox () const
 Obtain the bounding box of the polycurve.
 

Operations

void push_back (const Subcurve_2 &subcurve)
 Append a subcurve to the polycurve at the back. More...
 
void push_front (const Subcurve_2 &subcurve)
 Append a subcurve to the polycurve at the front. More...
 
void push_back (const Point_2 &p)
 
void clear ()
 Reset the polycurve.
 

Member Typedef Documentation

◆ const_iterator

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
typedef unspecified_type CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::const_iterator
Deprecated:
A bidirectional iterator that allows traversing the points that comprise a polycurve's subcurves.

◆ const_reverse_iterator

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
typedef unspecified_type CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::const_reverse_iterator
Deprecated:
A bidirectional iterator that allows traversing the points that comprise a polycurve's subcurves.

Constructor & Destructor Documentation

◆ Curve_2()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
template<typename InputIterator >
CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::Curve_2 ( Iterator  first,
Iterator  last 
)

Construct a polycurve defined by the given range of subcurves [first, last) (the value-type of InputIterator must be SubcurveTraits_2::Curve_2.

In general, the subcurves might not be \(x\)-monotone, furthermore, they might not form a continuous polycurve.

Precondition
The subcurves in the range should form a continuous and well-oriented polycurve.
Deprecated:
For backwards compatibility, it is possible to call this constructor with a range whose value-type is SubcurveTraits_2::Point_2. In this case, the constructed polycurve will concatenate the \(n\)th point with the \((n+1)\)-st point in the range (using a SubcurveTraits_2::Subcurve_2's). This functionality is deprecated. Instead use the Construct_curve_2 functors.

Member Function Documentation

◆ begin()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
const_iterator CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::begin ( ) const
Deprecated:
Obtain an iterator pointing at the source point of the polycurve.

◆ end()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
const_iterator CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::end ( ) const
Deprecated:
Obtain an iterator pointing after the end of the polycurve.

◆ operator[]()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
SubcurveTraits_2::X_monotone_curve_2 CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::operator[] ( size_t  k) const

Obtain the \( k\)th subcurve of the polycurve.

Precondition
\(k\) is not greater than or equal to \(n-1\), where \(n\) is the number of subcurves.

◆ points()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
unsigned_int CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::points ( ) const
Deprecated:
Obtain the number of subcurve end-points that comprise the polycurve.

Note that for a bounded polycurve, if there are \( n\) points in the polycurve, it is comprised of \( (n - 1)\) subcurves. Currently, only bounded polycurves are supported.

◆ push_back() [1/2]

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
void CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::push_back ( const Subcurve_2 subcurve)

Append a subcurve to the polycurve at the back.

Warning: This function does not preform the precondition test that the Push_back_2 functor does. Thus, it is recommended to use the latter.

Parameters
subcurveThe new subcurve to be appended to the polycurve.
Precondition
If the polycurve is not empty, the source of subcurve must coincide with the target point of the last subcurve in the polycurve.

◆ push_back() [2/2]

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
void CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::push_back ( const Point_2 p)
Deprecated:
Add a new point to the polycurvs, which becomes the new target point of pi.
Precondition
SubcurveTraits_2 is a model of ArrangementConstructXMonotoneCurveTraits_2.

◆ push_front()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
void CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::push_front ( const Subcurve_2 subcurve)

Append a subcurve to the polycurve at the front.

Warning: This is a risky function! Don't use it! Prefer the corresponding functor which is provided in the traits class.

Parameters
subcurveThe new subcurve to be appended to the polycurve.
Precondition
If the polycurve is not empty, the target of subcurve must coincide with the source point of the first subcurve in the polycurve.

◆ rbegin()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
const_iterator CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::rbegin ( ) const
Deprecated:
Obtain an iterator pointing at the target point of the polycurve.

◆ rend()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
const_iterator CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::rend ( ) const
Deprecated:
Obtain an iterator pointing before the beginning of the polycurve.

◆ size()

template<typename SubcurveTraits_2>
template<typename SubcurveType_2 , typename PointType_2 >
size_type CGAL::Arr_polycurve_traits_2< SubcurveTraits_2 >::Curve_2< SubcurveType_2, PointType_2 >::size ( ) const
Deprecated:
Obtain the number of subcurves composing the polycurve (equivalent to pi.points() - 1).

Was replaced by number_of_subcurves()