CGAL 5.5.3 - 2D Regularized Boolean Set-Operations
CGAL::Polygon_set_2< Kernel, Container, Dcel > Class Template Reference

#include <CGAL/Polygon_set_2.h>

Inherits from

CGAL::General_polygon_set_2< Gps_segment_traits_2< Kernel, Container > >.

Definition

The class Polygon_set_2 represents sets of linear polygons with holes.

The first two template parameters (Kernel and Container) are used to instantiate the type Polygon_2<Kernel,Container>. This type is used to represent the outer boundary of every set member and the boundaries of all holes of every set member.

The third template parameter Dcel must 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.

See also
General_polygon_set_2
Gps_segment_traits_2
Examples:
Boolean_set_operations_2/draw_polygon_set.cpp, and Boolean_set_operations_2/sequence.cpp.

Additional Inherited Members

- Public Types inherited from CGAL::General_polygon_set_2< Gps_segment_traits_2< Kernel, Container > >
typedef unspecified_type Traits_2
 the traits class in use.
 
typedef unspecified_type Polygon_2
 the general polygon type. More...
 
typedef unspecified_type Polygon_with_holes_2
 the general polygon with holes type. More...
 
typedef unspecified_type Size
 number of polygons with holes size type.
 
typedef unspecified_type Arrangement_2
 the arrangement type used internally.
 
- Public Member Functions inherited from CGAL::General_polygon_set_2< Gps_segment_traits_2< Kernel, Container > >
 General_polygon_set_2 ()
 default constructor; constructs an empty set of polygons gps represented by an empty arrangement.
 
 General_polygon_set_2 (const Self &other)
 copy constructor.
 
 General_polygon_set_2 (const Gps_segment_traits_2< Kernel, Container > &traits)
 constructs an empty set of polygons that uses the given traits object for performing the geometric operations.
 
 General_polygon_set_2 (const Polygon_2 &pgn)
 constructs a set of polygons that consists of the single polygon pgn.
 
 General_polygon_set_2 (const Polygon_with_holes_2 &pgn_with_holes)
 constructs a set of polygons that consists of the single polygon with holes pgn_with_holes.
 
 General_polygon_set_2 (const Polygon_2 &pgn, const Gps_segment_traits_2< Kernel, Container > &traits)
 constructs a set of polygons that uses the given traits object and consists of the single polygon pgn.
 
 General_polygon_set_2 (const Polygon_with_holes_2 &pgn_with_holes, const Gps_segment_traits_2< Kernel, Container > &traits)
 constructs a set of polygons that uses the given traits object and consists of the single polygon with holes pgn_with_holes.
 
OutputIterator polygons_with_holes (OutputIterator out)
 obtains the polygons with holes represented by gps.
 
Size number_of_polygons_with_holes () const
 returns the total number of general polygons represented by gps.
 
bool is_empty () const
 returns true if gps represents an empty set.
 
bool is_plane () const
 returns true if gps represents the entire plane.
 
Gps_segment_traits_2< Kernel, Container > & traits () const
 obtains an instance of the traits. More...
 
const Arrangement_2arrangement () const
 obtains the arrangement data structure that internally represents the general-polygon set.
 
void clear ()
 clears gps.
 
void insert (Polygon_2 &pgn)
 inserts pgn into gps. More...
 
void insert (Polygon_with_holes_2 &pgn_with_holes)
 inserts pgn_with_holes into gps. More...
 
void insert (InputIterator begin, InputIterator end)
 inserts the range of polygons (or polygons with holes) into gps. More...
 
void insert (InputIterator1 pgn_begin, InputIterator1 pgn_end, InputIterator2 pgn_with_holes_begin, InputIterator2 pgn_with_holes_end)
 inserts the two ranges of polygons and polygons with holes into gps. More...
 
void complement ()
 computes the complement of gps.
 
void complement (const Polygon_set_2 &other)
 computes the complement of other. More...
 
void intersection (const General_polygon_set_2 &other)
 computes the intersection of gps and other.
 
void intersection (const Polygon_2 &pgn)
 computes the intersection of gps and pgn.
 
void intersection (const Polygon_with_holes_2 &pgn)
 computes the intersection of gps and pgn.
 
void intersection (InputIterator begin, InputIterator end)
 computes the intersection of a collection of point sets. More...
 
void intersection (InputIterator1 pgn_begin, InputIterator1 pgn_end, InputIterator2 pgn_with_holes_begin, InputIterator2 pgn_with_holes_end)
 computes the intersection of a collection of point sets. More...
 
void join (const General_polygon_set_2 &other)
 computes the union of gps and other.
 
void join (const Polygon_2 &pgn)
 computes the union of gps and pgn.
 
void join (const Polygon_with_holes_2 &pgn)
 computes the union of gps and pgn.
 
void 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. More...
 
void join (InputIterator1 pgn_begin, InputIterator1 pgn_end, InputIterator2 pgn_with_holes_begin, InputIterator2 pgn_with_holes_end)
 computes the union of the polygons and polygons with holes in the given two ranges and the point set represented by gps.
 
void difference (const General_polygon_set_2 &other)
 computes the difference between gps and other.
 
void difference (const Polygon_2 &pgn)
 computes the difference between gps and pgn.
 
void difference (const Polygon_with_holes_2 &pgn)
 computes the difference between gps and pgn.
 
void symmetric_difference (const General_polygon_set_2 &other)
 computes the symmetric difference between gps and other.
 
void symmetric_difference (const Polygon_2 &pgn)
 computes the symmetric difference between gps and pgn.
 
void symmetric_difference (const Polygon_with_holes_2 &pgn)
 computes the symmetric difference between gps and pgn.
 
void symmetric_difference (InputIterator begin, InputIterator end)
 computes the symmetric difference (xor) of a collection of point sets. More...
 
void symmetric_difference (InputIterator1 pgn_begin, InputIterator1 pgn_end, InputIterator2 pgn_with_holes_begin, InputIterator2 pgn_with_holes_end)
 computes the symmetric difference (xor) of a collection of point sets. More...
 
void intersection (const General_polygon_set_2 &gps1, const General_polygon_set_2 &gps2)
 computes the intersection of gps1 and gps2.
 
void join (const General_polygon_set_2 &gps1, const General_polygon_set_2 &gps2)
 computes the union of gps1 and gps2.
 
void difference (const General_polygon_set_2 &gps1, const General_polygon_set_2 &gps2)
 computes the difference between gps1 and gps2.
 
void symmetric_difference (const General_polygon_set_2 &gps1, const General_polygon_set_2 &gps2)
 computes the symmetric difference between gps1 and gps2.
 
bool do_intersect (const General_polygon_set_2 &other)
 returns true if gps and other intersect in their interior, and false otherwise.
 
bool do_intersect (const Polygon_2 &pgn)
 returns true if gps and pgn intersect in their interior, and false otherwise.
 
bool do_intersect (const Polygon_with_holes_2 &pgn)
 returns true if gps and pgn intersect in their interior, and false otherwise.
 
void do_intersect (InputIterator begin, InputIterator end)
 returns true if the interior of the point sets in a collection intersect, and false otherwise. More...
 
void do_intersect (InputIterator1 pgn_begin, InputIterator1 pgn_end, InputIterator2 pgn_with_holes_begin, InputIterator2 pgn_with_holes_end)
 returns true if the interior of the point sets in a collection intersect, and false otherwise. More...
 
bool locate (const 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. More...
 
Oriented_side oriented_side (const 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 oriented_side (const 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 oriented_side (const 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 oriented_side (const 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 is_valid () const
 returns true if gps represents a valid point set.