\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.12.1 - 2D Arrangements
CGAL::Arr_linear_traits_2< Kernel >::Curve_2 Class Reference

#include <CGAL/Arr_linear_traits_2.h>

Definition

The Curve_2 (and the X_monotone_curve_2) class nested within the linear-traits can represent all types of linear objects.

The class supports the copy and default constructor and the assignment operator. In addition, the operator<< and operator>> for linear objects are defined for standard output and input streams.

Types

typedef Kernel::Point_2 Point_2
 
typedef Kernel::Segment_2 Segment_2
 
typedef Kernel::Ray_2 Ray_2
 
typedef Kernel::Line_2 Line_2
 

Creation

 Curve_2 (const Segment_2 &seg)
 constructs an line segment.
 
 Curve_2 (const Ray_2 &ray)
 constructs a ray.
 
 Curve_2 (const Line_2 &ln)
 constructs a line.
 

Access Functions

bool is_segment () const
 returns whether c is a segment (has two bounded endpoints).
 
Segment_2 segment () const
 returns a segment object equivalent to c. More...
 
bool is_ray () const
 returns whether c is a ray (has a bounded source point and its other end is unbounded).
 
Ray_2 ray () const
 returns a ray object equivalent to c. More...
 
bool is_line () const
 returns whether c is a line (has only unbounded ends).
 
Line_2 line () const
 returns a line object equivalent to c. More...
 
Line_2 supporting_line () const
 returns the supporting line of c. More...
 
Point_2 source () const
 returns c's source point. More...
 
Point_2 target () const
 returns c's target point. More...
 

Member Function Documentation

◆ line()

template<typename Kernel >
Line_2 CGAL::Arr_linear_traits_2< Kernel >::Curve_2::line ( ) const

returns a line object equivalent to c.

Precondition
c is a line.

◆ ray()

template<typename Kernel >
Ray_2 CGAL::Arr_linear_traits_2< Kernel >::Curve_2::ray ( ) const

returns a ray object equivalent to c.

Precondition
c is a ray.

◆ segment()

template<typename Kernel >
Segment_2 CGAL::Arr_linear_traits_2< Kernel >::Curve_2::segment ( ) const

returns a segment object equivalent to c.

Precondition
c is a segment.

◆ source()

template<typename Kernel >
Point_2 CGAL::Arr_linear_traits_2< Kernel >::Curve_2::source ( ) const

returns c's source point.

Precondition
c is a point, a segment or a ray.

◆ supporting_line()

template<typename Kernel >
Line_2 CGAL::Arr_linear_traits_2< Kernel >::Curve_2::supporting_line ( ) const

returns the supporting line of c.

Precondition
c is not a point (a degenerate curve).

◆ target()

template<typename Kernel >
Point_2 CGAL::Arr_linear_traits_2< Kernel >::Curve_2::target ( ) const

returns c's target point.

Precondition
c is a point or a segment.