begin of advanced section  advanced  begin of advanced section

PartitionIsValidTraits_2

Definition

Requirements of a traits class that is used by partition_is_valid_2, convex_partition_is_valid_2, and y_monotone_partition_is_valid_2 for testing if a given set of polygons are nonoverlapping and if their union is a polygon that is the same as a polygon represented by a given sequence of points. Note that the traits class for partition_is_valid_2 may have to satisfy additional requirements if each partition polygon is to be tested for having a particular property; see, for example, the descriptions of the function is_convex_2 and the concept YMonotonePartitionTraits_2 for the additional requirements for testing for convexity and y-monotonicity, respectively.

Types

PartitionIsValidTraits_2::Point_2
The point type on which the partitioning algorithm operates.


PartitionIsValidTraits_2::Polygon_2
The polygon type created by the partitioning function. This type should provide a nested type Vertex_const_iterator that is the type of the non-mutable iterator over the polygon vertices.


PartitionIsValidTraits_2::Is_valid
A model of the concept PolygonIsValid


PartitionIsValidTraits_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.


PartitionIsValidTraits_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.


PartitionIsValidTraits_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.

Creation

Only a copy constructor is required.

PartitionIsValidTraits_2 traits ( & tr);

Operations

The following functions that create instances of the above predicate object types must exist.

Orientation_2 traits.is_valid_object ()

Less_xy_2 traits.less_xy_2_object ()

Left_turn_2 traits.left_turn_2_object ()

Orientation_2 traits.orientation_2_object ()

Has Models

CGAL::Partition_is_valid_traits_2<Traits, PolygonIsValid>

See Also

CGAL::approx_convex_partition_2
CGAL::greene_approx_convex_partition_2
CGAL::optimal_convex_partition_2
CGAL::y_monotone_partition_2

end of advanced section  advanced  end of advanced section