CGAL 6.0.2 - 2D Arrangements

Loading...
Searching...
No Matches
List of all members | Public Member Functions
CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Approximate_2 Class Reference

`#include <CGAL/Arr_conic_traits_2.h>`

## Definition

template<typename RatKernel, typename AlgKernel, typename NtTraits>
class CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Approximate_2

A functor that approximates a point and an \(x\)-monotone curve.

## Public Member Functions
Approximate_number_type | operator() (const Point_2 &p, int i) const
| Obtain an approximation of a point coordinate.
Approximate_point_2 | operator() (const Point_2 &p) const
| Obtain an approximation of a point.
template<typename OutputIterator >
OutputIterator | operator() (OutputIterator oi, double error, const X_monotone_curve_2 &xcv, bool l2r=true) const
| approximates a given \(x\)-monotone curve.

## Member Function Documentation

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

template<typename RatKernel , typename AlgKernel , typename NtTraits >

Approximate_point_2 CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Approximate_2::operator() | ( | const Point_2 & | p | ) | const

Obtain an approximation of a point.

Parameters

  p | The exact point.

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

template<typename RatKernel , typename AlgKernel , typename NtTraits >

Approximate_number_type CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Approximate_2::operator() | ( | const Point_2 & | p,
|  | int | i
| ) |  | const

Obtain an approximation of a point coordinate.

Parameters

  p | The exact point.
  i | The coordinate index (either 0 or 1).

Precondition
  `i` is either 0 or 1.

Returns
  An approximation of p's \(x\)-coordinate (if `i` == 0), or an approximation of p's \(y\)-coordinate (if `i` == 1).

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

template<typename RatKernel , typename AlgKernel , typename NtTraits >
template<typename OutputIterator >

OutputIterator CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Approximate_2::operator() | ( | OutputIterator | oi,
|  | double | error,
|  | const X_monotone_curve_2 & | xcv,
|  | bool | l2r = `true`
| ) |  | const

approximates a given \(x\)-monotone curve.

It computes a sequence of approximate points that represent an approximate polyline, and inserts them into an output container given through an output iterator. The first and last points in the sequence are always approximations of the endpoints of the given arc.

Parameters

  oi | An output iterator for the output container.
  error | The error bound of the polyline approximation. This is the Hausdorff distance between the arc and the polyline that approximates the arc.
  xcv | The exact \(x\)-monotone arc.
  l2r | A Boolean flag that indicates whether the arc direction is left to right.

Returns
  The past-the-end iterator of the output container.

Precondition
  Dereferencing `oi` must yield an object of type `Arr_conic_traits_2::Approximate_point_2`.