Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Polygon default Traits class (Polygon_traits_2)

The polygon class Polygon_2 and the polygon algorithms are parameterized with a traits class Traits. The default polygon traits class Polygon_traits_2<R> is parameterized with a representation class R.

#include <CGAL/Polygon_traits_2.h>

Types

typedef R::FT FT;
typedef Point_2<_R>
Point_2;
typedef Segment_2<_R>
Segment_2;
typedef Vector_2<_R>
Vector_2;
typedef p_Less_xy<Point_2>
Less_xy;
typedef p_Less_yx<Point_2>
Less_yx;

Creation

Polygon_traits_2<R> traits;

Operations

bool
traits.lexicographically_xy_smaller ( Point_2 p,
Point_2 q)
Returns lexicographically_xy_smaller(p,q).

bool
traits.lexicographically_yx_smaller_or_equal ( Point_2 p,
Point_2 q)
Returns lexicographically_yx_smaller_or_equal(p,q).

FT traits.cross_product_2 ( Vector_2 p, Vector_2 q)
Returns p.x() * q.y() - q.x() * p.y().

FT
traits.determinant_2 ( Point_2 p,
Point_2 q,
Point_2 r)
Returns cross_product_2(p-q, p-r).

int traits.sign ( FT x)
Returns sign(x).

bool traits.is_negative ( FT x)
Returns is_negative(x).

bool
traits.do_intersect ( Point_2 p1,
Point_2 q1,
Point_2 p2,
Point_2 q2)
Returns do_intersect(Segment_2(p1,q1), Segment_2(p2,q2).

Orientation traits.orientation ( Point_2 p, Point_2 q, Point_2 r)
Returns orientation(p, q, r).

Comparison_result traits.compare_x ( Point_2 p, Point_2 q)
Returns compare_x(p, q).

Comparison_result traits.compare_y ( Point_2 p, Point_2 q)
Returns compare_y(p, q).

bool
traits.have_equal_direction ( Vector_2 v1,
Vector_2 v2)
Returns the value of the comparison Direction_2<R>(v1) == Direction_2<R>(v2).


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.