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

Polygon default Traits class (CGAL_Polygon_traits_2)

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

#include <CGAL/Polygon_traits_2.h>

Types

typedef R::FT FT;
typedef CGAL_Point_2<_R>
Point_2;
typedef CGAL_Segment_2<_R>
Segment_2;
typedef CGAL_Vector_2<_R>
Vector_2;
typedef CGAL_p_Less_xy<Point_2>
Less_xy;
typedef CGAL_p_Less_yx<Point_2>
Less_yx;

Creation

CGAL_Polygon_traits_2<R> traits;

Operations

bool
traits.lexicographically_xy_smaller ( Point_2 p,
Point_2 q)
Returns CGAL_lexicographically_xy_smaller(p,q).
bool
traits.lexicographically_yx_smaller_or_equal ( Point_2 p,
Point_2 q)
Returns CGAL_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 CGAL_sign(x).
bool traits.is_negative ( FT x)
Returns CGAL_is_negative(x).
bool
traits.do_intersect ( Point_2 p1,
Point_2 q1,
Point_2 p2,
Point_2 q2)
Returns CGAL_do_intersect(Segment_2(p1,q1), Segment_2(p2,q2) .
CGAL_Orientation traits.orientation ( Point_2 p, Point_2 q, Point_2 r)
Returns CGAL_orientation(p, q, r).
CGAL_Comparison_result
traits.compare_x ( Point_2 p, Point_2 q)
Returns CGAL_compare_x(p, q).
CGAL_Comparison_result
traits.compare_y ( Point_2 p, Point_2 q)
Returns CGAL_compare_y(p, q).
bool
traits.have_equal_direction ( Vector_2 v1,
Vector_2 v2)
Returns the value of the comparison CGAL_Direction_2<R>(v1) == CGAL_Direction_2<R>(v2) .


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January, 1999.