CGAL 6.0 - 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
 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
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

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
oiAn output iterator for the output container.
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 container.
Precondition
Dereferencing oi must yield an object of type Arr_conic_traits_2::Approximate_point_2.