CGAL 5.6 - 2D Arrangements
Loading...
Searching...
No Matches
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
 Obtain a polyline that approximates an \(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
pThe 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
pThe exact point.
iThe 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

Obtain a polyline that approximates an \(x\)-monotone curve.

The polyline is defined by a range of approximate points beginning at oi. The type OutputIterator must dereference the type Approximate_point_2. The first and last points in the range are always the endpoints of the given arc xcv. The operator returns a past-the-end iterator of the destination range.

Parameters
oiAn output iterator for the resulting polyline.
errorThe error bound of the polyline approximation. This is the Hausdorff distance between the arc and the polyline that approximates the arc.
xcvThe exact \(x\)-monotone arc.
l2rA Boolean flag that indicates whether the arc direction is left to right.
Returns
The past-the-end iterator of the output iterator.