![]() |
Pangolin
Header-only C++20 plane computational geometry library
|
Closed region bounded by one outer simple polygon minus disjoint polygonal holes. More...
#include <polygonwithholes.hpp>
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 PolygonType & | outer () 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 PolygonType & | hole (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< PointType > | vertices () 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< EdgeType > | edges () 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< PointType > | asPolygonSet () 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< PointType > | visibilityGraph () const |
| Returns the visibility graph of the region's vertices. | |
| Graph< PointType > | clearVisibilityGraph () const |
| Returns the clear visibility graph of the region's vertices. | |
| Graph< PointType > | reducedVisibilityGraph () const |
| Returns the reduced visibility graph of the region's vertices. | |
| std::vector< PointType > | visibleVertices (const PointType &query) const |
The region's vertices visible from query. | |
| std::vector< PointType > | clearlyVisibleVertices (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< PointType > | diameter () const |
| Returns a segment realizing the diameter (the farthest vertex pair). | |
| constexpr Convex< PointType > | convexHull () 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 PolygonWithHoles & | operator+= (const Point< TranslationNumber, TranslationLabel > &translation) |
| Translates the region in place. | |
| template<class TranslationNumber, class TranslationLabel> | |
| constexpr PolygonWithHoles & | operator-= (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 PolygonWithHoles & | operator*= (const Scalar &scalar) |
| Scales the region in place. | |
| template<class Scalar> requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>) | |
| constexpr PolygonWithHoles & | operator/= (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 |
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
— 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.
| PointType_ | The vertex point type. |
| TLabel | Optional label payload. |
| using pgl::PolygonWithHoles< PointType_, TLabel >::EdgeType = Segment<PointType> |
| using pgl::PolygonWithHoles< PointType_, TLabel >::LabelType = TLabel |
| using pgl::PolygonWithHoles< PointType_, TLabel >::NumberType = typename PointType::NumberType |
| using pgl::PolygonWithHoles< PointType_, TLabel >::PointType = PointType_ |
| using pgl::PolygonWithHoles< PointType_, TLabel >::PolygonType = Polygon<PointType> |
|
constexprdefault |
Creates the empty region (a vertexless outer polygon, no holes).
|
inlineexplicitconstexpr |
Creates a hole-free region from its outer boundary.
| outer | The outer boundary. |
|
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.
| HoleRange | Range whose elements are polygons. |
| outer | The outer boundary. |
| holes | The holes; each must lie inside outer with interiors pairwise disjoint (a precondition, see isValid). |
| trusted | When true, adopt holes as given without dropping degenerate rings or sorting. Only pass true for a range that is already in canonical form. |
|
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.
| OtherPointType | Source vertex type. |
| OtherLabelType | Source label type. |
| other | Source region. |
|
inlineconstexpr |
Adds a hole, keeping the canonical order.
A zero-area ring removes nothing and is ignored.
| hole | The hole to add; must lie inside the outer boundary with interior disjoint from the existing holes (a precondition, see isValid). |
|
inlinenodiscardconstexpr |
Computes the area of the region.
|
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.
| ResultNumber | Integer 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). |
| std::logic_error | If an edge of a ring is not axis-parallel, or a coordinate is not a whole number the grid can hold. |
|
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.
|
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.
|
inlinenodiscardconstexpr |
Returns a constant iterator to the first hole.
|
inlinenodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
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.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
The boundary is bounded too, so only a degenerate operand qualifies.
|
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.
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
The boundary is bounded too, so only a degenerate operand qualifies.
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
The boundary is bounded too, so only a degenerate operand qualifies.
|
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.
|
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.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
The boundary is bounded too, so only a degenerate operand qualifies.
|
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.
|
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.
|
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.
|
inlinenodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
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.
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
inlinenodiscardconstexpr |
Returns a constant iterator to the first hole.
|
inlinenodiscardconstexpr |
Returns a constant iterator past the last hole.
|
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.
| ResultNumber | The number type for the result. |
ResultNumber.
|
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.
|
nodiscard |
The region's vertices clearly visible from query.
The strict counterpart of visibleVertices, matching clearVisibilityGraph: the open segment query–v must lie in the interior of the region and hold no other vertex. Always a subset of visibleVertices.
| query | Point to look from; outside the region nothing is visible. |
|
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.
|
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.
| ResultNumber | Coordinate type of the returned points (default: division_result_t). |
ResultNumber it truncates. Request a floating-point or pgl::Rational result type for an accurate value.
|
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.
| ResultNumber | Coordinate type of the returned segments (default: NumberType). |
other's coordinates and labels are re-expressed in this shape's, so a narrower ResultNumber loses them.
|
inlinenodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
inlinenodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
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.
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
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.
|
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.
|
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 area — closure(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.
|
inlinenodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
inlinenodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscard |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
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.
| 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).
| 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.
| 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.
| ResultNumber | The number type for the result. |
| other | The region to remove; may be unbounded, up to the whole plane. |
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to remove. |
| 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).
| 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).
| 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.
| 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).
|
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
inlinenodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceL1.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
inlinenodiscardconstexpr |
Returns the Chebyshev (L∞) distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceLInf.
|
inlinenodiscardconstexpr |
Returns the boundary edges of every ring, outer boundary first.
|
inlinenodiscardconstexpr |
Tests whether the region has no outer boundary at all.
|
inlinenodiscardconstexpr |
Returns a constant iterator past the last 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.
| hole | The hole to erase. |
hole.
|
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.
| index | The index of the hole, in canonical (sorted) order. |
|
inlinenodiscardconstexpr |
Computes the floating-point bounding box of the region.
|
inlinenodiscardconstexpr |
Tests whether the region has at least one hole.
|
inlinenodiscardconstexpr |
Accesses a hole by index.
| index | The index of the hole, in canonical (sorted) order. |
|
inlinenodiscardconstexpr |
Returns the number of holes.
|
inlinenodiscardconstexpr |
Returns the holes in canonical order.
|
inlinenodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
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.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Unbounded, so again only a degenerate operand qualifies.
|
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.
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Unbounded, so again only a degenerate operand qualifies.
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Unbounded, so again only a degenerate operand qualifies.
|
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.
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Complexity: O(n) over the total vertex count.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Unbounded, so again only a degenerate operand qualifies.
|
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.
|
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.
|
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.
|
inlinenodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
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.
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
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.
|
inlinenodiscardconstexpr |
Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
|
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.
|
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).
|
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.
|
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.
|
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.
|
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.
|
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.
|
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).
|
inlinenodiscardconstexpr |
Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
A point has empty interior, so this is always false, matching Polygon.
|
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).
|
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.
|
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.
|
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).
|
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).
|
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).
|
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.
|
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).
|
nodiscardconstexpr |
Tests whether the interiors of the shapes intersect (A° ∩ B° ≠ ∅).
|
inlinenodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
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.
| ResultNumber | Number type of the returned coordinates. |
| other | The chain to clip. |
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to intersect with. |
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. | 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.
| 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.
|
constexpr |
|
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.
| ResultNumber | Number type of the returned coordinates. |
| other | The line to clip. |
|
constexpr |
|
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.
|
constexpr |
|
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.
|
constexpr |
|
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.
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to intersect with. |
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.
|
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.
| ResultNumber | Number type of the returned coordinates. |
| other | The polyline to clip. |
|
constexpr |
|
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.
| ResultNumber | Number type of the returned coordinates. |
| other | The ray to clip. |
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to intersect with. |
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. | 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.
| ResultNumber | The number type for the result. |
| other | The shape to intersect with. |
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.
|
constexpr |
|
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.
| ResultNumber | Number type of the returned coordinates. |
| other | The segment to clip. |
|
inlinenodiscard |
Forwards an intersection to the higher-ranked shape.
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to intersect with. |
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.
|
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.
other holds is not known until run time, so neither is the result's.
|
inlinenodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
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.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Complexity: O(n) over the total vertex count.
|
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.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Complexity: O(n) over the total vertex count.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Complexity: O(n) over the total vertex count.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Complexity: O(n) segment-segment tests over the total vertex count.
|
inlinenodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Complexity: O(n) over the total vertex count.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Complexity: O(n) over the total vertex count.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Complexity: O(n) segment-segment tests over the total vertex count.
|
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.
|
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.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
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.
|
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.
|
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.
|
inlinenodiscardconstexpr |
Tests whether the region covers exactly one segment of positive length.
|
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.
|
inlinenodiscardconstexpr |
Tests whether the region is degenerate without covering a point or a segment (which includes the empty region).
|
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.
|
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.
|
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.
| ResultNumber | Integer 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. |
| std::logic_error | If a coordinate is not finite, or a lattice point of the shape does not fit ResultNumber. |
| std::length_error | If there are more of them than a vector holds. |
|
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.
| ResultNumber | Coordinate type of the result. |
| OtherShape | Type of the shape to erode by. |
| other | Shape to erode by. |
| std::logic_error | when other covers no point: that erosion is the whole plane, which no set of bounded regions represents. |
|
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.
| OtherShape | Type of the shape to erode by. |
| other | Shape to erode by. |
| 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.
| 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).
| PolygonWithHoles< Point< ResultNumber, typename PointType_::LabelType > > pgl::PolygonWithHoles< PointType_, TLabel >::minkowskiSum | ( | const OtherOriented & | other | ) | const |
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to sum with. |
| 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.
| 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).
| 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).
| 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.
|
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.
| 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.
|
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.
| OtherShape | Type of the other shape. |
| other | Shape to sum with. |
| 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).
|
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.
|
inlineconstexpr |
Translates the region in place.
|
inlineconstexpr |
Translates the region in place by the opposite vector.
|
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.
|
inlinenodiscardconstexpr |
Compares two regions by outer boundary, then by canonical hole list.
|
inlinenodiscardconstexpr |
Checks equality of two regions.
|
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.
|
inlinenodiscardconstexpr |
Returns the outer boundary.
|
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.
| ResultNumber | The number type for the result. |
|
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.
|
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.
| 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.
| ResultNumber | The number type for the result. |
| 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).
| 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.
| 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.
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to intersect with. |
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. | 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).
| 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).
|
inlinenodiscardconstexpr |
Forwards a regularized intersection to the higher-ranked shape.
| 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).
|
inlinenodiscard |
Re-dispatches a regularized intersection through a runtime shape.
| 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).
| 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.
| ResultNumber | The number type for the result. |
| other | The shape to unite with. |
| 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).
| 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).
|
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.
| 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).
|
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.
|
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.
| ResultNumber | Coordinate type of the result (default: division_result_t of the region's own). |
| query | Point to look from. |
query lies outside this one.
|
inlineconstexpr |
Rotates the region by 90k degrees around the origin in place.
|
inlinenodiscardconstexpr |
Returns the region rotated by 90k degrees around the origin.
|
nodiscardconstexpr |
Tests whether another shape defines exactly the same point set.
|
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.
|
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.
|
inlineconstexpr |
Scales the region's x-coordinates down in place.
|
inlineconstexpr |
Scales the region's y-coordinates down in place.
|
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.
|
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.
|
inlineconstexpr |
Scales the region's x-coordinates up in place.
|
inlineconstexpr |
Scales the region's y-coordinates up in place.
|
inlinenodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscard |
|
nodiscard |
|
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.
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
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.
|
nodiscard |
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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.
|
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.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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. | 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).
| 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.
| ResultNumber | The number type for the result. |
| other | The other shape. |
| 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).
| 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).
|
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.
| 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).
|
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.
| 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.
| 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).
| SegmentRange | Range whose elements are segments. |
| segments | Constraint edges, assumed to lie in the region. |
|
inlinenodiscardconstexpr |
Computes twice the area of the region.
2·area(outer) − Σ 2·area(hole_i), exact in NumberType with no division.
| ResultNumber | Type 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. |
|
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.
|
inlinenodiscardconstexpr |
Returns the vertices of every ring, outer boundary first.
|
inlinenodiscardconstexpr |
Returns an iterator to the first vertex of the outer boundary.
|
nodiscardconstexpr |
Computes the centroid of the vertex set over all rings.
|
inlinenodiscardconstexpr |
Returns an iterator past the last vertex of the last hole.
|
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.
|
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.
|
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 query–v 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.
| query | Point to look from; outside the region nothing is visible. |
query starting from the lexicographically smallest, as sortAround orders them. Empty when query lies outside the region.
|
friend |