The Traits template-parameter should be instantiated with a model of the concept GeneralPolygonSetTraits_2. The traits class defines the types of points, x-monotone curves, general polygons, and general polygons with holes, that is Traits::Point_2, Traits::X_monotone_curve_2, Traits::Polygon_2, and Traits::Polygon_with_holes_2 , respectively. Traits::Point_2 must be the type of the endpoints of Traits::X_monotone_curve_2 , and Traits::X_monotone_curve_2 must be the type of the curves that comprise the boundaries of the general polygons. The traits class supports geometric operations on the types above. We sometimes use the term polygon instead of general polygon for simplicity hereafter.
The template parameter Dcel should be instantiated with a model of the concept GeneralPolygonSetDcel. It is instantiated by default with the type Gps_default_dcel<Traits>. You can override this default, with a different Dcel class, typically an extension of the Gps_default_dcel class template. Overriding the default is necessary only if you intend to obtain the underlying internal arrangement and process it further.
The input and output of the Boolean set-operations methods consist of one or more general polygons, some of which may have holes. In particular, these methods operate on pairs of objects of type General_polygon_set_2<Traits,Dcel>, or directly on objects of type Traits::Polygon_2 or Traits::Polygon_with_holes_2 . An object of type Traits::Polygon_2 is a valid operand, only if it is simple and its boundary is oriented counterclockwise. An object of type Traits::Polygon_with_holes_2 is valid, only if its outer boundary bounds a relatively simple general polygon oriented counterclockwise, and each one of its holes is a simple polygon oriented clockwise. The holes are pairwise disjoint, except perhaps at the vertices, and are contained in the polygon bounded by the outer boundary. The outer boundary and the holes are also pairwise disjoint, except perhaps at the vertices.
General_polygon_set_2<Traits,Dcel>::Traits_2 | |
the traits class in use.
| |
General_polygon_set_2<Traits,Dcel>::Polygon_2 | |
the general polygon type. Must model the GpsTraitsGeneralPolygon_2 Concept.
| |
General_polygon_set_2<Traits,Dcel>::Polygon_with_holes_2 | |
the general polygon with holes type. Must model the GpsTraitsGeneralPolygonWithHoles_2 Concept.
| |
General_polygon_set_2<Traits,Dcel>::Size | |
number of polygons with holes size type.
| |
General_polygon_set_2<Traits,Dcel>::Arrangement_2 | |
the arrangement type used internally.
|
General_polygon_set_2<Traits,Dcel> gps; | |
constructs an empty set of polygons represented by an empty arrangement.
| |
General_polygon_set_2<Traits,Dcel> gps ( Self other); | |
copy constructor.
| |
General_polygon_set_2<Traits,Dcel> gps ( Traits & traits); | |
constructs an empty set of polygons that uses the given
traits instance for performing the geometric operations.
| |
General_polygon_set_2<Traits,Dcel> gps ( Polygon_2 pgn); | |
constructs a set of polygons that consists of the single polygon pgn.
| |
General_polygon_set_2<Traits,Dcel> gps ( Polygon_with_holes_2 pgn_with_holes); | |
constructs a set of polygons that consists of the single polygon with
holes pgn_with_holes.
|
template <class OutputIterator> | ||
OutputIterator | gps.polygons_with_holes ( OutputIterator out) | |
obtains the polygons with holes represented by gps. | ||
Size | gps.number_of_polygons_with_holes () const | |
returns the total number of general polygons represented by gps. | ||
bool | gps.is_empty () const | returns true if gps represents an empty set. |
bool | gps.is_plane () const | returns true if gps represents the entire plane. |
Traits & | gps.traits () const | obtains an instance of the traits. If the traits was passed as a parameter to the constructor of gps, it is returned. Otherwise, a newly created instance is returned. |
Arrangement_2 | gps.arrangement () const | obtains the arrangement data structure that internally represents the general-polygon set. |
void | gps.clear () | clears gps. | ||
void | gps.insert ( Polygon_2 & pgn) |
inserts pgn into gps.
| ||
void | gps.insert ( Polygon_with_holes_2 & pgn_with_holes) | |||
inserts pgn_with_holes into gps.
| ||||
template <class InputIterator> | ||||
void | gps.insert ( InputIterator begin, InputIterator end) | |||
inserts the range of polygons (or polygons with holes) into gps. (The
value type of the input iterator is used to distinguish between the two.)
| ||||
template <class InputIterator1, class InputIterator2> | ||||
void |
| |||
inserts the two ranges of polygons and polygons with holes into gps.
| ||||
void | gps.complement () | computes the complement of gps. | ||
void | gps.complement ( Polygon_set_2 other) | |||
computes the complement of other. gps is overridden by the result. |
void | gps.intersection ( General_polygon_set_2 other) | |||
computes the intersection of gps and other. | ||||
void | gps.intersection ( Polygon_2 pgn) | |||
computes the intersection of gps and pgn. | ||||
void | gps.intersection ( Polygon_with_holes_2 pgn) | |||
computes the intersection of gps and pgn. | ||||
template <class InputIterator> | ||||
void | gps.intersection ( InputIterator begin, InputIterator end) | |||
computes the intersection of a collection of point sets. The collection consists of the polygons (or polygons with holes) in the given range and the point set represented by gps. (The value type of the input iterator is used to distinguish between the two options.) | ||||
template <class InputIterator1, class InputIterator2> | ||||
void |
| |||
computes the intersection of a collection of point sets. The collection consists of the polygons and polygons with holes in the given two ranges and the point set represented by gps. | ||||
void | gps.join ( General_polygon_set_2 other) | |||
computes the union of gps and other. | ||||
void | gps.join ( Polygon_2 pgn) | computes the union of gps and pgn. | ||
void | gps.join ( Polygon_with_holes_2 pgn) | |||
computes the union of gps and pgn. | ||||
template <class InputIterator> | ||||
void | gps.join ( InputIterator begin, InputIterator end) | |||
computes the union of the polygons (or polygons with holes) in the given range and the point set represented by gps. (The value type of the input iterator is used to distinguish between the two options.) | ||||
template <class InputIterator1, class InputIterator2> | ||||
void |
| |||
computes the union of the polygons and polygons with holes in the given two ranges and the point set represented by gps. | ||||
void | gps.difference ( General_polygon_set_2 other) | |||
computes the difference between gps and other. | ||||
void | gps.difference ( Polygon_2 pgn) | computes the difference between gps and pgn. | ||
void | gps.difference ( Polygon_with_holes_2 pgn) | |||
computes the difference between gps and pgn. | ||||
void | gps.symmetric_difference ( General_polygon_set_2 other) | |||
computes the symmetric difference between gps and other. | ||||
void | gps.symmetric_difference ( Polygon_2 pgn) | |||
computes the symmetric difference between gps and pgn. | ||||
void | gps.symmetric_difference ( Polygon_with_holes_2 pgn) | |||
computes the symmetric difference between gps and pgn. | ||||
template <class InputIterator> | ||||
void | gps.symmetric_difference ( InputIterator begin, InputIterator end) | |||
computes the symmetric difference (xor) of a collection of point sets. The collection consists of the polygons (or polygons with holes) in the given range and the point set represented by gps. (The value type of the input iterator is used to distinguish between the two options.) | ||||
template <class InputIterator1, class InputIterator2> | ||||
void |
| |||
computes the symmetric difference (xor) of a collection of point sets. The collection consists of the polygons and polygons with holes in the given two ranges and the point set represented by gps. |
void | gps.intersection ( General_polygon_set_2 gps1, General_polygon_set_2 gps2) | |
computes the intersection of gps1 and gps2. | ||
void | gps.join ( General_polygon_set_2 gps1, General_polygon_set_2 gps2) | |
computes the union of gps1 and gps2. | ||
void | gps.difference ( General_polygon_set_2 gps1, General_polygon_set_2 gps2) | |
computes the difference between gps1 and gps2. | ||
void | gps.symmetric_difference ( General_polygon_set_2 gps1, General_polygon_set_2 gps2) | |
computes the symmetric difference between gps1 and gps2. |
bool | gps.do_intersect ( General_polygon_set_2 other) | |||
returns true if gps and other intersect in their interior, and false otherwise. | ||||
bool | gps.do_intersect ( Polygon_2 pgn) | |||
returns true if gps and pgn intersect in their interior, and false otherwise. | ||||
bool | gps.do_intersect ( Polygon_with_holes_2 pgn) | |||
returns true if gps and pgn intersect in their interior, and false otherwise. | ||||
template <class InputIterator> | ||||
void | gps.do_intersect ( InputIterator begin, InputIterator end) | |||
returns true if the interior of the point sets in a collection intersect, and false otherwise. The collection consists of the polygons (or polygons with holes) in the given range and the point set represented by gps. (The value type of the input iterator is used to distinguish between the two options.) | ||||
template <class InputIterator1, class InputIterator2> | ||||
void |
| |||
returns true if the interior of the point sets in a collection intersect, and false otherwise. The collection consists of the polygons and polygons with holes in the given two ranges and the point set represented by gps. | ||||
bool | gps.locate ( Point_2 p, Polygon_with_holes_2 & pgn) | |||
obtains a polygon with holes that contains the query point p, if exists, through pgn, and returns true. Otherwise, returns false. | ||||
Oriented_side | gps.oriented_side ( Point_2 q) | returns either the constant ON_ORIENTED_BOUNDARY, ON_POSITIVE_SIDE, or ON_NEGATIVE_SIDE, iff p lies on the boundary, properly on the positive side, or properly on the negative side of gps respectively. | ||
Oriented_side | gps.oriented_side ( General_polygon_set_2 other) | |||
returns either the constant ON_NEGATIVE_SIDE, ON_ORIENTED_BOUNDARY, or ON_POSITIVE_SIDE, iff other and gps are completely disjoint, in contact, or intersect in their interior, respectively. | ||||
Oriented_side | gps.oriented_side ( Polygon_2 pgn) | |||
returns either the constant ON_NEGATIVE_SIDE, ON_ORIENTED_BOUNDARY, or ON_POSITIVE_SIDE, iff pgn and gps are completely disjoint, in contact, or intersect in their interior, respectively. | ||||
Oriented_side | gps.oriented_side ( Polygon_with_holes_2 pgn) | |||
returns either the constant ON_NEGATIVE_SIDE, ON_ORIENTED_BOUNDARY, or ON_POSITIVE_SIDE, iff pgn and gps are completely disjoint, in contact, or intersect in their interior, respectively. |
bool | gps.is_valid () const | returns true if gps represents a valid point set. |