Pangolin
Header-only C++20 plane computational geometry library
Loading...
Searching...
No Matches
pgl::PolygonWithHoles< PointType_, TLabel > Struct Template Reference

Closed region bounded by one outer simple polygon minus disjoint polygonal holes. More...

#include <polygonwithholes.hpp>

Inheritance diagram for pgl::PolygonWithHoles< PointType_, TLabel >:
[legend]

Classes

class  VertexIterator
 Forward iterator flattening the region's rings into one vertex sequence: the outer boundary, then each hole in canonical order. More...

Public Types

using PointType = PointType_
using NumberType = typename PointType::NumberType
using LabelType = TLabel
using PolygonType = Polygon<PointType>
using EdgeType = Segment<PointType>

Public Member Functions

constexpr PolygonWithHoles ()=default
 Creates the empty region (a vertexless outer polygon, no holes).
constexpr PolygonWithHoles (PolygonType outer)
 Creates a hole-free region from its outer boundary.
template<std::ranges::input_range HoleRange>
requires detail::is_polygon_v<std::ranges::range_value_t<HoleRange>>
constexpr PolygonWithHoles (PolygonType outer, HoleRange &&holes, bool trusted=false)
 Creates a region from an outer boundary and a range of holes.
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
constexpr PolygonWithHoles (const PolygonWithHoles< OtherPointType, OtherLabelType > &other)
 Converts a region with compatible vertex type.
template<class A = LabelType>
requires (detail::has_label_v<A>)
constexpr A & label () const
 Returns the region label.
constexpr const PolygonTypeouter () const
 Returns the outer boundary.
constexpr std::size_t holeCount () const
 Returns the number of holes.
constexpr bool hasHoles () const
 Tests whether the region has at least one hole.
constexpr const PolygonTypehole (std::size_t index) const
 Accesses a hole by index.
constexpr const std::vector< PolygonType > & holes () const
 Returns the holes in canonical order.
constexpr auto begin () const
 Returns a constant iterator to the first hole.
constexpr auto cbegin () const
 Returns a constant iterator to the first hole.
constexpr auto end () const
 Returns a constant iterator past the last hole.
constexpr auto cend () const
 Returns a constant iterator past the last hole.
constexpr void addHole (PolygonType hole)
 Adds a hole, keeping the canonical order.
constexpr void eraseHole (std::size_t index)
 Erases the hole at the given index.
constexpr bool eraseHole (const PolygonType &hole)
 Erases the hole equal to the given polygon, if the region has one.
constexpr std::size_t vertexCount () const
 Returns the total number of vertices over all rings.
constexpr std::size_t chainCount () const
 Total number of maximal lexicographically monotone chains over all rings; see Polygon::chainCount.
constexpr std::vector< PointTypevertices () const
 Returns the vertices of every ring, outer boundary first.
constexpr auto verticesView () const
 Returns a lazy view over the vertices of every ring, outer boundary first, without allocating a vector.
constexpr VertexIterator verticesBegin () const
 Returns an iterator to the first vertex of the outer boundary.
constexpr VertexIterator verticesEnd () const
 Returns an iterator past the last vertex of the last hole.
constexpr std::vector< EdgeTypeedges () const
 Returns the boundary edges of every ring, outer boundary first.
constexpr std::vector< OrientedSegment< PointType > > orientedEdges () const
 Returns the boundary edges directed so the region lies to the left.
constexpr PolygonSet< PointTypeasPolygonSet () const
 Returns the region as a one-component set of regions.
constexpr auto operator<=> (const PolygonWithHoles &other) const
 Compares two regions by outer boundary, then by canonical hole list.
constexpr bool operator== (const PolygonWithHoles &other) const
 Checks equality of two regions.
template<AnyShapeConcept OtherShape>
constexpr bool samePointSet (const OtherShape &other) const
 Tests whether another shape defines exactly the same point set.
constexpr bool empty () const
 Tests whether the region has no outer boundary at all.
constexpr bool isDegenerate () const
 Tests whether the region has zero area.
constexpr bool isPoint () const
 Tests whether the region covers exactly one point.
constexpr bool isSegment () const
 Tests whether the region covers exactly one segment of positive length.
constexpr bool isUndefined () const
 Tests whether the region is degenerate without covering a point or a segment (which includes the empty region).
template<class Rational = pgl::Rational<pgl::BigInt>>
bool isSimple () const
 Tests whether every ring is simple.
template<class Rational = pgl::Rational<pgl::BigInt>>
bool isValid () const
 Tests the structural contract: every ring simple, every hole inside the outer boundary, hole interiors pairwise disjoint.
bool isRegular () const
 Tests whether the region is the closure of its own interior (A = closure(A°)).
template<class ResultNumber = division_result_t<NumberType>>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularized () const
 Returns the region without its slits (closure(A°)), as a set of regions.
template<class ResultNumber = NumberType>
constexpr ResultNumber twiceArea () const
 Computes twice the area of the region.
template<class ResultNumber = division_result_t<NumberType>>
constexpr auto area () const
 Computes the area of the region.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Point< ResultNumber > centroid () const
 Computes the area-weighted centroid of the region.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Point< ResultNumber > verticesCentroid () const
 Computes the centroid of the vertex set over all rings.
template<class ResultNumber = division_result_t<NumberType>>
Point< ResultNumber > pointInside () const
 Returns a point strictly inside the region.
template<class OtherShape>
bool pointInsideInteriorContainedIn (const OtherShape &shape) const
 Tests whether some point in this shape's relative interior lies in the strict interior of shape.
auto triangulation () const
 Builds the constrained Delaunay triangulation of this region.
template<class SegmentRange>
auto triangulation (const SegmentRange &segments) const
 Builds the constrained Delaunay triangulation of this region with the given interior constraint segments.
Graph< PointTypevisibilityGraph () const
 Returns the visibility graph of the region's vertices.
Graph< PointTypeclearVisibilityGraph () const
 Returns the clear visibility graph of the region's vertices.
Graph< PointTypereducedVisibilityGraph () const
 Returns the reduced visibility graph of the region's vertices.
std::vector< PointTypevisibleVertices (const PointType &query) const
 The region's vertices visible from query.
std::vector< PointTypeclearlyVisibleVertices (const PointType &query) const
 The region's vertices clearly visible from query.
template<class ResultNumber = division_result_t<NumberType>>
Polygon< Point< ResultNumber > > regularizedVisiblePolygon (const PointType &query) const
 The part of the region visible from query, regularized.
std::vector< Convex< PointType > > convexPartition () const
 Cuts this region into convex pieces with disjoint interiors.
std::vector< Convex< PointType > > convexCovering () const
 Covers this region with a greedily selected set of convex polygons.
