GeneralPolygonSetTraits_2

Definition

This concept defines the minimal set of geometric predicates needed to perform the Boolean-set operations. It refines the directional x-monotone arrangement-traits concept. In addition to the Point_2 and X_monotone_curve_2 types defined in the generalized concept, it defines a type that represents a general polygon and another one that represents general polygon with holes. It also requires operations that operate on these types.

Refines

ArrangementDirectionalXMonotoneTraits_2

Types

GeneralPolygonSetTraits_2::Polygon_2
represents a general polygon.

GeneralPolygonSetTraits_2::Polygon_with_holes_2
represents a general polygon with holes.


GeneralPolygonSetTraits_2::Curve_const_iterator
A const iterator of curves. Its value type is const X_monotone_curve_2.

Functor Types

GeneralPolygonSetTraits_2::Construct_polygon_2
a functor that constructs a general polygon from a range of x-monotone curves. It uses the operator
void operator() (InputIterator begin, Input iterator end, Polygon_2 & pgn),
parameterized by the InputIterator type.


GeneralPolygonSetTraits_2::Construct_curves_2
a functor that returns a pair that consists of the begin and past-the-end iterators of the x monotone curves of the boundary of a given general polygon. It uses the operator
std:pair<Curve_const_iterator, Curve_const_iterator> operator() (const Polygon_2 & pgn).


GeneralPolygonSetTraits_2::Is_valid_2
provides the operators :
bool operator() (Polygon_2 & pgn)
which returns true if the pgn is valid, and false otherwise;
and :
bool operator() (Polygon_with_holes_2 & pgn_with_holes)
which returns true if pgn_with_holes is valid, and false otherwise. A polygon of type Polygon_2 is valid, if it is strictly simple and oriented counterclockwise. A polygon of type Polygon_with_holes_2 is valid, if its outer boundary is simple and oriented counterclockwise, and each one of its holes is a strictly simple polygon that oriented clockwise, contained inside its outer boundary, and they are all together pairwise disjoint, except perhaps at the vertices.
This functionality is used to verify precondition of some of the operations.

Creation

GeneralPolygonSetTraits_2 traits;
default constructor.

GeneralPolygonSetTraits_2 traits ( other);
copy constructor

GeneralPolygonSetTraits_2
traits = other assignment operator.

Accessing Functor Objects

Construct_polygon_2
traits.construct_polygon_2_object ()
returns a functor that constructs a polygon.

Construct_curves_2 traits.construct_curves_2_object ()
returns a functor that obtains the curves of a polygon.

Is_valid_2 traits.is_valid_2_object ()
returns a functor that checks the validity of a polygon.

Has Models

CGAL::Gps_segment_traits_2<Kernel,Container,ArrSegmentTraits>
CGAL::Gps_circle_segment_traits_2<Kernel>
CGAL::Gps_traits_2<ArrTraits,GeneralPolygon>

See Also

ArrangementDirectionalXMonotoneTraits_2