CGAL 6.2 - 2D Polygons

Loading...
Searching...
No Matches
List of all members | Public Types | Public Member Functions | Related Functions
CGAL::Multipolygon_with_holes_2< Kernel, Container_ > Class Template Reference
Reference Manual

`#include <CGAL/Multipolygon_with_holes_2.h>`

## Definition

template<class Kernel, class Container_ = std::vector<typename Kernel::Point_2>>
class CGAL::Multipolygon_with_holes_2< Kernel, Container_ >

The class `Multipolygon_with_holes_2` models the concept `MultipolygonWithHoles_2`.

It is parameterized with two types (`Kernel` and `Container_`) that are used to instantiate the types `Polygon_2<Kernel,Container_>` and `Polygon_with_holes_2<Kernel,Container_>`. The latter is used to represent each polygon with holes. The former is converted to the latter.

Is model of
  `MultipolygonWithHoles_2`

Examples
  Polygon/draw_multipolygon_with_holes.cpp, Polygon/multipolygon.cpp, and Stream_support/Polygon_WKT.cpp.

## Public Types
using | Size = unsigned int
| the size type

## Public Member Functions
| Multipolygon_with_holes_2 ()=default
| Default constructor.
template<typename PolygonsInputIterator >
| Multipolygon_with_holes_2 (PolygonsInputIterator p_begin, PolygonsInputIterator p_end)
| Constructor from polygons.

## Related Functions
(Note that these are not member functions.)
template<class Kernel , class Container_ >
std::ostream & | operator<< (std::ostream &os, const Multipolygon_with_holes_2< Kernel, Container_ > &mp)
| inserts a multipolygon with holes to the output stream `os`.

## Definition
using | Polygon_2 = CGAL::Polygon_2< Kernel, Container_ >
| polygon type
using | Polygon_with_holes_2 = CGAL::Polygon_with_holes_2< Kernel, Container_ >
| polygon with holes type

## Friends And Related Function Documentation

## ◆ operator<<()

template<class Kernel , class Container_ >

std::ostream & operator<< | ( | std::ostream & | os,
|  | const Multipolygon_with_holes_2< Kernel, Container_ > & | mp
| ) |  |
| related

inserts a multipolygon with holes to the output stream `os`.

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 polygons is written followed by the polygons. For each polygon, the number of points of the outer boundary is written followed by the points themselves in counterclockwise order. Then, the number of holes is written, and for each hole, the number of points on its outer boundary is written followed by the points themselves in clockwise order.