CGAL 4.9 - 2D Arrangements
|
#include <CGAL/Arr_polycurve_traits_2.h>
The Curve_2
type nested in the Arr_polycurve_traits_2
represents general continuous piecewise-linear segments (a polycurve can be self-intersecting) and support their construction from range of segments.
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 Segment_type_T
and Point_type_T
, which are GeometryTraits_2::Curve_2
and GeometryTraits_2::Point_2
types. Thus, in general, the segments 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 segments. In addition, an operator<<
for the segments is defined for standard output streams, and an operator>>
for the segments is defined for standard input streams.
Types | |
typedef std::vector< Segment_2 > | Segments_container |
The container of the segments that comprises the polycurve. | |
typedef Segments_container::size_type | Segments_size_type |
The size of the container that comprises the polycurve. | |
typedef unspecified_type | const_iterator |
typedef unspecified_type | const_reverse_iterator |
typedef unspecified_type | Segment_const_iterator |
A bidirectional constant iterator that allows traversing the segments that comprise the polycurve. | |
typedef unspecified_type | Segment_const_reverse_iterator |
A bidirectional constant iterator that allows traversing the segments that comprise the polycurve. | |
Creation | |
Curve_2 () | |
Default constructor that constructs an empty polycurve. | |
Curve_2 (const Segment_2 seg) | |
Construct a polycurve from one segment. | |
template<typename InputIterator > | |
Curve_2 (Iterator first, Iterator last) | |
Construct a polycurve defined by the given range of segments [first, last) (the value-type of InputIterator must be GeometryTraits_2::Curve_2 . More... | |
Access Functions | |
unsigned_int | points () const |
const_iterator | begin () const |
Segment_const_iterator | begin_segments () const |
Obtain an iterator pointing at the first segment of the polycurve. | |
const_iterator | end () const |
Segment_const_iterator | end_segments () const |
Get an iterator pointing at the past-the-end segment of the polycurve. | |
const_iterator | rbegin () const |
Segment_const_reverse_iterator | rbegin_segments () const |
Obtain an iterator pointing at the last segment of the polycurve. | |
const_iterator | rend () const |
Segment_const_reverse_iterator | rend_segments () const |
Obtain an iterator pointing at the past-the-end segment of the polycurve in reverse order. | |
Segments_size_type | size () const |
Segments_container_size | number_of_segments () const |
Obtain the number of segments that comprise the polycurve. | |
GeometryTraits_2::X_monotone_curve_2 | operator[] (size_t k) const |
Obtain the \( k\)th segment of the polycurve. More... | |
Bbox_2 | bbox () const |
Obtain the bounding box of the polycurve. | |
Operations | |
void | push_back (const Segment_2 &seg) |
Append a segment to the polycurve at the back. More... | |
void | push_front (const Segment_2 &seg) |
Append a segment to the polycurve at the front. More... | |
void | push_back (const Point_2 &p) |
void | clear () |
Reset the polycurve. | |
typedef unspecified_type CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::const_iterator |
typedef unspecified_type CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::const_reverse_iterator |
CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::Curve_2 | ( | Iterator | first, |
Iterator | last | ||
) |
Construct a polycurve defined by the given range of segments [first, last)
(the value-type of InputIterator
must be GeometryTraits_2::Curve_2
.
In general, the segments might not be \(x\)-monotone, furthermore, they might not form a continuous polycurve.
GeometryTraits_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 GeometryTraits_2::Segment_2
's). This functionality is deprecated. Instead use the Construct_curve_2
functors. const_iterator CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::begin | ( | ) | const |
const_iterator CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::end | ( | ) | const |
GeometryTraits_2::X_monotone_curve_2 CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::operator[] | ( | size_t | k) | const |
Obtain the \( k\)th segment of the polycurve.
unsigned_int CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::points | ( | ) | const |
Note that for a bounded polycurve, if there are \( n\) points in the polycurve, it is comprised of \( (n - 1)\) segments. Currently, only bounded polycurves are supported.
void CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::push_back | ( | const Segment_2 & | seg) |
Append a segment 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.
seg | The new segment to be appended to the polycurve. |
seg
must coincide with the target point of the last segment in the polycurve. void CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::push_back | ( | const Point_2 & | p) |
pi
.void CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::push_front | ( | const Segment_2 & | seg) |
Append a segment 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.
seg | The new segment to be appended to the polycurve. |
seg
must coincide with the source point of the first segment in the polycurve. const_iterator CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::rbegin | ( | ) | const |
const_iterator CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::rend | ( | ) | const |
Segments_size_type CGAL::Arr_polycurve_traits_2< GeometryTraits_2 >::Curve_2< Segment_type_T, Point_type_T >::size | ( | ) | const |
pi.points() - 1
).Was replaced by number_of_segments()