CGAL 6.2 - 2D Polygons: CGAL::General_polygon_with_holes_2< Polygon_ > Class Template Reference

CGAL 6.2 - 2D Polygons

Loading...
Searching...
No Matches
List of all members | Related Functions
CGAL::General_polygon_with_holes_2< Polygon_ > Class Template Reference
Reference Manual

`#include <CGAL/General_polygon_with_holes_2.h>`

Inherited by CGAL::Polygon_with_holes_2< Kernel, Container_ >.

## Definition

template<typename Polygon_>
class CGAL::General_polygon_with_holes_2< Polygon_ >

The class `General_polygon_with_holes_2` models the concept `GeneralPolygonWithHoles_2`.

It represents a general polygon with holes. It is parameterized with a type `Polygon_` used to define the exposed type `Polygon_2`. This type represents the outer boundary of the general polygon and each hole.

Template Parameters

  Polygon_ | must have input and output operators.

Is model of
  `GeneralPolygonWithHoles_2`

## Related Functions
(Note that these are not member functions.)
template<typename Polygon_ >
std::ostream & | operator<< (std::ostream &os, const General_polygon_with_holes_2< Polygon_ > &p)
| This operator exports a `General_polygon_with_holes_2` to the output stream `os`.
template<typename Polygon_ >
std::istream & | operator>> (std::istream &is, General_polygon_with_holes_2< Polygon_ > &p)
| This operator imports a `General_polygon_with_holes_2` from the input stream `is`.

## Definition
typedef Polygon_ | Polygon_2
| polygon without hole type

## Friends And Related Function Documentation

## ◆ operator<<()

template<typename Polygon_ >

std::ostream & operator<< | ( | std::ostream & | os,
|  | const General_polygon_with_holes_2< Polygon_ > & | p
| ) |  |
| related

This operator exports a `General_polygon_with_holes_2` to the output stream `os`.

An ASCII and a binary format exist. The format can be selected with the CGAL modifiers for streams, `CGAL::IO::set_ascii_mode()` and `CGAL::IO::set_binary_mode()`, respectively. The modifier `CGAL::IO::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 curves of the outer boundary is exported followed by the curves themselves. Then, the number of holes is exported, and for each hole, the number of curves on its outer boundary is exported followed by the curves themselves.

## ◆ operator>>()

template<typename Polygon_ >

std::istream & operator>> | ( | std::istream & | is,
|  | General_polygon_with_holes_2< Polygon_ > & | p
| ) |  |
| related

This operator imports a `General_polygon_with_holes_2` from the input stream `is`.

Both ASCII and binary formats are supported, and the format is automatically detected.

The format consists of the number of curves of the outer boundary followed by the curves themselves, followed by the number of holes, and for each hole, the number of curves on its outer boundary is followed by the curves themselves.