The polygon partitioning functions are each parameterized by a traits class that defines the primitives used in the algorithms. Many requirements are common to all traits classes. The concept PartitionTraits_2 defines this common set of requirements.
PartitionTraits_2::Less_xy_2 | |
Predicate object type that compares Point_2s lexicographically.
Must provide bool operator()(Point_2 p, Point_2 q) where true
is returned iff p <xy q.
We have p<xyq, iff px < qx or px = qx and py < qy,
where px and py denote the x and y coordinates of point p,
respectively.
| |
PartitionTraits_2::Less_yx_2 | |
Same as Less_xy_2 with the roles of x and y interchanged.
| |
PartitionTraits_2::Left_turn_2 | |
Predicate object type that provides
bool operator()(Point_2 p,Point_2 q,Point_2 r), which
returns true iff r lies to the left of the
oriented line through p and q.
| |
PartitionTraits_2::Orientation_2 | |
Predicate object type that provides
CGAL::Orientation operator()(Point_2 p, Point_2 q, Point_2 r) that
returns CGAL::LEFT_TURN, if r lies to the left of the oriented
line l defined by p and q, returns CGAL::RIGHT_TURN if r
lies to the right of l, and returns CGAL::COLLINEAR if r lies
on l.
| |
PartitionTraits_2::Compare_y_2 | |
Predicate object type that provides
CGAL::Comparision_result operator()(Point_2 p, Point_2 q) to compare
the y values of two points. The operator must return
CGAL::SMALLER if py < qy, CGAL::LARGER if py > qy and
CGAL::EQUAL if py = qy.
| |
PartitionTraits_2::Compare_x_2 | |
The same as Compare_y_2, except that x
coordinates are compared instead of y.
|
A copy constructor and default constructor are required.
PartitionTraits_2 traits; | |
PartitionTraits_2 traits ( & tr); |
The following functions that create instances of the above predicate object types must exist.
CGAL::approx_convex_partition_2
CGAL::greene_approx_convex_partition_2
CGAL::optimal_convex_partition_2
CGAL::y_monotone_partition_2