template<class ResultNumber = grid_number_t<typename PointType_::NumberType>>
requires (std::signed_integral<ResultNumber>)
auto asBitMatrix () const
 Rasterizes this region into a BitMatrix, one bit per covered cell.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherPolygon &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherConvex &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherTriangle &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherRectangle &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherRegion &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherSet &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherIntersection &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference (const OtherHalfplane &other) const
 Returns the regularized set difference of the two shapes (A ∖ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedUnion (const OtherPolygon &other) const
 Returns the regularized union of the two shapes (A ∪ B).
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedUnion (const OtherConvex &other) const
 Returns the regularized union of the two shapes (A ∪ B).
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedUnion (const OtherTriangle &other) const
 Returns the regularized union of the two shapes (A ∪ B).
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedUnion (const OtherRectangle &other) const
 Returns the regularized union of the two shapes (A ∪ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedUnion (const OtherRegion &other) const
 Returns the regularized union of the two shapes (A ∪ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
auto regularizedUnion (const OtherSet &other) const
 Returns the regularized union of the two shapes (A ∪ B).
template<class ResultNumber = NumberType, PointConcept OtherPoint>
constexpr std::optional< Point< ResultNumber, typename PointType::LabelType > > intersection (const OtherPoint &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherSegment &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherOrientedSegment &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherLine &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherOrientedLine &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherRay &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
constexpr auto intersection (const OtherPolyline &other) const
 Returns the intersection with an open polyline (A ∩ B), a sequence of points and segments sorted by lexicographic order.
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
constexpr auto intersection (const OtherChain &other) const
 Returns the intersection with a monotone chain (A ∩ B), a sequence of points and segments sorted by lexicographic order.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherPolygon &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherConvex &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherTriangle &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherRectangle &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherRegion &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherIntersection &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherHalfplane &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedIntersection (const OtherPolygon &other) const
 Returns the regularized intersection of the two shapes (A ∩ B).
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedIntersection (const OtherConvex &other) const
 Returns the regularized intersection of the two shapes (A ∩ B).
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedIntersection (const OtherTriangle &other) const
 Returns the regularized intersection of the two shapes (A ∩ B).
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedIntersection (const OtherRectangle &other) const
 Returns the regularized intersection of the two shapes (A ∩ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedIntersection (const OtherRegion &other) const
 Returns the regularized intersection of the two shapes (A ∩ B).
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedIntersection (const OtherIntersection &other) const
 Returns the regularized intersection of the two shapes (A ∩ B).
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedIntersection (const OtherHalfplane &other) const
 Returns the regularized intersection of the two shapes (A ∩ B).
template<class ResultNumber = NumberType, class EmptyPoint>
constexpr EmptyShape< EmptyPoint > intersection (const EmptyShape< EmptyPoint > &) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > symmetricDifference (const OtherPolygon &other) const
 Returns the regularized symmetric difference of the two shapes (A △ B).
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > symmetricDifference (const OtherConvex &other) const
 Returns the regularized symmetric difference of the two shapes (A △ B).
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > symmetricDifference (const OtherTriangle &other) const
 Returns the regularized symmetric difference of the two shapes (A △ B).
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > symmetricDifference (const OtherRectangle &other) const
 Returns the regularized symmetric difference of the two shapes (A △ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > symmetricDifference (const OtherRegion &other) const
 Returns the regularized symmetric difference of the two shapes (A △ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
auto symmetricDifference (const OtherSet &other) const
 Returns the regularized symmetric difference of the two shapes (A △ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherPolygon &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherConvex &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherTriangle &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherRectangle &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherRegion &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherPolyline &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherChain &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherSegment &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherSegment>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherSegment &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > minkowskiSum (const OtherSet &other) const
 Returns the regularized Minkowski sum of the two shapes (A ⊕ B), as a set of regions.
template<class OtherShape>
requires MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
constexpr auto minkowskiSum (const OtherShape &other) const
 Returns the Minkowski sum of this shape and another (A ⊕ B).
template<class OtherShape>
requires MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
constexpr auto minkowskiErosion (const OtherShape &other) const
 Returns the Minkowski erosion of this shape by another (A ⊖ B).
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires (!MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape> && BoundedPolygonalConcept<OtherShape>)
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > minkowskiErosion (const OtherShape &other) const
 Returns the regularized Minkowski erosion of this shape by a bounded polygonal one (A ⊖ B), as a set of regions.
constexpr Segment< PointTypediameter () const
 Returns a segment realizing the diameter (the farthest vertex pair).
constexpr Convex< PointTypeconvexHull () const
 Returns the convex hull of the region's vertices.
constexpr const Rectangle< PointType > & bbox () const
 Computes the bounding box of the region.
template<class ResultNumber = grid_number_t<typename PointType_::NumberType>>
requires (detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
std::vector< Point< ResultNumber, typename PointType::LabelType > > latticePoints () const
 Returns the integer points the region contains.
template<std::floating_point ResultNumber = double>
constexpr Rectangle< Point< ResultNumber > > fbox () const
 Computes the floating-point bounding box of the region.
template<PointConcept OtherPoint>
constexpr bool contains (const OtherPoint &point) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool interiorContains (const OtherPoint &point) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool boundaryContains (const OtherPoint &point) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool intersects (const OtherPoint &point) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool interiorsIntersect (const OtherPoint &) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<SegmentConcept OtherSegment>
constexpr bool contains (const OtherSegment &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool contains (const OtherOrientedSegment &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<SegmentConcept OtherSegment>
constexpr bool interiorContains (const OtherSegment &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<SegmentConcept OtherSegment>
constexpr bool interiorContainsInterior (const OtherSegment &other) const
 Tests whether this shape's interior contains the segment's interior.
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool interiorContains (const OtherOrientedSegment &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<SegmentConcept OtherSegment>
constexpr bool boundaryContains (const OtherSegment &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool boundaryContains (const OtherOrientedSegment &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<SegmentConcept OtherSegment>
constexpr bool intersects (const OtherSegment &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool intersects (const OtherOrientedSegment &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<SegmentConcept OtherSegment>
constexpr bool interiorsIntersect (const OtherSegment &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool interiorsIntersect (const OtherOrientedSegment &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<LineConcept OtherLine>
constexpr bool contains (const OtherLine &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool contains (const OtherOrientedLine &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<RayConcept OtherRay>
constexpr bool contains (const OtherRay &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneConcept OtherHalfplane>
constexpr bool contains (const OtherHalfplane &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<LineConcept OtherLine>
constexpr bool interiorContains (const OtherLine &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool interiorContains (const OtherOrientedLine &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<RayConcept OtherRay>
constexpr bool interiorContains (const OtherRay &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<HalfplaneConcept OtherHalfplane>
constexpr bool interiorContains (const OtherHalfplane &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<LineConcept OtherLine>
constexpr bool boundaryContains (const OtherLine &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool boundaryContains (const OtherOrientedLine &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<RayConcept OtherRay>
constexpr bool boundaryContains (const OtherRay &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<HalfplaneConcept OtherHalfplane>
constexpr bool boundaryContains (const OtherHalfplane &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<LineConcept OtherLine>
constexpr bool intersects (const OtherLine &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool intersects (const OtherOrientedLine &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<RayConcept OtherRay>
constexpr bool intersects (const OtherRay &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<HalfplaneConcept OtherHalfplane>
constexpr bool intersects (const OtherHalfplane &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<LineConcept OtherLine>
constexpr bool interiorsIntersect (const OtherLine &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool interiorsIntersect (const OtherOrientedLine &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<RayConcept OtherRay>
constexpr bool interiorsIntersect (const OtherRay &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<HalfplaneConcept OtherHalfplane>
constexpr bool interiorsIntersect (const OtherHalfplane &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<RectangleConcept OtherRectangle>
constexpr bool contains (const OtherRectangle &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool contains (const OtherTriangle &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool contains (const OtherConvex &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool contains (const OtherPolygon &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool contains (const OtherRegion &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<RectangleConcept OtherRectangle>
constexpr bool interiorContains (const OtherRectangle &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool interiorContains (const OtherTriangle &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool interiorContains (const OtherConvex &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool interiorContains (const OtherPolygon &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool interiorContains (const OtherRegion &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<RectangleConcept OtherRectangle>
constexpr bool boundaryContains (const OtherRectangle &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool boundaryContains (const OtherTriangle &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool boundaryContains (const OtherConvex &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool boundaryContains (const OtherPolygon &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool boundaryContains (const OtherRegion &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<RectangleConcept OtherRectangle>
constexpr bool intersects (const OtherRectangle &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<TriangleConcept OtherTriangle>
constexpr bool intersects (const OtherTriangle &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<ConvexConcept OtherConvex>
constexpr bool intersects (const OtherConvex &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PolygonConcept OtherPolygon>
constexpr bool intersects (const OtherPolygon &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool intersects (const OtherRegion &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<RectangleConcept OtherRectangle>
bool interiorsIntersect (const OtherRectangle &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<TriangleConcept OtherTriangle>
bool interiorsIntersect (const OtherTriangle &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<ConvexConcept OtherConvex>
bool interiorsIntersect (const OtherConvex &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<PolygonConcept OtherPolygon>
bool interiorsIntersect (const OtherPolygon &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<PolygonWithHolesConcept OtherRegion>
bool interiorsIntersect (const OtherRegion &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<MonotoneChainConcept OtherChain>
constexpr bool contains (const OtherChain &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool contains (const OtherPolyline &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool interiorContains (const OtherChain &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool interiorContains (const OtherPolyline &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool boundaryContains (const OtherChain &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool boundaryContains (const OtherPolyline &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool intersects (const OtherChain &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool intersects (const OtherPolyline &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool interiorsIntersect (const OtherChain &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<PolylineConcept OtherPolyline>
constexpr bool interiorsIntersect (const OtherPolyline &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<DiskConcept OtherDisk>
constexpr bool contains (const OtherDisk &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool interiorContains (const OtherDisk &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool boundaryContains (const OtherDisk &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool intersects (const OtherDisk &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<DiskConcept OtherDisk>
bool interiorsIntersect (const OtherDisk &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<HalfplaneIntersectionConcept OtherIntersection>
constexpr bool contains (const OtherIntersection &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneIntersectionConcept OtherIntersection>
constexpr bool interiorContains (const OtherIntersection &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneIntersectionConcept OtherIntersection>
constexpr bool boundaryContains (const OtherIntersection &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneIntersectionConcept OtherIntersection>
constexpr bool intersects (const OtherIntersection &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneIntersectionConcept OtherIntersection>
bool interiorsIntersect (const OtherIntersection &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<PointConcept OtherPoint>
bool separates (const OtherPoint &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<SegmentConcept OtherSegment>
bool separates (const OtherSegment &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<OrientedSegmentConcept OtherOrientedSegment>
bool separates (const OtherOrientedSegment &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<LineConcept OtherLine>
bool separates (const OtherLine &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<OrientedLineConcept OtherOrientedLine>
bool separates (const OtherOrientedLine &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<RayConcept OtherRay>
bool separates (const OtherRay &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<HalfplaneConcept OtherHalfplane>
bool separates (const OtherHalfplane &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<RectangleConcept OtherRectangle>
bool separates (const OtherRectangle &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<TriangleConcept OtherTriangle>
bool separates (const OtherTriangle &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<ConvexConcept OtherConvex>
bool separates (const OtherConvex &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolygonConcept OtherPolygon>
bool separates (const OtherPolygon &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolygonWithHolesConcept OtherRegion>
bool separates (const OtherRegion &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<MonotoneChainConcept OtherChain>
bool separates (const OtherChain &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolylineConcept OtherPolyline>
bool separates (const OtherPolyline &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<DiskConcept OtherDisk>
bool separates (const OtherDisk &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<HalfplaneIntersectionConcept OtherIntersection>
bool separates (const OtherIntersection &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PointConcept OtherPoint>
bool crosses (const OtherPoint &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<SegmentConcept OtherSegment>
bool crosses (const OtherSegment &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<OrientedSegmentConcept OtherOrientedSegment>
bool crosses (const OtherOrientedSegment &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<LineConcept OtherLine>
bool crosses (const OtherLine &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<OrientedLineConcept OtherOrientedLine>
bool crosses (const OtherOrientedLine &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<RayConcept OtherRay>
bool crosses (const OtherRay &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<HalfplaneConcept OtherHalfplane>
bool crosses (const OtherHalfplane &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<RectangleConcept OtherRectangle>
bool crosses (const OtherRectangle &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<TriangleConcept OtherTriangle>
bool crosses (const OtherTriangle &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<ConvexConcept OtherConvex>
bool crosses (const OtherConvex &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PolygonConcept OtherPolygon>
bool crosses (const OtherPolygon &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PolygonWithHolesConcept OtherRegion>
bool crosses (const OtherRegion &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<MonotoneChainConcept OtherChain>
bool crosses (const OtherChain &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PolylineConcept OtherPolyline>
bool crosses (const OtherPolyline &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<DiskConcept OtherDisk>
bool crosses (const OtherDisk &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<HalfplaneIntersectionConcept OtherIntersection>
bool crosses (const OtherIntersection &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto squaredDistance (const OtherPoint &point) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr auto squaredDistance (const OtherSegment &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr auto squaredDistance (const OtherOrientedSegment &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr auto squaredDistance (const OtherLine &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr auto squaredDistance (const OtherOrientedLine &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr auto squaredDistance (const OtherRay &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
constexpr auto squaredDistance (const OtherHalfplane &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
constexpr auto squaredDistance (const OtherRectangle &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
constexpr auto squaredDistance (const OtherTriangle &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
constexpr auto squaredDistance (const OtherConvex &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
constexpr auto squaredDistance (const OtherPolygon &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
constexpr auto squaredDistance (const OtherRegion &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
constexpr auto squaredDistance (const OtherChain &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
constexpr auto squaredDistance (const OtherPolyline &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
constexpr auto squaredDistance (const OtherIntersection &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = double, DiskConcept OtherDisk>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherDisk &other) const
 Computes the squared Euclidean distance to a disk.
template<class ResultNumber = NumberType, BoundedPolygonalConcept OtherShape>
requires detail::ClosestPairConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
constexpr auto closestSegments (const OtherShape &other) const
 Returns the pair of elements realizing the distance, nothing when the shapes meet.
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires detail::ClosestPointsPairConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
constexpr auto closestPoints (const OtherShape &other) const
 Returns the pair of points realizing the distance, nothing when the shapes meet.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto distanceL1 (const OtherPoint &point) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr auto distanceL1 (const OtherSegment &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr auto distanceL1 (const OtherOrientedSegment &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr auto distanceL1 (const OtherLine &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr auto distanceL1 (const OtherOrientedLine &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr auto distanceL1 (const OtherRay &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
constexpr auto distanceL1 (const OtherHalfplane &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
constexpr auto distanceL1 (const OtherRectangle &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
constexpr auto distanceL1 (const OtherTriangle &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
constexpr auto distanceL1 (const OtherConvex &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
constexpr auto distanceL1 (const OtherPolygon &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
constexpr auto distanceL1 (const OtherRegion &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
constexpr auto distanceL1 (const OtherChain &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
constexpr auto distanceL1 (const OtherPolyline &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
constexpr auto distanceL1 (const OtherIntersection &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto distanceLInf (const OtherPoint &point) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr auto distanceLInf (const OtherSegment &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr auto distanceLInf (const OtherOrientedSegment &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr auto distanceLInf (const OtherLine &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr auto distanceLInf (const OtherOrientedLine &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr auto distanceLInf (const OtherRay &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
constexpr auto distanceLInf (const OtherHalfplane &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
constexpr auto distanceLInf (const OtherRectangle &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
constexpr auto distanceLInf (const OtherTriangle &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
constexpr auto distanceLInf (const OtherConvex &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
constexpr auto distanceLInf (const OtherPolygon &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
constexpr auto distanceLInf (const OtherRegion &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
constexpr auto distanceLInf (const OtherChain &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
constexpr auto distanceLInf (const OtherPolyline &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
constexpr auto distanceLInf (const OtherIntersection &other) const
 Computes the squared Euclidean distance to the other shape.
template<PolygonSetConcept OtherSet>
constexpr bool contains (const OtherSet &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonSetConcept OtherSet>
constexpr bool boundaryContains (const OtherSet &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonSetConcept OtherSet>
constexpr bool interiorContains (const OtherSet &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonSetConcept OtherSet>
bool separates (const OtherSet &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<class OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>)
constexpr bool intersects (const OtherShape &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<class OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>)
constexpr bool interiorsIntersect (const OtherShape &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<class OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>)
constexpr bool crosses (const OtherShape &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires (!PointConcept<OtherShape> && (detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const
OtherShape& o, const PolygonWithHoles& self) { o.template intersection<ResultNumber>(self); })
auto intersection (const OtherShape &other) const
 Forwards an intersection to the higher-ranked shape.
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires (!PointConcept<OtherShape> && (detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const
OtherShape& o, const PolygonWithHoles& self) { o.template regularizedIntersection<ResultNumber>(self); })
constexpr auto regularizedIntersection (const OtherShape &other) const
 Forwards a regularized intersection to the higher-ranked shape.
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const OtherShape& o, const
PolygonWithHoles& self) { o.template squaredDistance<ResultNumber>(self); })
constexpr auto squaredDistance (const OtherShape &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const OtherShape& o, const
PolygonWithHoles& self) { o.template distanceL1<ResultNumber>(self); })
constexpr auto distanceL1 (const OtherShape &other) const
 Computes the squared Euclidean distance to the other shape.
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const OtherShape& o, const
PolygonWithHoles& self) { o.template distanceLInf<ResultNumber>(self); })
constexpr auto distanceLInf (const OtherShape &other) const
 Computes the squared Euclidean distance to the other shape.
template<class EmptyPoint>
constexpr bool contains (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<class EmptyPoint>
constexpr bool interiorContains (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<class EmptyPoint>
constexpr bool boundaryContains (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<class EmptyPoint>
constexpr bool intersects (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<class EmptyPoint>
constexpr bool interiorsIntersect (const EmptyShape< EmptyPoint > &) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<class EmptyPoint>
constexpr bool separates (const EmptyShape< EmptyPoint > &) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<class EmptyPoint>
constexpr bool crosses (const EmptyShape< EmptyPoint > &) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PointConcept OtherPoint>
constexpr bool contains (const Shape< OtherPoint > &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool interiorContains (const Shape< OtherPoint > &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool boundaryContains (const Shape< OtherPoint > &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool intersects (const Shape< OtherPoint > &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool interiorsIntersect (const Shape< OtherPoint > &other) const
 Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool separates (const Shape< OtherPoint > &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PointConcept OtherPoint>
constexpr bool crosses (const Shape< OtherPoint > &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto intersection (const Shape< OtherPoint > &other) const
 Returns the intersection of the two shapes (A ∩ B), re-dispatching through the wrapper's own intersection.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto regularizedIntersection (const Shape< OtherPoint > &other) const
 Re-dispatches a regularized intersection through a runtime shape.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto regularizedUnion (const Shape< OtherPoint > &other) const
 Returns the regularized union of the two shapes (A ∪ B), re-dispatching through the wrapper's own regularizedUnion.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto difference (const Shape< OtherPoint > &other) const
 Returns the regularized set difference of the two shapes (A ∖ B), re-dispatching through the wrapper's own difference.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto symmetricDifference (const Shape< OtherPoint > &other) const
 Returns the regularized symmetric difference of the two shapes (A △ B), re-dispatching through the wrapper's own symmetricDifference.
template<class ResultNumber = double, PointConcept OtherPoint>
constexpr auto distanceL1 (const Shape< OtherPoint > &other) const
 Returns the Manhattan (L1) distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceL1.
template<class ResultNumber = double, PointConcept OtherPoint>
constexpr auto distanceLInf (const Shape< OtherPoint > &other) const
 Returns the Chebyshev (L∞) distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceLInf.
template<class TranslationNumber, class TranslationLabel>
constexpr PolygonWithHolesoperator+= (const Point< TranslationNumber, TranslationLabel > &translation)
 Translates the region in place.
template<class TranslationNumber, class TranslationLabel>
constexpr PolygonWithHolesoperator-= (const Point< TranslationNumber, TranslationLabel > &translation)
 Translates the region in place by the opposite vector.
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr PolygonWithHolesoperator*= (const Scalar &scalar)
 Scales the region in place.
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr PolygonWithHolesoperator/= (const Scalar &scalar)
 Scales the region in place.
constexpr PolygonWithHoles rotated90 (int k) const
 Returns the region rotated by 90k degrees around the origin.
constexpr void rotate90 (int k)
 Rotates the region by 90k degrees around the origin in place.
template<class OtherNumber>
constexpr PolygonWithHoles scaledUpX (const OtherNumber scalar) const
 Returns the region with its x-coordinates multiplied by scalar.
template<class OtherNumber>
constexpr void scaleUpX (const OtherNumber scalar)
 Scales the region's x-coordinates up in place.
template<class OtherNumber>
constexpr PolygonWithHoles scaledUpY (const OtherNumber scalar) const
 Returns the region with its x-coordinates multiplied by scalar.
template<class OtherNumber>
constexpr void scaleUpY (const OtherNumber scalar)
 Scales the region's y-coordinates up in place.
template<class OtherNumber>
constexpr PolygonWithHoles scaledDownX (const OtherNumber scalar) const
 Returns the region with its x-coordinates multiplied by scalar.
template<class OtherNumber>
constexpr void scaleDownX (const OtherNumber scalar)
 Scales the region's x-coordinates down in place.
template<class OtherNumber>
constexpr PolygonWithHoles scaledDownY (const OtherNumber scalar) const
 Returns the region with its x-coordinates multiplied by scalar.
template<class OtherNumber>
constexpr void scaleDownY (const OtherNumber scalar)
 Scales the region's y-coordinates down in place.
template<class ResultNumber>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularized () const
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherPolygon &other) const
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherConvex &other) const
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherTriangle &other) const
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherRectangle &other) const
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherRegion &other) const
template<class ResultNumber, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherSet &other) const
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherIntersection &other) const
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > difference (const OtherHalfplane &other) const
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedUnion (const OtherPolygon &other) const
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedUnion (const OtherConvex &other) const
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedUnion (const OtherTriangle &other) const
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedUnion (const OtherRectangle &other) const
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedUnion (const OtherRegion &other) const
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > symmetricDifference (const OtherPolygon &other) const
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > symmetricDifference (const OtherConvex &other) const
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > symmetricDifference (const OtherTriangle &other) const
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > symmetricDifference (const OtherRectangle &other) const
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > symmetricDifference (const OtherRegion &other) const
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedIntersection (const OtherPolygon &other) const
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedIntersection (const OtherConvex &other) const
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedIntersection (const OtherTriangle &other) const
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedIntersection (const OtherRectangle &other) const
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedIntersection (const OtherRegion &other) const
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedIntersection (const OtherIntersection &other) const
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > regularizedIntersection (const OtherHalfplane &other) const
template<class ResultNumber, PolygonConcept OtherPolygon>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherPolygon &other) const
template<class ResultNumber, ConvexConcept OtherConvex>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherConvex &other) const
template<class ResultNumber, TriangleConcept OtherTriangle>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherTriangle &other) const
template<class ResultNumber, RectangleConcept OtherRectangle>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherRectangle &other) const
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherRegion &other) const
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherIntersection &other) const
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherHalfplane &other) const
template<class ResultNumber, PointConcept OtherPoint>
constexpr std::optional< Point< ResultNumber, typename PointType_::LabelType > > intersection (const OtherPoint &other) const
template<class ResultNumber, SegmentConcept OtherSegment>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherSegment &other) const
template<class ResultNumber, OrientedSegmentConcept OtherOrientedSegment>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherOrientedSegment &other) const
template<class ResultNumber, LineConcept OtherLine>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherLine &other) const
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherOrientedLine &other) const
template<class ResultNumber, RayConcept OtherRay>
constexpr std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > intersection (const OtherRay &other) const
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherPolygon &other) const
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherConvex &other) const
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherTriangle &other) const
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherRectangle &other) const
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherRegion &other) const
template<class ResultNumber, SegmentConcept OtherSegment>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherSegment &other) const
template<class ResultNumber, OrientedSegmentConcept OtherOriented>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherOriented &other) const
template<class ResultNumber, PolylineConcept OtherPolyline>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherPolyline &other) const
template<class ResultNumber, MonotoneChainConcept OtherChain>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherChain &other) const
template<class ResultNumber, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherSet &other) const

Friends

template<class OtherPointType, class OtherLabelType>
struct PolygonWithHoles

Detailed Description

template<class PointType_, class TLabel>
struct pgl::PolygonWithHoles< PointType_, TLabel >

Closed region bounded by one outer simple polygon minus disjoint polygonal holes.

A closed region bounded by one outer simple polygon minus a set of disjoint polygonal holes.

The region is exactly

A = outer \ (hole_0° ∪ hole_1° ∪ ...)
constexpr const PolygonType & outer() const
Returns the outer boundary.
Definition polygonwithholes.hpp:178

— the outer polygon minus the interiors of the holes, so every hole boundary belongs to the region and A is closed. Its boundary is ∂A = ∂outer ∪ ∂hole_0 ∪ ∂hole_1 ∪ .... This identity is the definition every predicate and measure below is derived from; there is no separate geometric machinery.

This is the library's first shape whose interior is not simply connected, and it is the codomain that non-convex Minkowski sums, nested polygon intersections, and region difference need.

Storage. The outer boundary and every hole are ordinary Polygon values, each in Polygon's own canonical form (counterclockwise, lexicographically smallest vertex first) — holes are not stored reversed. Orientation is a traversal detail supplied on demand by orientedEdges, which reverses hole rings so the region stays on the left of every directed edge. Holes are kept sorted by Polygon::operator<=>, so equality, ordering and hashing do not depend on the order they were supplied in.

Preconditions. As with Polygon, whose constructor does not check simplicity, structural validity is a documented precondition rather than an enforced invariant: every ring must be simple, each hole must lie inside the outer polygon, and hole interiors must be pairwise disjoint.

The contract is about interiors only. Ring boundaries are free to meet in any way — at isolated points, or along shared stretches of edge, whether between two holes or between a hole and the outer boundary. Where they do, the region pinches shut and is locally one-dimensional there, which every predicate accounts for. What is rejected is a hole overlapping another hole, a hole escaping the outer polygon, and any self-intersecting ring.

isValid checks all of this on demand in O((n + k) log(n + k)); the constructor only canonicalizes.

Template Parameters
PointType_The vertex point type.
TLabelOptional label payload.

Member Typedef Documentation

◆ EdgeType

template<class PointType_, class TLabel>
using pgl::PolygonWithHoles< PointType_, TLabel >::EdgeType = Segment<PointType>

◆ LabelType

template<class PointType_, class TLabel>
using pgl::PolygonWithHoles< PointType_, TLabel >::LabelType = TLabel

◆ NumberType

template<class PointType_, class TLabel>
using pgl::PolygonWithHoles< PointType_, TLabel >::NumberType = typename PointType::NumberType

◆ PointType

template<class PointType_, class TLabel>
using pgl::PolygonWithHoles< PointType_, TLabel >::PointType = PointType_

◆ PolygonType

template<class PointType_, class TLabel>
using pgl::PolygonWithHoles< PointType_, TLabel >::PolygonType = Polygon<PointType>

Constructor & Destructor Documentation

◆ PolygonWithHoles() [1/4]

template<class PointType_, class TLabel>
pgl::PolygonWithHoles< PointType_, TLabel >::PolygonWithHoles ( )
constexprdefault

Creates the empty region (a vertexless outer polygon, no holes).

◆ PolygonWithHoles() [2/4]

template<class PointType_, class TLabel>
pgl::PolygonWithHoles< PointType_, TLabel >::PolygonWithHoles ( PolygonType outer)
inlineexplicitconstexpr

Creates a hole-free region from its outer boundary.

Parameters
outerThe outer boundary.

◆ PolygonWithHoles() [3/4]

template<class PointType_, class TLabel>
template<std::ranges::input_range HoleRange>
requires detail::is_polygon_v<std::ranges::range_value_t<HoleRange>>
pgl::PolygonWithHoles< PointType_, TLabel >::PolygonWithHoles ( PolygonType outer,
HoleRange && holes,
bool trusted = false )
inlineconstexpr

Creates a region from an outer boundary and a range of holes.

Holes of zero area (points, segments, and Polygon::isUndefined rings) remove nothing from the region and are dropped. The remaining holes are sorted into canonical order.

Template Parameters
HoleRangeRange whose elements are polygons.
Parameters
outerThe outer boundary.
holesThe holes; each must lie inside outer with interiors pairwise disjoint (a precondition, see isValid).
trustedWhen true, adopt holes as given without dropping degenerate rings or sorting. Only pass true for a range that is already in canonical form.

◆ PolygonWithHoles() [4/4]

template<class PointType_, class TLabel>
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
pgl::PolygonWithHoles< PointType_, TLabel >::PolygonWithHoles ( const PolygonWithHoles< OtherPointType, OtherLabelType > & other)
inlineconstexpr

Converts a region with compatible vertex type.

The source rings are already canonical and a coordinate-type conversion preserves both their orientation and their relative order, so no renormalization is needed.

Template Parameters
OtherPointTypeSource vertex type.
OtherLabelTypeSource label type.
Parameters
otherSource region.

Member Function Documentation

◆ addHole()

template<class PointType_, class TLabel>
void pgl::PolygonWithHoles< PointType_, TLabel >::addHole ( PolygonType hole)
inlineconstexpr

Adds a hole, keeping the canonical order.

A zero-area ring removes nothing and is ignored.

Parameters
holeThe hole to add; must lie inside the outer boundary with interior disjoint from the existing holes (a precondition, see isValid).

◆ area()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
auto pgl::PolygonWithHoles< PointType_, TLabel >::area ( ) const
inlinenodiscardconstexpr

Computes the area of the region.

Warning
Uses division by 2.

◆ asBitMatrix()

template<class PointType_, class TLabel>
requires (std::signed_integral<ResultNumber>)
template<class ResultNumber>
requires (std::signed_integral<ResultNumber>)
auto pgl::PolygonWithHoles< PointType_, TLabel >::asBitMatrix ( ) const
nodiscard

Rasterizes this region into a BitMatrix, one bit per covered cell.

Equivalent to BitMatrix(*this): the window is the bounding box and the set cells are the ones the region covers, holes left unset. Only a rectilinear region is exactly a set of grid cells, so every edge of every ring must be axis-parallel; use innerRaster or outerRaster to approximate any other region.

A cell is an integer position, so the coordinates must be whole numbers too. An integer region rasterizes as it stands; one over a Rational or a floating-point type is checked vertex by vertex and throws unless every coordinate happens to be whole – rounding one would move the region.

Template Parameters
ResultNumberInteger coordinate type of the grid (default: the coordinate type itself when it is a signed integer, the integer a Rational is built on, and int64_t otherwise).
Returns
A BitMatrix over the bounding box, covering this region.
Exceptions
std::logic_errorIf an edge of a ring is not axis-parallel, or a coordinate is not a whole number the grid can hold.

◆ asPolygonSet()

template<class PointType_, class TLabel>
PolygonSet< PointType > pgl::PolygonWithHoles< PointType_, TLabel >::asPolygonSet ( ) const
inlinenodiscardconstexpr

Returns the region as a one-component set of regions.

A region with no area covers nothing that survives regularization, so it gives back the empty set rather than a component without area.

Returns
PolygonSet whose only component is this region.

◆ bbox()

template<class PointType_, class TLabel>
const Rectangle< PointType > & pgl::PolygonWithHoles< PointType_, TLabel >::bbox ( ) const
inlinenodiscardconstexpr

Computes the bounding box of the region.

The holes lie inside the outer boundary, so this is the outer polygon's box, cached there.

◆ begin()

template<class PointType_, class TLabel>
auto pgl::PolygonWithHoles< PointType_, TLabel >::begin ( ) const
inlinenodiscardconstexpr

Returns a constant iterator to the first hole.

◆ boundaryContains() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::boundaryContains ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherChain & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ boundaryContains() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is a finite union of segments and therefore has no area, so only an operand that has collapsed can lie on it. A collapsed operand is exactly the union of its edges, which the segment overload settles.

◆ boundaryContains() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherDisk & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The disk is in the region when the outer polygon contains it and it never enters a hole interior; a disk tangent to a hole from outside is contained, one that swallows a hole is not.

A degenerate disk goes to the point overload with Disk::a: that is exactly the disk when its radius is zero, and a disk whose defining points are collinear but not all equal is undefined (it determines no circle), so any terminating answer meets the contract. The region cannot leave this to the outer polygon — a point of a hole interior is inside the outer polygon and outside the region.

◆ boundaryContains() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is bounded too, so only a degenerate operand qualifies.

◆ boundaryContains() [6/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherIntersection>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherIntersection & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

Only a bounded operand can lie in the bounded region; the empty region is contained by convention, matching the other shapes.

◆ boundaryContains() [7/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is bounded too, so only a degenerate operand qualifies.

◆ boundaryContains() [8/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is bounded too, so only a degenerate operand qualifies.

◆ boundaryContains() [9/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

True when the segment lies in the region without any part of it reaching the region interior, which is exactly lying on the union of the rings — a segment running from an outer edge onto a collinear hole edge included.

◆ boundaryContains() [10/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherPoint & point) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is the union of all rings, so this holds when the point lies on the outer ring or on any hole ring.

Complexity: O(n) over the total vertex count.

◆ boundaryContains() [11/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is a finite union of segments and therefore has no area, so only an operand that has collapsed can lie on it. A collapsed operand is exactly the union of its edges, which the segment overload settles.

◆ boundaryContains() [12/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ boundaryContains() [13/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is bounded too, so only a degenerate operand qualifies.

◆ boundaryContains() [14/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is a finite union of segments and therefore has no area, so only an operand that has collapsed can lie on it. A collapsed operand is exactly the union of its edges, which the segment overload settles.

◆ boundaryContains() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is a finite union of segments and therefore has no area, so only an operand that has collapsed can lie on it. A collapsed operand is exactly the union of its edges, which the segment overload settles.

◆ boundaryContains() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

True when the segment lies in the region without any part of it reaching the region interior, which is exactly lying on the union of the rings — a segment running from an outer edge onto a collinear hole edge included.

◆ boundaryContains() [17/19]

template<class PointType_, class TLabel>
template<PolygonSetConcept OtherSet>
bool pgl::PolygonWithHoles< PointType_, TLabel >::boundaryContains ( const OtherSet & other) const
inlinenodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

The boundary is a finite union of segments and therefore has no area, so only an operand that has collapsed can lie on it. A collapsed operand is exactly the union of its edges, which the segment overload settles.

◆ boundaryContains() [19/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::boundaryContains ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ cbegin()

template<class PointType_, class TLabel>
auto pgl::PolygonWithHoles< PointType_, TLabel >::cbegin ( ) const
inlinenodiscardconstexpr

Returns a constant iterator to the first hole.

◆ cend()

template<class PointType_, class TLabel>
auto pgl::PolygonWithHoles< PointType_, TLabel >::cend ( ) const
inlinenodiscardconstexpr

Returns a constant iterator past the last hole.

◆ centroid()

template<class PointType, class LabelType>
template<class ResultNumber>
Point< ResultNumber > pgl::PolygonWithHoles< PointType, LabelType >::centroid ( ) const
nodiscardconstexpr

Computes the area-weighted centroid of the region.

The holes enter with negative weight: (c_outer·A_outer − Σ c_i·A_i) / (A_outer − Σ A_i). When the net area is zero the region has no area-weighted centroid and the centroid of the vertex set is returned instead, matching Polygon::centroid.

Template Parameters
ResultNumberThe number type for the result.
Warning
Divides coordinates after casting to ResultNumber.

◆ chainCount()

template<class PointType_, class TLabel>
std::size_t pgl::PolygonWithHoles< PointType_, TLabel >::chainCount ( ) const
inlinenodiscardconstexpr

Total number of maximal lexicographically monotone chains over all rings; see Polygon::chainCount.

The region's boundary is the disjoint union of its rings, so a chain-pair boundary test against it pays for the sum of their chain counts. This is the input the sweep-versus-chains dispatch reads (see preferSweep).

Complexity: O(n) for n vertices over all rings.

◆ clearlyVisibleVertices()

template<class PointType_, class LabelType>
std::vector< PointType_ > pgl::PolygonWithHoles< PointType_, LabelType >::clearlyVisibleVertices ( const PointType & query) const
nodiscard

The region's vertices clearly visible from query.

The strict counterpart of visibleVertices, matching clearVisibilityGraph: the open segment queryv must lie in the interior of the region and hold no other vertex. Always a subset of visibleVertices.

Parameters
queryPoint to look from; outside the region nothing is visible.
Returns
The clearly visible vertices, ordered as in visibleVertices.

◆ clearVisibilityGraph()

template<class PointType_, class LabelType>
Graph< PointType_ > pgl::PolygonWithHoles< PointType_, LabelType >::clearVisibilityGraph ( ) const
nodiscard

Returns the clear visibility graph of the region's vertices.

Two vertices are adjacent exactly when the open segment joining them lies in the interior of the region and contains no other vertex — the strict reading, admitting neither grazing nor passing through a vertex. The rings' own edges are therefore absent, and what remains is exactly the set of legal triangulation diagonals of the region. Always a subgraph of visibilityGraph.

Returns
An undirected graph whose vertices are this region's vertices.

◆ closestPoints()

template<class PointType_, class TLabel>
requires detail::ClosestPointsPairConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
template<class ResultNumber, class OtherShape>
requires detail::ClosestPointsPairConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
auto pgl::PolygonWithHoles< PointType_, TLabel >::closestPoints ( const OtherShape & other) const
nodiscardconstexpr

Returns the pair of points realizing the distance, nothing when the shapes meet.

The first point lies on this shape and the second on other. Empty exactly when squaredDistance is zero. Unlike closestSegments this also takes an unbounded convex other — a line, an oriented line, a ray, a half-plane, a half-plane intersection — which realizes the distance at a point on no edge and at no vertex: there is no element to name there, but there is still a point to give.

Template Parameters
ResultNumberCoordinate type of the returned points (default: division_result_t).
Warning
A point interior to an element comes from a division, so with an integer ResultNumber it truncates. Request a floating-point or pgl::Rational result type for an accurate value.

◆ closestSegments()

template<class PointType_, class TLabel>
requires detail::ClosestPairConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
template<class ResultNumber, BoundedPolygonalConcept OtherShape>
requires detail::ClosestPairConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
auto pgl::PolygonWithHoles< PointType_, TLabel >::closestSegments ( const OtherShape & other) const
nodiscardconstexpr

Returns the pair of elements realizing the distance, nothing when the shapes meet.

The first element is this shape's, the second is other's; each is one of the shape's edges, degenerate to a vertex where the shape has none. Empty exactly when squaredDistance is zero.

Template Parameters
ResultNumberCoordinate type of the returned segments (default: NumberType).
Warning
other's coordinates and labels are re-expressed in this shape's, so a narrower ResultNumber loses them.

◆ contains() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::contains ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherChain & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ contains() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The shape is in the region when the outer boundary contains it and it never enters a hole interior; touching or running along a hole boundary is allowed, and so is enclosing a hole from outside — that hole's boundary is part of the region, but its interior is not, so a shape that swallows one is not contained.

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ contains() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherDisk & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The disk is in the region when the outer polygon contains it and it never enters a hole interior; a disk tangent to a hole from outside is contained, one that swallows a hole is not.

A degenerate disk goes to the point overload with Disk::a: that is exactly the disk when its radius is zero, and a disk whose defining points are collinear but not all equal is undefined (it determines no circle), so any terminating answer meets the contract. The region cannot leave this to the outer polygon — a point of a hole interior is inside the outer polygon and outside the region.

◆ contains() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The region is bounded and a line is not, so only a degenerate line — a single point — can be contained.

◆ contains() [6/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherIntersection>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherIntersection & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

Only a bounded operand can lie in the bounded region; the empty region is contained by convention, matching the other shapes.

◆ contains() [7/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The region is bounded and a line is not, so only a degenerate line — a single point — can be contained.

◆ contains() [8/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The region is bounded and a line is not, so only a degenerate line — a single point — can be contained.

◆ contains() [9/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The segment is in the region when the outer polygon contains it and it never enters a hole interior; running along a hole boundary is allowed.

Complexity: O(n·k) for a region of n vertices and k holes.

◆ contains() [10/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherPoint & point) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The point is in the region when the outer polygon contains it and no hole contains it strictly — a point on a hole boundary is on ∂A and is therefore contained.

Complexity: O(n) over the total vertex count.

◆ contains() [11/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The shape is in the region when the outer boundary contains it and it never enters a hole interior; touching or running along a hole boundary is allowed, and so is enclosing a hole from outside — that hole's boundary is part of the region, but its interior is not, so a shape that swallows one is not contained.

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ contains() [12/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ contains() [13/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The region is bounded and a line is not, so only a degenerate line — a single point — can be contained.

◆ contains() [14/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The shape is in the region when the outer boundary contains it and it never enters a hole interior; touching or running along a hole boundary is allowed, and so is enclosing a hole from outside — that hole's boundary is part of the region, but its interior is not, so a shape that swallows one is not contained.

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ contains() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The shape is in the region when the outer boundary contains it and it never enters a hole interior; touching or running along a hole boundary is allowed, and so is enclosing a hole from outside — that hole's boundary is part of the region, but its interior is not, so a shape that swallows one is not contained.

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ contains() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The segment is in the region when the outer polygon contains it and it never enters a hole interior; running along a hole boundary is allowed.

Complexity: O(n·k) for a region of n vertices and k holes.

◆ contains() [17/19]

template<class PointType_, class TLabel>
template<PolygonSetConcept OtherSet>
bool pgl::PolygonWithHoles< PointType_, TLabel >::contains ( const OtherSet & other) const
inlinenodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The shape is in the region when the outer boundary contains it and it never enters a hole interior; touching or running along a hole boundary is allowed, and so is enclosing a hole from outside — that hole's boundary is part of the region, but its interior is not, so a shape that swallows one is not contained.

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ contains() [19/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::contains ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ convexCovering()

template<class PointType_, class TLabel>
std::vector< Convex< PointType_ > > pgl::PolygonWithHoles< PointType_, TLabel >::convexCovering ( ) const
nodiscard

Covers this region with a greedily selected set of convex polygons.

Equivalent to triangulation().convexCovering(), with the same precondition (isValid). Every piece is contained in this region and together they cover closure(interior), so holes remain uncovered and a slit appears in no piece. Unlike convexPartition, piece interiors may overlap. The returned cover is irredundant, not necessarily minimum.

Returns
The convex covering, in canonical order.

◆ convexHull()

template<class PointType_, class TLabel>
Convex< PointType > pgl::PolygonWithHoles< PointType_, TLabel >::convexHull ( ) const
inlinenodiscardconstexpr

Returns the convex hull of the region's vertices.

The holes lie inside the outer boundary, so this is the outer polygon's hull.

◆ convexPartition()

template<class PointType_, class TLabel>
std::vector< Convex< PointType_ > > pgl::PolygonWithHoles< PointType_, TLabel >::convexPartition ( ) const
nodiscard

Cuts this region into convex pieces with disjoint interiors.

Equivalent to triangulation().convexPartition(), with the same precondition (isValid). What the pieces cover is the part of the region that has areaclosure(interior) — so the holes are where there is no piece, and a slit appears in none of them, having no area of its own. That is the one way this differs from Polygon::convexPartition, and it matters to any caller that sweeps the pieces rather than merely measuring them.

There are at most four times as many pieces as the fewest possible; see Triangulation::convexPartition. A hole-free region with a convex outer ring comes back as a single piece.

Returns
The convex pieces, in canonical order.

◆ crosses() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::crosses ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherChain & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherConvex & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherDisk & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherHalfplane & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [6/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherIntersection>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherIntersection & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [7/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherLine & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [8/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherOrientedLine & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [9/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherOrientedSegment & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [10/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherPoint & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [11/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherPolygon & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [12/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherPolyline & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [13/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherRay & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [14/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherRectangle & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherRegion & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherSegment & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [17/19]

template<class PointType_, class TLabel>
template<class OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>)
bool pgl::PolygonWithHoles< PointType_, TLabel >::crosses ( const OtherShape & other) const
inlinenodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const OtherTriangle & other) const
nodiscard

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [19/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::crosses ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ diameter()

template<class PointType_, class TLabel>
Segment< PointType > pgl::PolygonWithHoles< PointType_, TLabel >::diameter ( ) const
inlinenodiscardconstexpr

Returns a segment realizing the diameter (the farthest vertex pair).

The holes lie inside the outer boundary, so they cannot contribute a farther pair: this is the outer polygon's diameter.

◆ difference() [1/17]

template<class PointType_, class TLabel>
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherConvex & other) const

◆ difference() [2/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherConvex & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

◆ difference() [3/17]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherHalfplane & other) const

◆ difference() [4/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherHalfplane & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

A half-plane is the one-constraint half-plane intersection, and is handled as one: see difference(const OtherIntersection&) const, which bounds it against this region before any arrangement is built. Removing a half-plane can leave several pieces and can open a hole out into the rest of the plane, which is why the result is a set of regions rather than one.

◆ difference() [5/17]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherIntersection & other) const

◆ difference() [6/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherIntersection & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

A half-plane intersection may be unbounded, which stops it being a regularizedUnion operand but not a subtrahend: A ∖ B is bounded whenever A is, however far B reaches, so a PolygonSet can hold it. That makes the difference the second operation to take an unbounded operand, after intersection, and the only one where the latitude is one-sided — B ∖ A is unbounded and has no overload, on this or any receiver.

A is bounded, so only the part of B near it can matter: B is first clipped to a box strictly containing the bounding rectangle, which leaves A ∖ B untouched and makes it a convex polygon. The clip's corners are whole numbers in the operand's own coordinate type, so the arrangement stays exact whatever ResultNumber is. A half-plane intersection with empty interior removes nothing from a regularized result, and gives back regularized.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe region to remove; may be unbounded, up to the whole plane.
Returns
The pieces of the difference, in canonical order.

◆ difference() [7/17]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherPolygon & other) const

◆ difference() [8/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherPolygon & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

The result is closure(A° ∖ B): the part of this region with area that survives the removal, as a set of regions with pairwise disjoint interiors whose union is the difference. Lower-dimensional leftovers are dropped, so a slit of this region — which has no area — never reaches the result. See Polygon::difference for the full contract.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to remove.
Returns
The pieces of the difference, in canonical order.

◆ difference() [9/17]

template<class PointType_, class TLabel>
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherRectangle & other) const

◆ difference() [10/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherRectangle & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

◆ difference() [11/17]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherRegion & other) const

◆ difference() [12/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherRegion & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

◆ difference() [13/17]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherSet & other) const

◆ difference() [14/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherSet & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

A difference is not symmetric, so this pair stays here rather than going to the higher-ranked set the way regularizedUnion(const OtherSet&) const does. It costs no more for it: the set goes into the one arrangement whole, exactly as it would have on the other side. See Polygon::difference for the contract.

◆ difference() [15/17]

template<class PointType_, class TLabel>
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherTriangle & other) const

◆ difference() [16/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const OtherTriangle & other) const
nodiscard

Returns the regularized set difference of the two shapes (A ∖ B).

◆ difference() [17/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType_, TLabel >::difference ( const Shape< OtherPoint > & other) const
inlinenodiscard

Returns the regularized set difference of the two shapes (A ∖ B), re-dispatching through the wrapper's own difference.

A difference is not symmetric, so unlike regularizedUnion this cannot be handed to other as it stands. It wraps this shape instead and lets the wrapper visit both sides, which throws if the pair is unsupported — here, whenever other turns out to hold anything without area, or a Disk. An unbounded alternative is fine on this side, the result being contained in this shape either way. See Polygon::difference for the contract.

The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.

◆ distanceL1() [1/17]

template<class PointType, class LabelType>
template<class ResultNumber, MonotoneChainConcept OtherChain>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherChain & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [2/17]

template<class PointType, class LabelType>
template<class ResultNumber, ConvexConcept OtherConvex>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherConvex & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [3/17]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherHalfplane & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [4/17]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherIntersection & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [5/17]

template<class PointType, class LabelType>
template<class ResultNumber, LineConcept OtherLine>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherLine & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [6/17]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherOrientedLine & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [7/17]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedSegmentConcept OtherOrientedSegment>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [8/17]

template<class PointType, class LabelType>
template<class ResultNumber, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherPoint & point) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [9/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolygonConcept OtherPolygon>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherPolygon & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [10/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolylineConcept OtherPolyline>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherPolyline & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [11/17]

template<class PointType, class LabelType>
template<class ResultNumber, RayConcept OtherRay>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherRay & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [12/17]

template<class PointType, class LabelType>
template<class ResultNumber, RectangleConcept OtherRectangle>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherRectangle & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [13/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherRegion & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [14/17]

template<class PointType, class LabelType>
template<class ResultNumber, SegmentConcept OtherSegment>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherSegment & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [15/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const OtherShape& o, const
PolygonWithHoles& self) { o.template distanceL1<ResultNumber>(self); })
auto pgl::PolygonWithHoles< PointType_, TLabel >::distanceL1 ( const OtherShape & other) const
inlinenodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [16/17]

template<class PointType, class LabelType>
template<class ResultNumber, TriangleConcept OtherTriangle>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceL1 ( const OtherTriangle & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceL1() [17/17]

template<class PointType_, class TLabel>
template<class ResultNumber = double, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType_, TLabel >::distanceL1 ( const Shape< OtherPoint > & other) const
inlinenodiscardconstexpr

Returns the Manhattan (L1) distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceL1.

◆ distanceLInf() [1/17]

template<class PointType, class LabelType>
template<class ResultNumber, MonotoneChainConcept OtherChain>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherChain & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [2/17]

template<class PointType, class LabelType>
template<class ResultNumber, ConvexConcept OtherConvex>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherConvex & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [3/17]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherHalfplane & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [4/17]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherIntersection & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [5/17]

template<class PointType, class LabelType>
template<class ResultNumber, LineConcept OtherLine>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherLine & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [6/17]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherOrientedLine & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [7/17]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedSegmentConcept OtherOrientedSegment>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [8/17]

template<class PointType, class LabelType>
template<class ResultNumber, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherPoint & point) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [9/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolygonConcept OtherPolygon>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherPolygon & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [10/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolylineConcept OtherPolyline>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherPolyline & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [11/17]

template<class PointType, class LabelType>
template<class ResultNumber, RayConcept OtherRay>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherRay & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [12/17]

template<class PointType, class LabelType>
template<class ResultNumber, RectangleConcept OtherRectangle>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherRectangle & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [13/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherRegion & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [14/17]

template<class PointType, class LabelType>
template<class ResultNumber, SegmentConcept OtherSegment>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherSegment & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [15/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const OtherShape& o, const
PolygonWithHoles& self) { o.template distanceLInf<ResultNumber>(self); })
auto pgl::PolygonWithHoles< PointType_, TLabel >::distanceLInf ( const OtherShape & other) const
inlinenodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [16/17]

template<class PointType, class LabelType>
template<class ResultNumber, TriangleConcept OtherTriangle>
auto pgl::PolygonWithHoles< PointType, LabelType >::distanceLInf ( const OtherTriangle & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ distanceLInf() [17/17]

template<class PointType_, class TLabel>
template<class ResultNumber = double, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType_, TLabel >::distanceLInf ( const Shape< OtherPoint > & other) const
inlinenodiscardconstexpr

Returns the Chebyshev (L∞) distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceLInf.

◆ edges()

template<class PointType_, class TLabel>
std::vector< EdgeType > pgl::PolygonWithHoles< PointType_, TLabel >::edges ( ) const
inlinenodiscardconstexpr

Returns the boundary edges of every ring, outer boundary first.

◆ empty()

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::empty ( ) const
inlinenodiscardconstexpr

Tests whether the region has no outer boundary at all.

◆ end()

template<class PointType_, class TLabel>
auto pgl::PolygonWithHoles< PointType_, TLabel >::end ( ) const
inlinenodiscardconstexpr

Returns a constant iterator past the last hole.

◆ eraseHole() [1/2]

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::eraseHole ( const PolygonType & hole)
inlineconstexpr

Erases the hole equal to the given polygon, if the region has one.

The holes are sorted, so this finds it by binary search: O(log k) comparisons for k holes, plus the element moves the erase itself costs.

Parameters
holeThe hole to erase.
Returns
true when a hole was erased, false when the region has no hole equal to hole.

◆ eraseHole() [2/2]

template<class PointType_, class TLabel>
void pgl::PolygonWithHoles< PointType_, TLabel >::eraseHole ( std::size_t index)
inlineconstexpr

Erases the hole at the given index.

Filling a hole in is the one edit that needs no revalidation: the holes that remain still lie inside the outer boundary with interiors still pairwise disjoint, and erasing preserves both their sorted order and the absence of zero-area rings, so nothing is renormalized.

Parameters
indexThe index of the hole, in canonical (sorted) order.

◆ fbox()

template<class PointType_, class TLabel>
template<std::floating_point ResultNumber = double>
Rectangle< Point< ResultNumber > > pgl::PolygonWithHoles< PointType_, TLabel >::fbox ( ) const
inlinenodiscardconstexpr

Computes the floating-point bounding box of the region.

◆ hasHoles()

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::hasHoles ( ) const
inlinenodiscardconstexpr

Tests whether the region has at least one hole.

◆ hole()

template<class PointType_, class TLabel>
const PolygonType & pgl::PolygonWithHoles< PointType_, TLabel >::hole ( std::size_t index) const
inlinenodiscardconstexpr

Accesses a hole by index.

Parameters
indexThe index of the hole, in canonical (sorted) order.

◆ holeCount()

template<class PointType_, class TLabel>
std::size_t pgl::PolygonWithHoles< PointType_, TLabel >::holeCount ( ) const
inlinenodiscardconstexpr

Returns the number of holes.

◆ holes()

template<class PointType_, class TLabel>
const std::vector< PolygonType > & pgl::PolygonWithHoles< PointType_, TLabel >::holes ( ) const
inlinenodiscardconstexpr

Returns the holes in canonical order.

◆ interiorContains() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::interiorContains ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherChain & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ interiorContains() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

The region interior is the open outer polygon with every closed hole removed, so the shape must stay strictly inside the outer boundary and miss every hole outright — touching a hole boundary already leaves the interior.

◆ interiorContains() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherDisk & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The disk is in the region when the outer polygon contains it and it never enters a hole interior; a disk tangent to a hole from outside is contained, one that swallows a hole is not.

A degenerate disk goes to the point overload with Disk::a: that is exactly the disk when its radius is zero, and a disk whose defining points are collinear but not all equal is undefined (it determines no circle), so any terminating answer meets the contract. The region cannot leave this to the outer polygon — a point of a hole interior is inside the outer polygon and outside the region.

◆ interiorContains() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

Unbounded, so again only a degenerate operand qualifies.

◆ interiorContains() [6/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherIntersection>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherIntersection & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

Only a bounded operand can lie in the bounded region; the empty region is contained by convention, matching the other shapes.

◆ interiorContains() [7/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

Unbounded, so again only a degenerate operand qualifies.

◆ interiorContains() [8/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

Unbounded, so again only a degenerate operand qualifies.

◆ interiorContains() [9/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

The region interior excludes every ring, so the segment must stay strictly inside the outer polygon and miss every hole entirely — touching a hole boundary already leaves the interior.

◆ interiorContains() [10/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherPoint & point) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

Complexity: O(n) over the total vertex count.

◆ interiorContains() [11/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

The region interior is the open outer polygon with every closed hole removed, so the shape must stay strictly inside the outer boundary and miss every hole outright — touching a hole boundary already leaves the interior.

◆ interiorContains() [12/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ interiorContains() [13/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

Unbounded, so again only a degenerate operand qualifies.

◆ interiorContains() [14/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

The region interior is the open outer polygon with every closed hole removed, so the shape must stay strictly inside the outer boundary and miss every hole outright — touching a hole boundary already leaves the interior.

◆ interiorContains() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

The region interior is the open outer polygon with every closed hole removed, so the shape must stay strictly inside the outer boundary and miss every hole outright — touching a hole boundary already leaves the interior.

◆ interiorContains() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

The region interior excludes every ring, so the segment must stay strictly inside the outer polygon and miss every hole entirely — touching a hole boundary already leaves the interior.

◆ interiorContains() [17/19]

template<class PointType_, class TLabel>
template<PolygonSetConcept OtherSet>
bool pgl::PolygonWithHoles< PointType_, TLabel >::interiorContains ( const OtherSet & other) const
inlinenodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

The region interior is the open outer polygon with every closed hole removed, so the shape must stay strictly inside the outer boundary and miss every hole outright — touching a hole boundary already leaves the interior.

◆ interiorContains() [19/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContains ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContainsInterior()

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorContainsInterior ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the segment's interior.

Every point of the open segment must lie strictly inside the region; either endpoint may lie on an outer or hole boundary. A degenerate segment is accepted exactly when its sole point is contained.

Complexity: O(n log n) over the total vertex count.

◆ interiorsIntersect() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::interiorsIntersect ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

◆ interiorsIntersect() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherChain & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The chain's relative interior is the chain minus its two extreme points, so it reaches the open region when an open edge does or when a vertex between two edges lies strictly inside it. The region interior is open and two-dimensional, which is what lets the shared chain helper answer this: an open edge point that has to be discarded — an extreme the chain passes through again — is surrounded by edge points that do not.

◆ interiorsIntersect() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherConvex & other) const
nodiscard

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

Enclosing a hole does not count, and neither does meeting the region only where two rings touch. When the operand's boundary misses the open region entirely this triangulates, because the open region may come apart into several pieces and no single witness point speaks for all of them.

Complexity, for a region of n vertices and an operand of m: O(n·m) when an edge of the operand settles it, and O(n log n + n·m) for the triangulated fallback. Against another region with holes there is no edge shortcut — a region need not have interior beside its own boundary — and both domains are triangulated and compared triangle by triangle, O(n log n + m log m + n·m).

◆ interiorsIntersect() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherDisk & other) const
nodiscard

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

A disk contributes no edges to scan, so once the cheap witness test fails this triangulates: the domain triangles tile closure(A°), and the open disk meets A° exactly when it meets one of their interiors.

Complexity: O(n log n) for a region of n vertices.

◆ interiorsIntersect() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The open half-plane has to reach the open region. Unlike Polygon, where a vertex strictly inside the half-plane settles it, a ring vertex here can be a place where the region is only one-dimensional (the tip of a slit); such a vertex carries no region interior with it and does not count. See isSolidVertex.

Complexity: O(n) when the region has no ring contacts, O(n³) in the worst case, for a total vertex count of n.

◆ interiorsIntersect() [6/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherIntersection>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherIntersection & other) const
nodiscard

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The operand is clipped to the region's bounding box, which leaves the answer alone — A° is an open subset of that box and therefore misses its boundary — and turns an unbounded operand into a convex polygon the area path already handles.

◆ interiorsIntersect() [7/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherLine & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The line has to reach the open region: crossing a hole, running along a ring, and passing through a point where two rings touch all fail, and a line swallowed by a hole that touches the outer ring twice fails as well.

Complexity: O(n + c²) for a total vertex count of n, where c is the number of boundary crossings the line makes.

◆ interiorsIntersect() [8/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The line has to reach the open region: crossing a hole, running along a ring, and passing through a point where two rings touch all fail, and a line swallowed by a hole that touches the outer ring twice fails as well.

Complexity: O(n + c²) for a total vertex count of n, where c is the number of boundary crossings the line makes.

◆ interiorsIntersect() [9/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The open segment must reach the open region: crossing a bridge between two holes counts, running along a ring does not, and neither does passing through a point where two rings touch — the region pinches shut there.

Complexity: O(n + c²) for a total vertex count of n, where c is the number of boundary crossings the segment makes (typically a small constant).

◆ interiorsIntersect() [10/19]

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::interiorsIntersect ( const OtherPoint & ) const
inlinenodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

A point has empty interior, so this is always false, matching Polygon.

◆ interiorsIntersect() [11/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherPolygon & other) const
nodiscard

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

Enclosing a hole does not count, and neither does meeting the region only where two rings touch. When the operand's boundary misses the open region entirely this triangulates, because the open region may come apart into several pieces and no single witness point speaks for all of them.

Complexity, for a region of n vertices and an operand of m: O(n·m) when an edge of the operand settles it, and O(n log n + n·m) for the triangulated fallback. Against another region with holes there is no edge shortcut — a region need not have interior beside its own boundary — and both domains are triangulated and compared triangle by triangle, O(n log n + m log m + n·m).

◆ interiorsIntersect() [12/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The chain's relative interior is the chain minus its two extreme points, so it reaches the open region when an open edge does or when a vertex between two edges lies strictly inside it. The region interior is open and two-dimensional, which is what lets the shared chain helper answer this: an open edge point that has to be discarded — an extreme the chain passes through again — is surrounded by edge points that do not.

◆ interiorsIntersect() [13/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherRay & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The line has to reach the open region: crossing a hole, running along a ring, and passing through a point where two rings touch all fail, and a line swallowed by a hole that touches the outer ring twice fails as well.

Complexity: O(n + c²) for a total vertex count of n, where c is the number of boundary crossings the line makes.

◆ interiorsIntersect() [14/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherRectangle & other) const
nodiscard

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

Enclosing a hole does not count, and neither does meeting the region only where two rings touch. When the operand's boundary misses the open region entirely this triangulates, because the open region may come apart into several pieces and no single witness point speaks for all of them.

Complexity, for a region of n vertices and an operand of m: O(n·m) when an edge of the operand settles it, and O(n log n + n·m) for the triangulated fallback. Against another region with holes there is no edge shortcut — a region need not have interior beside its own boundary — and both domains are triangulated and compared triangle by triangle, O(n log n + m log m + n·m).

◆ interiorsIntersect() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherRegion & other) const
nodiscard

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

Enclosing a hole does not count, and neither does meeting the region only where two rings touch. When the operand's boundary misses the open region entirely this triangulates, because the open region may come apart into several pieces and no single witness point speaks for all of them.

Complexity, for a region of n vertices and an operand of m: O(n·m) when an edge of the operand settles it, and O(n log n + n·m) for the triangulated fallback. Against another region with holes there is no edge shortcut — a region need not have interior beside its own boundary — and both domains are triangulated and compared triangle by triangle, O(n log n + m log m + n·m).

◆ interiorsIntersect() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

The open segment must reach the open region: crossing a bridge between two holes counts, running along a ring does not, and neither does passing through a point where two rings touch — the region pinches shut there.

Complexity: O(n + c²) for a total vertex count of n, where c is the number of boundary crossings the segment makes (typically a small constant).

◆ interiorsIntersect() [17/19]

template<class PointType_, class TLabel>
template<class OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>)
bool pgl::PolygonWithHoles< PointType_, TLabel >::interiorsIntersect ( const OtherShape & other) const
inlinenodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

Forwards to the other shape's implementation so that each unordered pair needs interiorsIntersect defined only once, on the higher-ranked shape.

◆ interiorsIntersect() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const OtherTriangle & other) const
nodiscard

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

Enclosing a hole does not count, and neither does meeting the region only where two rings touch. When the operand's boundary misses the open region entirely this triangulates, because the open region may come apart into several pieces and no single witness point speaks for all of them.

Complexity, for a region of n vertices and an operand of m: O(n·m) when an edge of the operand settles it, and O(n log n + n·m) for the triangulated fallback. Against another region with holes there is no edge shortcut — a region need not have interior beside its own boundary — and both domains are triangulated and compared triangle by triangle, O(n log n + m log m + n·m).

◆ interiorsIntersect() [19/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::interiorsIntersect ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).

◆ intersection() [1/31]

template<class PointType_, class TLabel>
template<class ResultNumber = NumberType, class EmptyPoint>
EmptyShape< EmptyPoint > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

◆ intersection() [2/31]

template<class PointType_, class TLabel>
template<class ResultNumber, MonotoneChainConcept OtherChain>
auto pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherChain & other) const
nodiscardconstexpr

Returns the intersection with a monotone chain (A ∩ B), a sequence of points and segments sorted by lexicographic order.

Same contract as intersection(const OtherPolyline&) const: the region outranks a chain, so it owns the pair, and the chain first views itself as a polyline.

Template Parameters
ResultNumberNumber type of the returned coordinates.
Parameters
otherThe chain to clip.
Returns
Vector of points and segments forming the intersection.
Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [3/31]

template<class PointType_, class TLabel>
template<class ResultNumber, ConvexConcept OtherConvex>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherConvex & other) const

◆ intersection() [4/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherConvex & other) const
nodiscard

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

The literal point set A ∩ B, as its connected pieces: the regions regularizedIntersection(const OtherPolygon&) const returns, plus the lower-dimensional material that one drops — a stretch of shared boundary with no area on either side of it, and an isolated point where the two boundaries only touch. An empty vector means the two are disjoint.

This is Polygon::intersection(const OtherPolygon&) const one dimension up in its operands, and its area pieces are regions rather than polygons for the reason given there: a component of A ∩ B gains a hole exactly when an operand has one. A strand of boundary hanging off an area piece is a piece of its own, as it is for two polygons, and a strand that closes up on itself comes back as a polyline repeating its first vertex last.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to intersect with.
Returns
The pieces of the intersection: isolated points first, then strands, then the areas in canonical order.
Note
The arrangement is built over exact rationals whatever ResultNumber is, and converted only at the end. This is what Polygon::intersection(const OtherPolygon&) const does not do: it computes in the result type, so an integral one truncates every crossing.

◆ intersection() [5/31]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherHalfplane & other) const

◆ intersection() [6/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherHalfplane & other) const
nodiscard

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

A half-plane is the one-constraint half-plane intersection, and is handled as one: see intersection(const OtherIntersection&) const.

◆ intersection() [7/31]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherIntersection & other) const

◆ intersection() [8/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherIntersection & other) const
nodiscard

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

A half-plane intersection may be unbounded, but this region is not, so only the part of it near this region matters: it is first clipped to a box strictly containing the bounding rectangle, which leaves A ∩ B untouched and makes it a convex polygon. Unlike regularizedIntersection(const OtherIntersection&) const, a clip with empty interior is not the end of it — the region can still meet the carrier it collapsed to in points and segments, and those are pieces of this answer. See intersection(const OtherPolygon&) const for the contract of the result.

◆ intersection() [9/31]

template<class PointType_, class TLabel>
template<class ResultNumber, LineConcept OtherLine>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherLine & other) const
constexpr

◆ intersection() [10/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherLine & other) const
nodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

A region is bounded, so every piece is bounded even though the line is not: intersection(const OtherSegment&) const without the clip to a finite parameter window. The pieces come in order along the line.

Template Parameters
ResultNumberNumber type of the returned coordinates.
Parameters
otherThe line to clip.
Returns
The disjoint intersection pieces in order along the line.
Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [11/31]

template<class PointType_, class TLabel>
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherOrientedLine & other) const
constexpr

◆ intersection() [12/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherOrientedLine & other) const
nodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

An orientation is not part of a point set, so this is the intersection with the underlying line; see intersection(const OtherLine&) const.

◆ intersection() [13/31]

template<class PointType_, class TLabel>
template<class ResultNumber, OrientedSegmentConcept OtherOrientedSegment>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherOrientedSegment & other) const
constexpr

◆ intersection() [14/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

An orientation is not part of a point set, so this is the intersection with the underlying segment; see intersection(const OtherSegment&) const.

◆ intersection() [15/31]

template<class PointType_, class TLabel>
template<class ResultNumber, PointConcept OtherPoint>
std::optional< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherPoint & other) const
constexpr

◆ intersection() [16/31]

template<class PointType_, class TLabel>
template<class ResultNumber = NumberType, PointConcept OtherPoint>
std::optional< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherPoint & other) const
nodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

The region is closed, so a point on a ring — the outer boundary or a hole's — intersects it.

◆ intersection() [17/31]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonConcept OtherPolygon>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherPolygon & other) const

◆ intersection() [18/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherPolygon & other) const
nodiscard

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

The literal point set A ∩ B, as its connected pieces: the regions regularizedIntersection(const OtherPolygon&) const returns, plus the lower-dimensional material that one drops — a stretch of shared boundary with no area on either side of it, and an isolated point where the two boundaries only touch. An empty vector means the two are disjoint.

This is Polygon::intersection(const OtherPolygon&) const one dimension up in its operands, and its area pieces are regions rather than polygons for the reason given there: a component of A ∩ B gains a hole exactly when an operand has one. A strand of boundary hanging off an area piece is a piece of its own, as it is for two polygons, and a strand that closes up on itself comes back as a polyline repeating its first vertex last.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to intersect with.
Returns
The pieces of the intersection: isolated points first, then strands, then the areas in canonical order.
Note
The arrangement is built over exact rationals whatever ResultNumber is, and converted only at the end. This is what Polygon::intersection(const OtherPolygon&) const does not do: it computes in the result type, so an integral one truncates every crossing.

◆ intersection() [19/31]

template<class PointType_, class TLabel>
template<class ResultNumber, PolylineConcept OtherPolyline>
auto pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherPolyline & other) const
nodiscardconstexpr

Returns the intersection with an open polyline (A ∩ B), a sequence of points and segments sorted by lexicographic order.

A polyline is one-dimensional, so the intersection with this region's closed point set is too. Each polyline edge is clipped against the region and the pieces are coalesced; they carry the polyline's label, matching polyline.intersection(region), which forwards here.

Complexity: O(m n log n) for a polyline with m vertices and a region with n vertices over all rings, plus coalescing the resulting pieces.

Template Parameters
ResultNumberNumber type of the returned coordinates.
Parameters
otherThe polyline to clip.
Returns
Vector of points and segments forming the intersection.
Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [20/31]

template<class PointType_, class TLabel>
template<class ResultNumber, RayConcept OtherRay>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherRay & other) const
constexpr

◆ intersection() [21/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherRay & other) const
nodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

intersection(const OtherLine&) const clipped to the ray's half-line; the pieces come in order from the source outward.

Template Parameters
ResultNumberNumber type of the returned coordinates.
Parameters
otherThe ray to clip.
Returns
The disjoint intersection pieces in order from the source outward.
Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [22/31]

template<class PointType_, class TLabel>
template<class ResultNumber, RectangleConcept OtherRectangle>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherRectangle & other) const

◆ intersection() [23/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherRectangle & other) const
nodiscard

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

The literal point set A ∩ B, as its connected pieces: the regions regularizedIntersection(const OtherPolygon&) const returns, plus the lower-dimensional material that one drops — a stretch of shared boundary with no area on either side of it, and an isolated point where the two boundaries only touch. An empty vector means the two are disjoint.

This is Polygon::intersection(const OtherPolygon&) const one dimension up in its operands, and its area pieces are regions rather than polygons for the reason given there: a component of A ∩ B gains a hole exactly when an operand has one. A strand of boundary hanging off an area piece is a piece of its own, as it is for two polygons, and a strand that closes up on itself comes back as a polyline repeating its first vertex last.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to intersect with.
Returns
The pieces of the intersection: isolated points first, then strands, then the areas in canonical order.
Note
The arrangement is built over exact rationals whatever ResultNumber is, and converted only at the end. This is what Polygon::intersection(const OtherPolygon&) const does not do: it computes in the result type, so an integral one truncates every crossing.

◆ intersection() [24/31]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherRegion & other) const

◆ intersection() [25/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherRegion & other) const
nodiscard

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

The literal point set A ∩ B, as its connected pieces: the regions regularizedIntersection(const OtherPolygon&) const returns, plus the lower-dimensional material that one drops — a stretch of shared boundary with no area on either side of it, and an isolated point where the two boundaries only touch. An empty vector means the two are disjoint.

This is Polygon::intersection(const OtherPolygon&) const one dimension up in its operands, and its area pieces are regions rather than polygons for the reason given there: a component of A ∩ B gains a hole exactly when an operand has one. A strand of boundary hanging off an area piece is a piece of its own, as it is for two polygons, and a strand that closes up on itself comes back as a polyline repeating its first vertex last.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to intersect with.
Returns
The pieces of the intersection: isolated points first, then strands, then the areas in canonical order.
Note
The arrangement is built over exact rationals whatever ResultNumber is, and converted only at the end. This is what Polygon::intersection(const OtherPolygon&) const does not do: it computes in the result type, so an integral one truncates every crossing.

◆ intersection() [26/31]

template<class PointType_, class TLabel>
template<class ResultNumber, SegmentConcept OtherSegment>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Segment< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherSegment & other) const
constexpr

◆ intersection() [27/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherSegment & other) const
nodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

A region is neither convex nor simply connected, so its closed point set meets a segment in several disjoint pieces in general, each of them a point (a boundary touch) or a segment. The pieces are maximal and come in order along the segment; an empty vector means the two are disjoint.

The clip is the one Polygon::intersection(const OtherSegment&) const performs, run over every ring at once rather than over the single boundary: a point is in the region exactly when it is enclosed by an odd number of rings, so a hole — enclosing along with the outer boundary — takes its interior back out. Rings themselves always survive, hole rings included, so a segment running along a hole's edge or through a slit comes back whole.

Complexity: O(n log n) for n vertices over all rings.

Template Parameters
ResultNumberNumber type of the returned coordinates.
Parameters
otherThe segment to clip.
Returns
The disjoint intersection pieces in order along the segment.
Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [28/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires (!PointConcept<OtherShape> && (detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const
OtherShape& o, const PolygonWithHoles& self) { o.template intersection<ResultNumber>(self); })
auto pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherShape & other) const
inlinenodiscard

Forwards an intersection to the higher-ranked shape.

◆ intersection() [29/31]

template<class PointType_, class TLabel>
template<class ResultNumber, TriangleConcept OtherTriangle>
std::vector< std::variant< Point< ResultNumber, typename PointType_::LabelType >, Polyline< Point< ResultNumber, typename PointType_::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherTriangle & other) const

◆ intersection() [30/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > > > pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const OtherTriangle & other) const
nodiscard

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

The literal point set A ∩ B, as its connected pieces: the regions regularizedIntersection(const OtherPolygon&) const returns, plus the lower-dimensional material that one drops — a stretch of shared boundary with no area on either side of it, and an isolated point where the two boundaries only touch. An empty vector means the two are disjoint.

This is Polygon::intersection(const OtherPolygon&) const one dimension up in its operands, and its area pieces are regions rather than polygons for the reason given there: a component of A ∩ B gains a hole exactly when an operand has one. A strand of boundary hanging off an area piece is a piece of its own, as it is for two polygons, and a strand that closes up on itself comes back as a polyline repeating its first vertex last.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to intersect with.
Returns
The pieces of the intersection: isolated points first, then strands, then the areas in canonical order.
Note
The arrangement is built over exact rationals whatever ResultNumber is, and converted only at the end. This is what Polygon::intersection(const OtherPolygon&) const does not do: it computes in the result type, so an integral one truncates every crossing.

◆ intersection() [31/31]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType_, TLabel >::intersection ( const Shape< OtherPoint > & other) const
inlinenodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), re-dispatching through the wrapper's own intersection.

An intersection is symmetric, so this just calls other's own intersection, which visits its wrapped alternative and throws if the pair is unsupported.

The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.

Returns
The intersection wrapped in a Shape, rather than the tighter type the concrete pair would answer with: which alternative other holds is not known until run time, so neither is the result's.

◆ intersects() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::intersects ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherChain & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ intersects() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ intersects() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherDisk & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The disk is in the region when the outer polygon contains it and it never enters a hole interior; a disk tangent to a hole from outside is contained, one that swallows a hole is not.

A degenerate disk goes to the point overload with Disk::a: that is exactly the disk when its radius is zero, and a disk whose defining points are collinear but not all equal is undefined (it determines no circle), so any terminating answer meets the contract. The region cannot leave this to the outer polygon — a point of a hole interior is inside the outer polygon and outside the region.

◆ intersects() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n) over the total vertex count.

◆ intersects() [6/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherIntersection>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherIntersection & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

Only a bounded operand can lie in the bounded region; the empty region is contained by convention, matching the other shapes.

◆ intersects() [7/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n) over the total vertex count.

◆ intersects() [8/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n) over the total vertex count.

◆ intersects() [9/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n) segment-segment tests over the total vertex count.

◆ intersects() [10/19]

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::intersects ( const OtherPoint & point) const
inlinenodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n) over the total vertex count.

◆ intersects() [11/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ intersects() [12/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

The chain is exactly the union of its edges, so it is in the region when every edge is; an empty chain is contained trivially.

Complexity: O(n·m) for a region of n vertices and a chain of m.

◆ intersects() [13/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n) over the total vertex count.

◆ intersects() [14/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ intersects() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ intersects() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n) segment-segment tests over the total vertex count.

◆ intersects() [17/19]

template<class PointType_, class TLabel>
template<class OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>)
bool pgl::PolygonWithHoles< PointType_, TLabel >::intersects ( const OtherShape & other) const
inlinenodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Forwards to the other shape's implementation so that each unordered pair needs intersects defined only once, on the higher-ranked shape.

◆ intersects() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

Complexity: O(n·m) for a region of n vertices and an operand of m.

◆ intersects() [19/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::intersects ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ isDegenerate()

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::isDegenerate ( ) const
inlinenodiscardconstexpr

Tests whether the region has zero area.

The sum is taken in the promoted type: narrowed to NumberType it wraps to zero for a region larger than the coordinate range and reports an ordinary region as degenerate.

◆ isPoint()

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::isPoint ( ) const
inlinenodiscardconstexpr

Tests whether the region covers exactly one point.

Zero-area holes are dropped at construction, so this is decided by the outer boundary alone.

◆ isRegular()

template<class PointType_, class LabelType>
bool pgl::PolygonWithHoles< PointType_, LabelType >::isRegular ( ) const
nodiscard

Tests whether the region is the closure of its own interior (A = closure(A°)).

A valid region is allowed to pinch shut where two rings run along one another — a slit: region material with no area on either side of it, as when a hole shares a stretch of edge with another hole or with the outer boundary. A slit belongs to A and not to closure(A°), so it is exactly what this rules out: a region with area is regular when it has no slit, and regularized removes them.

Pinching at an isolated point is not a slit — the interior still reaches the point from every side of it — so a region whose rings meet only at vertices is regular.

The empty region is regular (∅ = closure(∅°)); any other region without area is not, being material whose interior is empty.

The region must satisfy isValid.

Complexity: O(n²) over the total vertex count.

◆ isSegment()

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::isSegment ( ) const
inlinenodiscardconstexpr

Tests whether the region covers exactly one segment of positive length.

◆ isSimple()

template<class PointType_, class TLabel>
template<class Rational = pgl::Rational<pgl::BigInt>>
bool pgl::PolygonWithHoles< PointType_, TLabel >::isSimple ( ) const
inlinenodiscard

Tests whether every ring is simple.

This is a per-ring check only; it says nothing about how the rings sit relative to one another. Use isValid for the structural contract.

Complexity: O(n log n) over the total vertex count.

◆ isUndefined()

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::isUndefined ( ) const
inlinenodiscardconstexpr

Tests whether the region is degenerate without covering a point or a segment (which includes the empty region).

◆ isValid()

template<class PointType_, class LabelType>
template<class Rational>
bool pgl::PolygonWithHoles< PointType_, LabelType >::isValid ( ) const
nodiscard

Tests the structural contract: every ring simple, every hole inside the outer boundary, hole interiors pairwise disjoint.

Ring boundaries may meet one another however they like — at isolated points or along shared stretches of edge; only interiors are constrained. What is rejected is one hole overlapping another, a hole escaping the outer boundary, and any self-intersecting ring.

This is a precondition of every other operation, checked on demand rather than enforced by the constructor — mirroring Polygon, which likewise leaves simplicity to the caller.

Complexity: O(n log n) over the total vertex count, plus one containment test per hole and one interior-overlap test per bounding-box-overlapping hole pair.

◆ label()

template<class PointType_, class TLabel>
template<class A = LabelType>
requires (detail::has_label_v<A>)
A & pgl::PolygonWithHoles< PointType_, TLabel >::label ( ) const
inlineconstexpr

Returns the region label.

The label is mutable even through a const region: it is metadata that does not participate in equality, hashing, or geometric predicates.

Returns
Reference to the stored label.

◆ latticePoints()

template<class PointType, class LabelType>
requires (detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
template<class ResultNumber>
requires (detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
std::vector< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType, LabelType >::latticePoints ( ) const
nodiscard

Returns the integer points the region contains.

The boundary included: a point on an edge is a point of the shape. The boundary answers for its own points, edge by edge as segments, and a sweep over the columns of the bounding box answers for the rest, so the cost is one pass over the edges plus one point per point reported. A hole is not part of the region, and neither are the points inside one; the points on a hole's boundary are, as any boundary point is.

Template Parameters
ResultNumberInteger coordinate type of the points: the shape's own coordinate type when that is a signed integer, the integer a pgl::Rational is built on, and int64_t for anything else.
Returns
The lattice points, in increasing order, carrying no label.
Exceptions
std::logic_errorIf a coordinate is not finite, or a lattice point of the shape does not fit ResultNumber.
std::length_errorIf there are more of them than a vector holds.

◆ minkowskiErosion() [1/2]

template<class PointType_, class TLabel>
requires (!MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape> && BoundedPolygonalConcept<OtherShape>)
template<class ResultNumber, class OtherShape>
requires (!MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape> && BoundedPolygonalConcept<OtherShape>)
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiErosion ( const OtherShape & other) const
nodiscard

Returns the regularized Minkowski erosion of this shape by a bounded polygonal one (A ⊖ B), as a set of regions.

The pairs MinkowskiSummableConcept turns away, which for this receiver is every bounded operand: the erosion of a shape that is not convex is no more convex than it was, and it is not even connected – a dumbbell eroded by anything wider than its handle is two regions, for operands that are in no way degenerate. That is why this returns a PolygonSet where minkowskiSum returns one PolygonWithHoles, and the difference is structural rather than a missing guarantee.

The result is regularized, closure((A ⊖ B)°), as the sum and the boolean operations are: an erosion produces thin material readily – a corridor exactly as wide as the operand erodes to a curve – and a set of regions holds none of it. A receiver with no area erodes to the empty set for the same reason.

A convex receiver is answered by its own constraints in O(a·b); everything else pays for a complement, a sum and a difference. See implementation/minkowskierosion.hpp for both constructions and their cost.

Template Parameters
ResultNumberCoordinate type of the result.
OtherShapeType of the shape to erode by.
Parameters
otherShape to erode by.
Returns
The erosion, as a PolygonSet.
Exceptions
std::logic_errorwhen other covers no point: that erosion is the whole plane, which no set of bounded regions represents.

◆ minkowskiErosion() [2/2]

template<class PointType, class LabelType>
requires MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
template<class OtherShape>
requires MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
auto pgl::PolygonWithHoles< PointType, LabelType >::minkowskiErosion ( const OtherShape & other) const
nodiscardconstexpr

Returns the Minkowski erosion of this shape by another (A ⊖ B).

The erosion is the point set {x : x ⊕ B ⊆ A}, the translations of other that keep it inside this shape – equivalently ⋂ {A - b : b ∈ B}. It is the morphological dual of minkowskiSum and is defined for the same pairs, but it is not commutative.

Eroding by a Point is the translation by its negation, so it returns this shape's own type; the other pairs come back as the convex region they are, a HalfplaneIntersection, which holds a lower-dimensional erosion and the empty one as readily as a two-dimensional one. A region eroded by a bounded operand needs a PolygonSet, since an erosion can disconnect what it shrinks.

Eroding by a shape that covers no point is the whole plane, which a HalfplaneIntersection returns and the tighter result types cannot.

Template Parameters
OtherShapeType of the shape to erode by.
Parameters
otherShape to erode by.
Returns
The erosion, in the tightest type that represents it.

◆ minkowskiSum() [1/21]

template<class PointType_, class TLabel>
template<class ResultNumber, MonotoneChainConcept OtherChain>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherChain & other) const

◆ minkowskiSum() [2/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherChain & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

A MonotoneChain summand is a polyline that happens to be sorted, and it sums here exactly as one: its monotonicity is what makes MonotoneChain::minkowskiSum(const OtherConvex&) const one polygon, and a non-convex receiver takes that away again — this region's own concavity can strand a cavity whatever the chain does. So the chain contributes its edges and the answer is a set of regions, as it is for a Polyline.

◆ minkowskiSum() [3/21]

template<class PointType_, class TLabel>
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherConvex & other) const

◆ minkowskiSum() [4/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherConvex & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

◆ minkowskiSum() [5/21]

template<class PointType_, class TLabel>
template<class ResultNumber, OrientedSegmentConcept OtherOriented>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherOriented & other) const

◆ minkowskiSum() [6/21]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherPolygon & other) const

◆ minkowskiSum() [7/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherPolygon & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

The sum is {p + q : p ∈ A, q ∈ B}, regularized to closure((A ⊕ B)°) and returned as a region with holes. See Polygon::minkowskiSum for the full contract.

A region operand needs one thing a polygon does not: its slits sweep out area just as its triangles do, so they join the convex decomposition the sum is built from. Its holes need no special handling at all — they are simply where the decomposition has no piece.

The precondition a polygon receiver states as nondegenerate is a little more than that here, and for the same reason: this region must be a body, the closure of a connected non-empty interior. A region with no area is not one, and neither is one whose slits cut its interior in two — [0,8]² ∖ (0,4)² written with a hole sharing two of the outer ring's edges is the plainest example. Either way the sum can fall into several pieces and one of them is what comes back. A nondegenerate operand satisfies the precondition on its own, whatever this region is: one body on either side is all the single-region argument needs.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to sum with.
Returns
The sum, as one region.
Precondition
This region or the operand is a body.

◆ minkowskiSum() [8/21]

template<class PointType_, class TLabel>
template<class ResultNumber, PolylineConcept OtherPolyline>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherPolyline & other) const

◆ minkowskiSum() [9/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherPolyline & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

A Polyline summand has no area, but this region sweeps along it all the same, so the sum is a region like every other one here. This is the mirror of Polyline::minkowskiSum(const OtherRegion&) const and gives the same answer: which operand is written first never decides which sum answers.

◆ minkowskiSum() [10/21]

template<class PointType_, class TLabel>
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherRectangle & other) const

◆ minkowskiSum() [11/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherRectangle & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

◆ minkowskiSum() [12/21]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherRegion & other) const

◆ minkowskiSum() [13/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherRegion & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

◆ minkowskiSum() [14/21]

template<class PointType_, class TLabel>
template<class ResultNumber, SegmentConcept OtherSegment>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherSegment & other) const

◆ minkowskiSum() [15/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherSegment>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherSegment & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

An orientation is not part of a point set, so this is the sum with the underlying segment, vertex for vertex.

◆ minkowskiSum() [16/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherSegment & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

A segment has no area of its own and still needs a region here: the sweep of this region along one both closes cuts and erodes holes, exactly as a summand with area does. See Polygon::minkowskiSum(const OtherSegment&) const.

The region's slits sweep out area along the segment like its triangles do, so they are part of the decomposition — unless the slit runs along the segment's own direction, in which case that sweep is a segment and the regularization drops it.

◆ minkowskiSum() [17/21]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherSet & other) const

◆ minkowskiSum() [18/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherSet & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B), as a set of regions.

A PolygonSet operand is the one whose answer needs a set whatever the other operand is: its components are disjoint, and a sum small relative to the gaps between them leaves them so. The set outranks every shape here and owns the pair, so this is the mirror spelling of PolygonSet::minkowskiSum, and the same call.

◆ minkowskiSum() [19/21]

template<class PointType, class LabelType>
requires MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
template<class OtherShape>
requires MinkowskiSummableConcept<PolygonWithHoles<PointType_, TLabel>, OtherShape>
auto pgl::PolygonWithHoles< PointType, LabelType >::minkowskiSum ( const OtherShape & other) const
nodiscardconstexpr

Returns the Minkowski sum of this shape and another (A ⊕ B).

The sum is the point set {a + b : a ∈ A, b ∈ B}. Summing with a Point is a translation, so it gives back a region rather than the set of them the overloads above return, over the promoted coordinate type — this is the reading region + point has always had. A region is not convex, so MinkowskiSummableConcept admits nothing else here: every operand with area is one of the region-valued overloads above.

Template Parameters
OtherShapeType of the other shape.
Parameters
otherShape to sum with.
Returns
The Minkowski sum, in the tightest type that represents it.

◆ minkowskiSum() [20/21]

template<class PointType_, class TLabel>
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherTriangle & other) const

◆ minkowskiSum() [21/21]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonWithHoles< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum ( const OtherTriangle & other) const
nodiscard

Returns the regularized Minkowski sum of the two shapes (A ⊕ B).

◆ operator*=()

template<class PointType_, class TLabel>
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
PolygonWithHoles & pgl::PolygonWithHoles< PointType_, TLabel >::operator*= ( const Scalar & scalar)
inlineconstexpr

Scales the region in place.

A negative factor reflects the rings, which reverses their orientation and can change their relative order, so the holes are re-sorted.

◆ operator+=()

template<class PointType_, class TLabel>
template<class TranslationNumber, class TranslationLabel>
PolygonWithHoles & pgl::PolygonWithHoles< PointType_, TLabel >::operator+= ( const Point< TranslationNumber, TranslationLabel > & translation)
inlineconstexpr

Translates the region in place.

◆ operator-=()

template<class PointType_, class TLabel>
template<class TranslationNumber, class TranslationLabel>
PolygonWithHoles & pgl::PolygonWithHoles< PointType_, TLabel >::operator-= ( const Point< TranslationNumber, TranslationLabel > & translation)
inlineconstexpr

Translates the region in place by the opposite vector.

◆ operator/=()

template<class PointType_, class TLabel>
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
PolygonWithHoles & pgl::PolygonWithHoles< PointType_, TLabel >::operator/= ( const Scalar & scalar)
inlineconstexpr

Scales the region in place.

A negative factor reflects the rings, which reverses their orientation and can change their relative order, so the holes are re-sorted.

◆ operator<=>()

template<class PointType_, class TLabel>
auto pgl::PolygonWithHoles< PointType_, TLabel >::operator<=> ( const PolygonWithHoles< PointType_, TLabel > & other) const
inlinenodiscardconstexpr

Compares two regions by outer boundary, then by canonical hole list.

◆ operator==()

template<class PointType_, class TLabel>
bool pgl::PolygonWithHoles< PointType_, TLabel >::operator== ( const PolygonWithHoles< PointType_, TLabel > & other) const
inlinenodiscardconstexpr

Checks equality of two regions.

◆ orientedEdges()

template<class PointType_, class TLabel>
std::vector< OrientedSegment< PointType > > pgl::PolygonWithHoles< PointType_, TLabel >::orientedEdges ( ) const
inlinenodiscardconstexpr

Returns the boundary edges directed so the region lies to the left.

The outer ring is emitted counterclockwise as stored; hole rings are emitted reversed, i.e. clockwise, which is the standard traversal orientation for a holed region.

◆ outer()

template<class PointType_, class TLabel>
const PolygonType & pgl::PolygonWithHoles< PointType_, TLabel >::outer ( ) const
inlinenodiscardconstexpr

Returns the outer boundary.

◆ pointInside()

template<class PointType_, class TLabel>
template<class ResultNumber>
Point< ResultNumber > pgl::PolygonWithHoles< PointType_, TLabel >::pointInside ( ) const
nodiscard

Returns a point strictly inside the region.

The point is in the region's interior, so it is inside the outer boundary and outside every hole. It first tries Polygon's O(n) ear/diagonal witness for the outer ring. If that witness lies in or on a hole, an ear can be occupied by it or a diagonal interrupted by it, so this triangulates and takes a point inside the first triangle of the domain.

Complexity: O(n) when the outer-ring witness succeeds; O(n log n) over the total vertex count otherwise.

Template Parameters
ResultNumberThe number type for the result.
Returns
A point guaranteed to be inside the region.
Warning
Divides coordinates by 4 (see Triangle::pointInside), so it is inexact for integer coordinates not divisible by it. Undefined for a region with no area.

◆ pointInsideInteriorContainedIn()

template<class PointType_, class TLabel>
template<class OtherShape>
bool pgl::PolygonWithHoles< PointType_, TLabel >::pointInsideInteriorContainedIn ( const OtherShape & shape) const
nodiscard

Tests whether some point in this shape's relative interior lies in the strict interior of shape.

Uses pointInside as the witness. When integer truncation rounds that witness onto or outside the boundary, this shape and shape are scaled so the witness is exact, leaving the containment relation unchanged.

◆ reducedVisibilityGraph()

template<class PointType_, class LabelType>
Graph< PointType_ > pgl::PolygonWithHoles< PointType_, LabelType >::reducedVisibilityGraph ( ) const
nodiscard

Returns the reduced visibility graph of the region's vertices.

The subgraph of visibilityGraph holding the edges a shortest path through the region can bend along: those tangent to the boundary at both ends, meaning the two ring edges meeting at each endpoint lie in one closed half-plane of the connecting line. Every ring edge survives, and among the rest only the bitangents, so this is far sparser than visibilityGraph.

This graph alone does not answer shortest-path queries: it guarantees only the interior of a geodesic, and a path bends at neither of its own endpoints, so its first and last hop may have been pruned. To route between two points, add each joined to everything it sees, taken from visibilityGraph. See Triangulation::reducedVisibilityGraph.

Returns
An undirected graph whose vertices are this region's vertices.

◆ regularized() [1/2]

template<class PointType_, class TLabel>
template<class ResultNumber>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularized ( ) const

◆ regularized() [2/2]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularized ( ) const
nodiscard

Returns the region without its slits (closure(A°)), as a set of regions.

This is the regularization every boolean operation applies to its own result, offered on its own: the material of the region that has area beside it, with the slits isRegular reports dropped. Dropping them can disconnect what they were holding together, which is why the result is a set of regions rather than one — a region whose slits are its only connective tissue comes back as several pieces, and one without area at all comes back empty.

A region that is already regular is returned unchanged, vertex for vertex. The pieces of one that is not are read off an arrangement of its boundary, which drops vertices that no longer sit at a corner.

The region must satisfy isValid.

Complexity: O(n²) for the isRegular test, plus the arrangement when that test fails.

Template Parameters
ResultNumberThe number type for the result.
Returns
The pieces of closure(A°), in canonical order.

◆ regularizedIntersection() [1/16]

template<class PointType_, class TLabel>
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherConvex & other) const

◆ regularizedIntersection() [2/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherConvex & other) const
nodiscard

Returns the regularized intersection of the two shapes (A ∩ B).

◆ regularizedIntersection() [3/16]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherHalfplane & other) const

◆ regularizedIntersection() [4/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherHalfplane & other) const
nodiscard

Returns the regularized intersection of the two shapes (A ∩ B).

A half-plane is the one-constraint half-plane intersection, and is handled as one: see regularizedIntersection(const OtherIntersection&) const, which bounds it against this region before any arrangement is built. Cutting a region with a half-plane can leave several pieces and can open a hole out into the rest of the plane, which is why the result is a set of regions rather than one.

This is the region-valued regularizedIntersection, so it answers halfplane.regularizedIntersection(region) too — the half-plane's own component-valued overloads stop at Polygon.

◆ regularizedIntersection() [5/16]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherIntersection & other) const

◆ regularizedIntersection() [6/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherIntersection & other) const
nodiscard

Returns the regularized intersection of the two shapes (A ∩ B).

A half-plane intersection may be unbounded, but this region is not, so only the part of it near this region matters: it is first clipped to a box strictly containing the bounding rectangle, which leaves A ∩ B untouched and makes it a convex polygon. A half-plane intersection with empty interior contributes nothing to a regularized result.

This is the region-valued regularizedIntersection, so it answers intersection.regularizedIntersection(region) too — see regularizedIntersection(const OtherPolygon&) const. The clip's corners are whole numbers in the operand's own coordinate type, so the arrangement stays exact whatever ResultNumber is.

◆ regularizedIntersection() [7/16]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherPolygon & other) const

◆ regularizedIntersection() [8/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherPolygon & other) const
nodiscard

Returns the regularized intersection of the two shapes (A ∩ B).

The result is closure(A° ∩ B°), as a set of regions with pairwise disjoint interiors: the part both operands cover, with lower-dimensional leftovers dropped.

This is the one boolean operation Polygon does not offer in this form. Polygon::intersection(const OtherPolygon&) const can return plain polygons for its two-dimensional components because the filled operands have connected complements, so their intersection cannot gain a hole. A PolygonWithHoles can preserve a hole already present in an operand, and a PolygonSet can preserve holes and disconnected components. The simplest witness is a region intersected with a rectangle covering it, which is the region itself.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to intersect with.
Returns
The pieces of the intersection, in canonical order.
Note
The arrangement is built over exact rationals whatever ResultNumber is, and converted only at the end. This is what Polygon::intersection(const OtherPolygon&) const does not do: it computes in the result type, so an integral one truncates every crossing.

◆ regularizedIntersection() [9/16]

template<class PointType_, class TLabel>
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherRectangle & other) const

◆ regularizedIntersection() [10/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherRectangle & other) const
nodiscard

Returns the regularized intersection of the two shapes (A ∩ B).

◆ regularizedIntersection() [11/16]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherRegion & other) const

◆ regularizedIntersection() [12/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherRegion & other) const
nodiscard

Returns the regularized intersection of the two shapes (A ∩ B).

◆ regularizedIntersection() [13/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires (!PointConcept<OtherShape> && (detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const
OtherShape& o, const PolygonWithHoles& self) { o.template regularizedIntersection<ResultNumber>(self); })
auto pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherShape & other) const
inlinenodiscardconstexpr

Forwards a regularized intersection to the higher-ranked shape.

◆ regularizedIntersection() [14/16]

template<class PointType_, class TLabel>
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherTriangle & other) const

◆ regularizedIntersection() [15/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const OtherTriangle & other) const
nodiscard

Returns the regularized intersection of the two shapes (A ∩ B).

◆ regularizedIntersection() [16/16]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType_, TLabel >::regularizedIntersection ( const Shape< OtherPoint > & other) const
inlinenodiscard

Re-dispatches a regularized intersection through a runtime shape.

◆ regularizedUnion() [1/12]

template<class PointType_, class TLabel>
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherConvex & other) const

◆ regularizedUnion() [2/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherConvex & other) const
nodiscard

Returns the regularized union of the two shapes (A ∪ B).

◆ regularizedUnion() [3/12]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherPolygon & other) const

◆ regularizedUnion() [4/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherPolygon & other) const
nodiscard

Returns the regularized union of the two shapes (A ∪ B).

The result is closure(A° ∪ B°), as a set of regions with pairwise disjoint interiors. A union fills in as much of a hole as the other operand covers, and can close a new hole into being where the two wrap round between them. See Polygon::regularizedUnion for the full contract.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe shape to unite with.
Returns
The pieces of the union, in canonical order.

◆ regularizedUnion() [5/12]

template<class PointType_, class TLabel>
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherRectangle & other) const

◆ regularizedUnion() [6/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherRectangle & other) const
nodiscard

Returns the regularized union of the two shapes (A ∪ B).

◆ regularizedUnion() [7/12]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherRegion & other) const

◆ regularizedUnion() [8/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherRegion & other) const
nodiscard

Returns the regularized union of the two shapes (A ∪ B).

◆ regularizedUnion() [9/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
auto pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherSet & other) const
inlinenodiscard

Returns the regularized union of the two shapes (A ∪ B).

A set of regions is the one PolygonalRegionConcept operand ranked above a region, and it states its operations over every operand at once, so this hands the pair back to it rather than restating it. A union is symmetric, so the order costs nothing — and going through the set is what puts every component into one arrangement instead of folding this region over them one at a time. See Polygon::regularizedUnion for the contract.

◆ regularizedUnion() [10/12]

template<class PointType_, class TLabel>
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherTriangle & other) const

◆ regularizedUnion() [11/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const OtherTriangle & other) const
nodiscard

Returns the regularized union of the two shapes (A ∪ B).

◆ regularizedUnion() [12/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType_, TLabel >::regularizedUnion ( const Shape< OtherPoint > & other) const
inlinenodiscard

Returns the regularized union of the two shapes (A ∪ B), re-dispatching through the wrapper's own regularizedUnion.

A union is symmetric, so this just calls other's own regularizedUnion, which visits its wrapped alternative and throws if the pair is unsupported — here, whenever other turns out to hold anything but a bounded polygonal region. See Polygon::regularizedUnion for the contract.

The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.

◆ regularizedVisiblePolygon()

template<class PointType_, class LabelType>
template<class ResultNumber>
Polygon< Point< ResultNumber > > pgl::PolygonWithHoles< PointType_, LabelType >::regularizedVisiblePolygon ( const PointType & query) const
nodiscard

The part of the region visible from query, regularized.

The visibility polygon: every point reachable from query by a segment staying in the region, the holes blocking sight. Being star-shaped about query it is simply connected, so the result is one Polygon however many holes the region has.

Regularized means the closure of the interior, dropping the one-dimensional slivers grazing sight would otherwise add. Window ends — where a sightline past a reflex corner lands on a farther edge — are ray-edge intersections and need division, so the result type is requested explicitly. A query on the boundary is a vertex of the result.

Template Parameters
ResultNumberCoordinate type of the result (default: division_result_t of the region's own).
Parameters
queryPoint to look from.
Returns
The visible region, counterclockwise; empty when query lies outside this one.

◆ rotate90()

template<class PointType_, class TLabel>
void pgl::PolygonWithHoles< PointType_, TLabel >::rotate90 ( int k)
inlineconstexpr

Rotates the region by 90k degrees around the origin in place.

◆ rotated90()

template<class PointType_, class TLabel>
PolygonWithHoles pgl::PolygonWithHoles< PointType_, TLabel >::rotated90 ( int k) const
inlinenodiscardconstexpr

Returns the region rotated by 90k degrees around the origin.

◆ samePointSet()

template<class PointType, class LabelType>
template<AnyShapeConcept OtherShape>
bool pgl::PolygonWithHoles< PointType, LabelType >::samePointSet ( const OtherShape & other) const
nodiscardconstexpr

Tests whether another shape defines exactly the same point set.

◆ scaledDownX()

template<class PointType_, class TLabel>
template<class OtherNumber>
PolygonWithHoles pgl::PolygonWithHoles< PointType_, TLabel >::scaledDownX ( const OtherNumber scalar) const
inlinenodiscardconstexpr

Returns the region with its x-coordinates multiplied by scalar.

A negative factor reflects the rings, which reverses their orientation and can change their relative order, so the result is re-canonicalized exactly as operator*= does. A zero factor collapses the region onto the y-axis, dropping every ring that loses its area.

◆ scaledDownY()

template<class PointType_, class TLabel>
template<class OtherNumber>
PolygonWithHoles pgl::PolygonWithHoles< PointType_, TLabel >::scaledDownY ( const OtherNumber scalar) const
inlinenodiscardconstexpr

Returns the region with its x-coordinates multiplied by scalar.

A negative factor reflects the rings, which reverses their orientation and can change their relative order, so the result is re-canonicalized exactly as operator*= does. A zero factor collapses the region onto the y-axis, dropping every ring that loses its area.

◆ scaleDownX()

template<class PointType_, class TLabel>
template<class OtherNumber>
void pgl::PolygonWithHoles< PointType_, TLabel >::scaleDownX ( const OtherNumber scalar)
inlineconstexpr

Scales the region's x-coordinates down in place.

◆ scaleDownY()

template<class PointType_, class TLabel>
template<class OtherNumber>
void pgl::PolygonWithHoles< PointType_, TLabel >::scaleDownY ( const OtherNumber scalar)
inlineconstexpr

Scales the region's y-coordinates down in place.

◆ scaledUpX()

template<class PointType_, class TLabel>
template<class OtherNumber>
PolygonWithHoles pgl::PolygonWithHoles< PointType_, TLabel >::scaledUpX ( const OtherNumber scalar) const
inlinenodiscardconstexpr

Returns the region with its x-coordinates multiplied by scalar.

A negative factor reflects the rings, which reverses their orientation and can change their relative order, so the result is re-canonicalized exactly as operator*= does. A zero factor collapses the region onto the y-axis, dropping every ring that loses its area.

◆ scaledUpY()

template<class PointType_, class TLabel>
template<class OtherNumber>
PolygonWithHoles pgl::PolygonWithHoles< PointType_, TLabel >::scaledUpY ( const OtherNumber scalar) const
inlinenodiscardconstexpr

Returns the region with its x-coordinates multiplied by scalar.

A negative factor reflects the rings, which reverses their orientation and can change their relative order, so the result is re-canonicalized exactly as operator*= does. A zero factor collapses the region onto the y-axis, dropping every ring that loses its area.

◆ scaleUpX()

template<class PointType_, class TLabel>
template<class OtherNumber>
void pgl::PolygonWithHoles< PointType_, TLabel >::scaleUpX ( const OtherNumber scalar)
inlineconstexpr

Scales the region's x-coordinates up in place.

◆ scaleUpY()

template<class PointType_, class TLabel>
template<class OtherNumber>
void pgl::PolygonWithHoles< PointType_, TLabel >::scaleUpY ( const OtherNumber scalar)
inlineconstexpr

Scales the region's y-coordinates up in place.

◆ separates() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::PolygonWithHoles< PointType_, TLabel >::separates ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherChain & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherConvex & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherDisk & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

The disk is the one operand the cell engine cannot take — a circle is no triangulation constraint — so this decomposes the plane by the region's rings alone and leans on the disk's convexity, which leaves it meeting each cell in a single connected piece. See implementation/separates.hpp.

◆ separates() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherHalfplane & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [6/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherIntersection>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherIntersection & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [7/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherLine & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [8/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherOrientedLine & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [9/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherOrientedSegment & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [10/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherPoint & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [11/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherPolygon & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [12/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherPolyline & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [13/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherRay & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [14/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherRectangle & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherRegion & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherSegment & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [17/19]

template<class PointType, class LabelType>
template<PolygonSetConcept OtherSet>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherSet & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

A set of regions is the one target that may already be in several pieces before anything is removed, so this neither folds over its components nor answers false for a remover that misses it. See implementation/separates.hpp.

◆ separates() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const OtherTriangle & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

PolygonWithHoles

Region-vs-shape cut predicates. A region without holes forwards to its outer polygon; everything else goes to the cell engine above.

◆ separates() [19/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::PolygonWithHoles< PointType, LabelType >::separates ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ squaredDistance() [1/17]

template<class PointType, class LabelType>
template<class ResultNumber, MonotoneChainConcept OtherChain>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherChain & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [2/17]

template<class PointType, class LabelType>
template<class ResultNumber, ConvexConcept OtherConvex>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherConvex & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [3/17]

template<class PointType, class LabelType>
template<class ResultNumber, DiskConcept OtherDisk>
detail::floating_result_t< ResultNumber > pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherDisk & other) const
nodiscard

Computes the squared Euclidean distance to a disk.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double.

◆ squaredDistance() [4/17]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherHalfplane & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [5/17]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherIntersection & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [6/17]

template<class PointType, class LabelType>
template<class ResultNumber, LineConcept OtherLine>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherLine & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [7/17]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherOrientedLine & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [8/17]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedSegmentConcept OtherOrientedSegment>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [9/17]

template<class PointType, class LabelType>
template<class ResultNumber, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherPoint & point) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [10/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolygonConcept OtherPolygon>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherPolygon & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [11/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolylineConcept OtherPolyline>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherPolyline & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [12/17]

template<class PointType, class LabelType>
template<class ResultNumber, RayConcept OtherRay>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherRay & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [13/17]

template<class PointType, class LabelType>
template<class ResultNumber, RectangleConcept OtherRectangle>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherRectangle & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [14/17]

template<class PointType, class LabelType>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherRegion & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [15/17]

template<class PointType, class LabelType>
template<class ResultNumber, SegmentConcept OtherSegment>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherSegment & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [16/17]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<PolygonWithHoles>) && requires(const OtherShape& o, const
PolygonWithHoles& self) { o.template squaredDistance<ResultNumber>(self); })
auto pgl::PolygonWithHoles< PointType_, TLabel >::squaredDistance ( const OtherShape & other) const
inlinenodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ squaredDistance() [17/17]

template<class PointType, class LabelType>
template<class ResultNumber, TriangleConcept OtherTriangle>
auto pgl::PolygonWithHoles< PointType, LabelType >::squaredDistance ( const OtherTriangle & other) const
nodiscardconstexpr

Computes the squared Euclidean distance to the other shape.

Zero when the shapes intersect; otherwise the smallest squared distance between them, which the region attains on one of its ring edges.

Complexity: O(n) edge queries over the total vertex count.

Template Parameters
ResultNumberCoordinate type of the returned distance (default: division_result_t).
Warning
With an integer ResultNumber the exact squared distance is generally a fraction, so the internal division truncates and the result is inexact. Request a floating-point or pgl::Rational result type, e.g. squaredDistance<double>(point), for an accurate value.

◆ symmetricDifference() [1/12]

template<class PointType_, class TLabel>
template<class ResultNumber, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherConvex & other) const

◆ symmetricDifference() [2/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherConvex & other) const
nodiscard

Returns the regularized symmetric difference of the two shapes (A △ B).

◆ symmetricDifference() [3/12]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherPolygon & other) const

◆ symmetricDifference() [4/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherPolygon & other) const
nodiscard

Returns the regularized symmetric difference of the two shapes (A △ B).

The result is closure((A° ∖ B) ∪ (B° ∖ A)), as a set of regions with pairwise disjoint interiors: the part covered by exactly one of the two operands. See Polygon::symmetricDifference for the full contract.

Template Parameters
ResultNumberThe number type for the result.
Parameters
otherThe other shape.
Returns
The pieces of the symmetric difference, in canonical order.

◆ symmetricDifference() [5/12]

template<class PointType_, class TLabel>
template<class ResultNumber, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherRectangle & other) const

◆ symmetricDifference() [6/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherRectangle & other) const
nodiscard

Returns the regularized symmetric difference of the two shapes (A △ B).

◆ symmetricDifference() [7/12]

template<class PointType_, class TLabel>
template<class ResultNumber, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherRegion & other) const

◆ symmetricDifference() [8/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonWithHolesConcept OtherRegion>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherRegion & other) const
nodiscard

Returns the regularized symmetric difference of the two shapes (A △ B).

◆ symmetricDifference() [9/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PolygonSetConcept OtherSet>
auto pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherSet & other) const
inlinenodiscard

Returns the regularized symmetric difference of the two shapes (A △ B).

A set of regions is the one PolygonalRegionConcept operand ranked above a region, and it states its operations over every operand at once, so this hands the pair back to it rather than restating it, exactly as regularizedUnion(const OtherSet&) const does. See Polygon::symmetricDifference for the contract.

◆ symmetricDifference() [10/12]

template<class PointType_, class TLabel>
template<class ResultNumber, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherTriangle & other) const

◆ symmetricDifference() [11/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const OtherTriangle & other) const
nodiscard

Returns the regularized symmetric difference of the two shapes (A △ B).

◆ symmetricDifference() [12/12]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto pgl::PolygonWithHoles< PointType_, TLabel >::symmetricDifference ( const Shape< OtherPoint > & other) const
inlinenodiscard

Returns the regularized symmetric difference of the two shapes (A △ B), re-dispatching through the wrapper's own symmetricDifference.

A symmetric difference is symmetric, so this just calls other's own, which visits its wrapped alternative and throws if the pair is unsupported. See Polygon::symmetricDifference for the contract.

The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.

◆ triangulation() [1/2]

template<class PointType_, class TLabel>
auto pgl::PolygonWithHoles< PointType_, TLabel >::triangulation ( ) const

Builds the constrained Delaunay triangulation of this region.

Equivalent to Triangulation(*this). Every ring becomes constrained edges and the hole interiors are left out of the domain, so the in-domain triangles cover exactly the part of the region that has area (a slit, having none, carries no triangle). The region must satisfy isValid.

Returns
A Triangulation whose in-domain triangles cover the region.

◆ triangulation() [2/2]

template<class PointType_, class TLabel>
template<class SegmentRange>
auto pgl::PolygonWithHoles< PointType_, TLabel >::triangulation ( const SegmentRange & segments) const

Builds the constrained Delaunay triangulation of this region with the given interior constraint segments.

Equivalent to Triangulation(*this, segments).

Template Parameters
SegmentRangeRange whose elements are segments.
Parameters
segmentsConstraint edges, assumed to lie in the region.

◆ twiceArea()

template<class PointType_, class TLabel>
template<class ResultNumber = NumberType>
ResultNumber pgl::PolygonWithHoles< PointType_, TLabel >::twiceArea ( ) const
inlinenodiscardconstexpr

Computes twice the area of the region.

2·area(outer) − Σ 2·area(hole_i), exact in NumberType with no division.

Template Parameters
ResultNumberType the rings are measured and summed in, NumberType by default. Twice an area is a sum of coordinate products, so a region larger than the coordinate range wraps; pass a wider type to measure such a region.

◆ vertexCount()

template<class PointType_, class TLabel>
std::size_t pgl::PolygonWithHoles< PointType_, TLabel >::vertexCount ( ) const
inlinenodiscardconstexpr

Returns the total number of vertices over all rings.

Deliberately not named size(): unlike Polygon::size this counts the outer boundary and every hole, and a name shared with a shape whose meaning differs would be a trap in generic code.

◆ vertices()

template<class PointType_, class TLabel>
std::vector< PointType > pgl::PolygonWithHoles< PointType_, TLabel >::vertices ( ) const
inlinenodiscardconstexpr

Returns the vertices of every ring, outer boundary first.

◆ verticesBegin()

template<class PointType_, class TLabel>
VertexIterator pgl::PolygonWithHoles< PointType_, TLabel >::verticesBegin ( ) const
inlinenodiscardconstexpr

Returns an iterator to the first vertex of the outer boundary.

◆ verticesCentroid()

template<class PointType, class LabelType>
template<class ResultNumber>
Point< ResultNumber > pgl::PolygonWithHoles< PointType, LabelType >::verticesCentroid ( ) const
nodiscardconstexpr

Computes the centroid of the vertex set over all rings.

◆ verticesEnd()

template<class PointType_, class TLabel>
VertexIterator pgl::PolygonWithHoles< PointType_, TLabel >::verticesEnd ( ) const
inlinenodiscardconstexpr

Returns an iterator past the last vertex of the last hole.

◆ verticesView()

template<class PointType_, class TLabel>
auto pgl::PolygonWithHoles< PointType_, TLabel >::verticesView ( ) const
inlinenodiscardconstexpr

Returns a lazy view over the vertices of every ring, outer boundary first, without allocating a vector.

Same vertex sequence as vertices(). Unlike begin(), which walks the holes, this walks the points of every ring, so it is what generic code iterating a region's vertices wants.

◆ visibilityGraph()

template<class PointType_, class LabelType>
Graph< PointType_ > pgl::PolygonWithHoles< PointType_, LabelType >::visibilityGraph ( ) const
nodiscard

Returns the visibility graph of the region's vertices.

Two vertices — of the outer ring or of any hole — are adjacent exactly when the closed segment joining them stays in the closed region, the holes blocking sight. Grazing counts: a segment that touches a boundary vertex or passes straight through another vertex without leaving the region is a visibility edge.

The region must satisfy isValid. Without holes this is outer().visibilityGraph(); otherwise the region is triangulated and each vertex runs a cone-clipped traversal of the mesh — see Triangulation::visibilityGraph.

Complexity: O(n·t + m) time for n vertices, m visibility edges and t triangles seen per vertex.

Returns
An undirected graph whose vertices are this region's vertices.

◆ visibleVertices()

template<class PointType_, class LabelType>
std::vector< PointType_ > pgl::PolygonWithHoles< PointType_, LabelType >::visibleVertices ( const PointType & query) const
nodiscard

The region's vertices visible from query.

Same convention as visibilityGraph, for a point that need not be a vertex: a vertex v — of the outer ring or of any hole — is reported when the closed segment queryv stays in the closed region, grazing included. This is what joins a query point to reducedVisibilityGraph, which by itself holds only the edges a shortest path can bend along.

Parameters
queryPoint to look from; outside the region nothing is visible.
Returns
The visible vertices, counterclockwise around query starting from the lexicographically smallest, as sortAround orders them. Empty when query lies outside the region.

◆ PolygonWithHoles

template<class PointType_, class TLabel>
template<class OtherPointType, class OtherLabelType>
friend struct PolygonWithHoles
friend