GEOS 3.14.0dev
Public Member Functions | Static Public Member Functions | Friends | List of all members
geos::triangulate::polygon::PolygonHoleJoiner Class Reference

#include <PolygonHoleJoiner.h>

Public Member Functions

 PolygonHoleJoiner (const Polygon *p_inputPolygon)
 
std::unique_ptr< CoordinateSequencecompute ()
 

Static Public Member Functions

static std::unique_ptr< PolygonjoinAsPolygon (const Polygon *p_inputPolygon)
 
static std::unique_ptr< CoordinateSequencejoin (const Polygon *p_inputPolygon)
 

Friends

class PolygonHoleJoiner::InteriorIntersectionDetector
 

Detailed Description

Transforms a polygon with holes into a single self-touching (invalid) ring by joining holes to the exterior shell or to another hole with out-and-back line segments. The holes are added in order of their envelopes (leftmost/lowest first). As the result shell develops, a hole may be added to what was originally another hole.

There is no attempt to optimize the quality of the join lines. In particular, holes may be joined by lines longer than is optimal. However, holes which touch the shell or other holes are joined at the touch point.

The class does not require the input polygon to have normal orientation (shell CW and rings CCW). The output ring is always CW.

Member Function Documentation

◆ compute()

std::unique_ptr< CoordinateSequence > geos::triangulate::polygon::PolygonHoleJoiner::compute ( )

Computes the joined ring.

Returns
the points in the joined ring

◆ join()

static std::unique_ptr< CoordinateSequence > geos::triangulate::polygon::PolygonHoleJoiner::join ( const Polygon p_inputPolygon)
static

Joins the shell and holes of a polygon and returns the result as sequence of Coordinates.

Parameters
p_inputPolygonthe polygon to join
Returns
the result coordinates

◆ joinAsPolygon()

static std::unique_ptr< Polygon > geos::triangulate::polygon::PolygonHoleJoiner::joinAsPolygon ( const Polygon p_inputPolygon)
static

Joins the shell and holes of a polygon and returns the result as an (invalid) Polygon.

Parameters
p_inputPolygonthe polygon to join
Returns
the result polygon

The documentation for this class was generated from the following file: