CGAL 5.6.2 - 2D Arrangements
CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2 Class Reference

#include <CGAL/Arr_conic_traits_2.h>

Definition

The Curve_2 class nested within the conic-arc traits can represent arbitrary conic arcs and support their construction in various ways.

The copy and default constructor as well as the assignment operator are provided for conic arcs. In addition, an operator<< for the curves is defined for standard output streams.

Creation

 Curve_2 ()
 constructs an empty (invalid) arc.
 

Access Functions

bool is_valid () const
 indicates whether a is a valid conic arc. More...
 
bool is_x_monotone () const
 determines whether the arc is \(x\)-monotone, namely each vertical line intersects it at most once. More...
 
bool is_y_monotone () const
 determines whether the arc is \(y\)-monotone, namely each horizontal line intersects it at most once. More...
 
bool is_full_conic () const
 indicates whether the arc represents a full conic curve (en ellipse or a circle).
 

The six following methods return the coefficients of the supported conic, after their conversion to integer number (represented by the Integer type of the NtTraits class):

const NtTraits::Integer & r () const
 returns the coefficient of \(x^2\).
 
const NtTraits::Integer & s () const
 returns the coefficient of \(t^2\).
 
const NtTraits::Integer & t () const
 returns the coefficient of \(x y\).
 
const NtTraits::Integer & u () const
 returns the coefficient of \(x\).
 
const NtTraits::Integer & v () const
 returns the coefficient of \(y\).
 
const NtTraits::Integer & w () const
 returns the free coefficient.
 
const Point_2source () const
 returns the source point of the arc. More...
 
const Point_2target () const
 returns the target point of the arc. More...
 
Orientation orientation () const
 returns the orientation of the arc.
 

Operations

void set_source (const Point_2 &ps)
 sets a new source point for the conic arc. More...
 
void set_target (const Point_2 &pt)
 sets a new target point for the conic arc. More...
 

Member Function Documentation

◆ is_valid()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
bool CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::is_valid ( ) const

indicates whether a is a valid conic arc.

As the precondition to some of the constructor listed above are quite complicated, their violation does not cause the program to abort. Instead, the constructed arc is invalid (a defaultly constructed arc is also invalid). It is however recommended to check that a constructed arc is valid before inserting it to an arrangement.

◆ is_x_monotone()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
bool CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::is_x_monotone ( ) const

determines whether the arc is \(x\)-monotone, namely each vertical line intersects it at most once.

A vertical line segment is also considered (weakly) \(x\)-monotone.

◆ is_y_monotone()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
bool CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::is_y_monotone ( ) const

determines whether the arc is \(y\)-monotone, namely each horizontal line intersects it at most once.

A horizontal line segment is also considered (weakly) \(x\)-monotone.

◆ set_source()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
void CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::set_source ( const Point_2 ps)

sets a new source point for the conic arc.

Precondition
ps lies on the supporting conic of a.

◆ set_target()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
void CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::set_target ( const Point_2 pt)

sets a new target point for the conic arc.

Precondition
pt lies on the supporting conic of a.

◆ source()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
const Point_2& CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::source ( ) const

returns the source point of the arc.

Precondition
a is not a full conic curve.

◆ target()

template<typename RatKernel , typename AlgKernel , typename NtTraits >
const Point_2& CGAL::Arr_conic_traits_2< RatKernel, AlgKernel, NtTraits >::Curve_2::target ( ) const

returns the target point of the arc.

Precondition
a is not a full conic curve.