CGAL 6.1 - 2D Arrangements

Loading...
Searching...
No Matches
List of all members
CGAL::Arr_polyline_traits_2< SegmentTraits_2 >::Construct_curve_2 Class Reference

`#include <CGAL/Arr_polyline_traits_2.h>`

## Definition

template<typename SegmentTraits_2>
class CGAL::Arr_polyline_traits_2< SegmentTraits_2 >::Construct_curve_2

Construction functor of a general (not necessarily \(x\)-monotone) polyline.

This functor constructs general polylines. Its `operator()` is overloaded to support various input types.

Note that the composing segments, depending on the `SegmentTraits_2`, might not be \(x\)-monotone.

## Operations
Curve_2 | operator() (const Point_2 &p, const Point_2 &q) const
| obtains a polyline connecting the two given endpoints.
Curve_2 | operator() (const Segment_2 &seg) const
| obtains a polyline that comprises of one given segment.
template<typename ForwardIterator >
Curve_2 | operator() (ForwardIterator begin, ForwardIterator end) const
| constructs a well-oriented polyline from a range of either `SegmentTraits_2::Point_2` or `SegmentTraits_2::Segment_2`.

## Member Function Documentation

## ◆ operator()() [1/3]

template<typename SegmentTraits_2 >

Curve_2 CGAL::Arr_polyline_traits_2< SegmentTraits_2 >::Construct_curve_2::operator() | ( | const Point_2 & | p,
|  | const Point_2 & | q
| ) |  | const

obtains a polyline connecting the two given endpoints.

Parameters

  p | The first point.
  q | The second point.

Returns
  A segment connecting `p` and `q`.

Precondition
  `p` and `q` are distinct.

## ◆ operator()() [2/3]

template<typename SegmentTraits_2 >

Curve_2 CGAL::Arr_polyline_traits_2< SegmentTraits_2 >::Construct_curve_2::operator() | ( | const Segment_2 & | seg | ) | const

obtains a polyline that comprises of one given segment.

Parameters

  seg | input segment

Returns
  A polyline with one segment, namely `seg`.

Precondition
  `seg` is not degenerated (not tested)

## ◆ operator()() [3/3]

template<typename SegmentTraits_2 >
template<typename ForwardIterator >

Curve_2 CGAL::Arr_polyline_traits_2< SegmentTraits_2 >::Construct_curve_2::operator() | ( | ForwardIterator | begin,
|  | ForwardIterator | end
| ) |  | const

constructs a well-oriented polyline from a range of either `SegmentTraits_2::Point_2` or `SegmentTraits_2::Segment_2`.

Parameters

  begin | iterator pointing to the first element in the range.
  end | iterator pointing to the past-the-end element in the range.

Returns
  A polyline using the corresponding construction implementation.

Precondition
  The given range form a continuous and well-oriented polyline (not tested).
  Contains no degenerated segments (not tested)