CGAL 5.0 - 2D Polygons
|
#include <CGAL/Polygon_with_holes_2.h>
CGAL::General_polygon_with_holes_2< CGAL::Polygon_2< Kernel, Containter > >.
The class Polygon_with_holes_2
models the concept GeneralPolygonWithHoles_2
.
It represents a linear polygon with holes. It is parameterized with two types (Kernel
and Container
) that are used to instantiate the type Polygon_2<Kernel,Container>
. The latter is used to represents the outer boundary and the boundary of the holes (if any exist).
Public Member Functions | |
Polygon_with_holes_2 () | |
Default constructor. More... | |
Polygon_with_holes_2 (const Base &base) | |
Constructor from the base class. More... | |
Polygon_with_holes_2 (const Polygon_2 &pgn_boundary) | |
Constructor from a polygon. More... | |
template<class HolesInputIterator > | |
Polygon_with_holes_2 (const Polygon_2 &pgn_boundary, HolesInputIterator h_begin, HolesInputIterator h_end) | |
Constructor from a polygon (outer boundary) and hole polygons. More... | |
Bbox_2 | bbox () const |
Obtain the bounding box of the polygon with holes. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class Kernel_ , class Container_ > | |
std::ostream & | operator<< (std::ostream &os, const Polygon_with_holes_2< Kernel_, Container_ > &p) |
This operator exports a polygon with holes to the output stream out . More... | |
template<class Kernel_ , class Container_ > | |
std::istream & | operator>> (std::istream &is, Polygon_with_holes_2< Kernel_, Container_ > &p) |
This operator imports a polygon with holes from the input stream in . More... | |
Related Functions inherited from CGAL::General_polygon_with_holes_2< CGAL::Polygon_2< Kernel, Containter > > | |
std::ostream & | operator<< (std::ostream &os, const General_polygon_with_holes_2< CGAL::Polygon_2< Kernel, Containter > > &p) |
This operator exports a General_polygon_with_holes_2 to the output stream out . More... | |
std::istream & | operator>> (std::istream &is, General_polygon_with_holes_2< CGAL::Polygon_2< Kernel, Containter > > &p) |
This operator imports a General_polygon_with_holes_2 from the input stream in . More... | |
Additional Inherited Members | |
Public Types inherited from CGAL::General_polygon_with_holes_2< CGAL::Polygon_2< Kernel, Containter > > | |
typedef CGAL::Polygon_2< Kernel, Containter > | General_polygon_2 |
polygon without hole type | |
CGAL::Polygon_with_holes_2< Kernel, Containter >::Polygon_with_holes_2 | ( | ) |
Default constructor.
CGAL::Polygon_with_holes_2< Kernel, Containter >::Polygon_with_holes_2 | ( | const Base & | base | ) |
Constructor from the base class.
|
explicit |
Constructor from a polygon.
CGAL::Polygon_with_holes_2< Kernel, Containter >::Polygon_with_holes_2 | ( | const Polygon_2 & | pgn_boundary, |
HolesInputIterator | h_begin, | ||
HolesInputIterator | h_end | ||
) |
Constructor from a polygon (outer boundary) and hole polygons.
|
related |
This operator exports a polygon with holes to the output stream out
.
An ASCII and a binary format exist. The format can be selected with the CGAL modifiers for streams, set_ascii_mode()
and set_binary_mode()
respectively. The modifier set_pretty_mode()
can be used to allow for (a few) structuring comments in the output. Otherwise, the output would be free of comments. The default for writing is ASCII without comments.
The number of points of the outer boundary is exported followed by the points themselves in counterclockwise order. Then, the number of holes is exported, and for each hole, the number of points on its outer boundary is exported followed by the points themselves in clockwise order.
|
related |
This operator imports a polygon with holes from the input stream in
.
An ASCII and a binary format exist. The stream detects the format automatically and can read both.
The format consists of the number of points of the outer boundary followed by the points themselves in counterclockwise order, followed by the number of holes, and for each hole, the number of points of the outer boundary is followed by the points themselves in clockwise order.