\( \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.3 - 2D Arrangements
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
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 Point_2 &p)
 constructs an degenerate curve equivalent to the point p.
 
 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_point () const
 returns whether c is a point (a degenerate curve).
 
Point_2 point () const
 returns a point object equivalent to c. More...
 
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

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.
template<typename Kernel >
Point_2 CGAL::Arr_linear_traits_2< Kernel >::Curve_2::point ( ) const

returns a point object equivalent to c.

Precondition
c is a point.
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.
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.
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.
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).
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.