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

Intersection of closed half-planes; convex but possibly unbounded or empty. More...

#include <halfplaneintersection.hpp>

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

Public Types

using PointType = PointType_
using NumberType = PointType::NumberType
using LabelType = TLabel
using HalfplaneType = Halfplane<PointType>

Public Member Functions

constexpr HalfplaneIntersection ()=default
 Creates the whole plane (the intersection of no half-planes).
template<HalfplaneConcept OtherHalfplane>
constexpr HalfplaneIntersection (const OtherHalfplane &halfplane)
 Creates the region bounded by a single half-plane.
template<std::ranges::input_range Range = std::initializer_list<HalfplaneType>>
requires std::convertible_to<std::ranges::range_value_t<Range>, HalfplaneType> && (!detail::is_halfplane_intersection_v<Range>)
constexpr HalfplaneIntersection (Range &&halfplanes, bool trusted=false)
 Creates the intersection of a range of half-planes.
template<RectangleConcept OtherRectangle>
constexpr HalfplaneIntersection (const OtherRectangle &rectangle)
 Creates the region of a rectangle as four half-planes.
template<TriangleConcept OtherTriangle>
constexpr HalfplaneIntersection (const OtherTriangle &triangle)
 Creates the region of a triangle as three half-planes.
template<ConvexConcept OtherConvex>
constexpr HalfplaneIntersection (const OtherConvex &convex)
 Creates the region of a convex polygon as its edge half-planes.
template<PointConcept OtherPoint>
constexpr HalfplaneIntersection (const OtherPoint &point)
 Creates the degenerate region consisting of a single point.
template<SegmentConcept OtherSegment>
constexpr HalfplaneIntersection (const OtherSegment &segment)
 Creates the degenerate region consisting of a segment.
template<LineConcept OtherLine>
constexpr HalfplaneIntersection (const OtherLine &line)
 Creates the degenerate region consisting of a line.
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
constexpr HalfplaneIntersection (const HalfplaneIntersection< OtherPointType, OtherLabelType > &other)
 Converts a half-plane intersection with a compatible point type.
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
constexpr HalfplaneIntersectionoperator= (const HalfplaneIntersection< OtherPointType, OtherLabelType > &other)
 Assigns from a half-plane intersection with a compatible point type.
template<class A = LabelType>
requires (detail::has_label_v<A>)
constexpr A & label () const
 Returns the label.
template<HalfplaneConcept OtherHalfplane>
constexpr bool insert (const OtherHalfplane &other)
 Intersects the region with one more half-plane.
constexpr std::size_t size () const
 Returns the number of stored (non-redundant) half-planes.
constexpr const HalfplaneTypeoperator[] (std::size_t index) const
 Accesses a stored half-plane by index, in boundary (counterclockwise pseudo-angle) order.
constexpr const HalfplaneTypeget (std::ptrdiff_t index) const
 Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the end.
constexpr std::ptrdiff_t index (const HalfplaneType &halfplane) const
 Returns the smallest index i with (*this)[i] == halfplane, or -1 if no stored half-plane equals it.
constexpr std::vector< HalfplaneTypehalfplanes () const
 Returns a copy of the stored half-planes, in boundary order.
constexpr auto begin () const
 Returns a constant iterator to the first half-plane, in boundary order.
constexpr auto cbegin () const
 Returns a constant iterator to the first half-plane, in boundary order.
constexpr auto end () const
 Returns a constant iterator past the last half-plane.
constexpr auto cend () const
 Returns a constant iterator past the last half-plane.
constexpr bool empty () const
 Returns whether the region is the empty set.
constexpr bool isPlane () const
 Returns whether the region is the whole plane (no half-planes).
constexpr bool isDegenerate () const
 Returns whether the region has empty interior (it is empty or lower-dimensional: a line, ray, segment, or point).
constexpr bool isUndefined () const
 Returns whether the region is undefined.
constexpr bool isHalfplane () const
 Returns whether the region is exactly one closed half-plane.
constexpr std::optional< HalfplaneTypegetIfHalfplane () const
 Returns the half-plane the region equals, if it is one.
constexpr bool isLine () const
 Returns whether the region is exactly one line.
constexpr std::optional< Line< PointType > > getIfLine () const
 Returns the line the region equals, if it is one.
constexpr bool isRay () const
 Returns whether the region is exactly one ray.
template<class ResultNumber = division_result_t<NumberType>>
constexpr std::optional< Ray< Point< ResultNumber, typename PointType::LabelType > > > getIfRay () const
 Returns the ray the region equals, if it is one.
constexpr bool isPoint () const
 Returns whether the region is a single point.
template<class ResultNumber = division_result_t<NumberType>>
constexpr std::optional< Point< ResultNumber, typename PointType::LabelType > > getIfPoint () const
 Returns the point the region collapses to, if it is one.
constexpr bool isSegment () const
 Returns whether the region is a segment of positive length.
template<class ResultNumber = division_result_t<NumberType>>
constexpr std::optional< Segment< Point< ResultNumber, typename PointType::LabelType > > > getIfSegment () const
 Returns the segment the region collapses to, if it is one.
constexpr bool isBounded () const
 Returns whether the region is bounded.
constexpr std::size_t vertexCount () const
 Returns the number of vertices of the region.
constexpr bool vertexExists (std::size_t i) const
 Returns whether the half-plane pair (i, i+1) (cyclically) defines a vertex of the region.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Point< ResultNumber, typename PointType::LabelType > vertex (std::size_t i) const
 Returns the vertex between half-planes i and i+1 (cyclically).
template<class ResultNumber = division_result_t<NumberType>>
constexpr std::vector< Point< ResultNumber, typename PointType::LabelType > > vertices () const
 Returns every vertex of the region, in pair-index order (for a bounded region: counterclockwise).
template<class ResultNumber = division_result_t<NumberType>>
constexpr std::variant< Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > >, Line< Point< ResultNumber, typename PointType::LabelType > > > edge (std::size_t i) const
 Returns the boundary contribution of half-plane i as a typed one-dimensional shape.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Convex< Point< ResultNumber, typename PointType::LabelType > > asConvex () const
 Returns the region as a convex polygon.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Convex< Point< ResultNumber, typename PointType::LabelType > > convexHull () const
 Returns the region's convex hull.
constexpr bool operator== (const HalfplaneIntersection &other) const
 Tests equality of the stored regions.
template<AnyShapeConcept OtherShape>
constexpr bool samePointSet (const OtherShape &other) const
 Tests whether another shape defines exactly the same point set.
constexpr auto operator<=> (const HalfplaneIntersection &other) const
 Provides an ordering compatible with operator==.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Rectangle< Point< ResultNumber, typename PointType::LabelType > > 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<class OtherShape>
requires MinkowskiSummableConcept<HalfplaneIntersection<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<HalfplaneIntersection<PointType_, TLabel>, OtherShape>
constexpr auto minkowskiErosion (const OtherShape &other) const
 Returns the Minkowski erosion of this shape by another (A ⊖ B).
template<PointConcept OtherPoint>
constexpr HalfplaneIntersectionoperator+= (const OtherPoint &translation)
 Translates the region by the given point in place.
template<PointConcept OtherPoint>
constexpr HalfplaneIntersectionoperator-= (const OtherPoint &translation)
 Translates the region by the negation of the given point in place.
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr HalfplaneIntersectionoperator*= (const Scalar &scalar)
 Scales the region around the origin by a scalar in place.
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr HalfplaneIntersectionoperator/= (const Scalar &scalar)
 Divides the region coordinates by a scalar in place.
constexpr HalfplaneIntersection rotated90 (int k=1) const
 Returns the region rotated by 90k degrees around the origin.
constexpr void rotate90 (int k=1)
 Rotates the region by 90k degrees around the origin in place.
template<class OtherNumber>
constexpr HalfplaneIntersection scaledUpX (const OtherNumber scalar) const
 Returns the region with its x-coordinates multiplied by a factor.
template<class OtherNumber>
constexpr void scaleUpX (const OtherNumber scalar)
 Multiplies the region's x-coordinates by a factor in place.
template<class OtherNumber>
constexpr HalfplaneIntersection scaledUpY (const OtherNumber scalar) const
 Returns the region with its y-coordinates multiplied by a factor.
template<class OtherNumber>
constexpr void scaleUpY (const OtherNumber scalar)
 Multiplies the region's y-coordinates by a factor in place.
template<class OtherNumber>
constexpr HalfplaneIntersection scaledDownX (const OtherNumber scalar) const
 Returns the region with its x-coordinates divided by a divisor.
template<class OtherNumber>
constexpr void scaleDownX (const OtherNumber scalar)
 Divides the region's x-coordinates by a divisor in place.
template<class OtherNumber>
constexpr HalfplaneIntersection scaledDownY (const OtherNumber scalar) const
 Returns the region with its y-coordinates divided by a divisor.
template<class OtherNumber>
constexpr void scaleDownY (const OtherNumber scalar)
 Divides the region's y-coordinates by a divisor in place.
template<PointConcept OtherPoint>
constexpr bool contains (const OtherPoint &point) const
 Tests whether this shape contains the other shape (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<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<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<DiskConcept OtherDisk>
constexpr bool contains (const OtherDisk &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<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<PolygonConcept OtherPolygon>
constexpr bool contains (const OtherPolygon &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool contains (const OtherRegion &other) const
 Tests whether this shape contains the other shape (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<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<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<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<DiskConcept OtherDisk>
constexpr bool boundaryContains (const OtherDisk &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<MonotoneChainConcept OtherChain>
constexpr bool boundaryContains (const OtherChain &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool boundaryContains (const OtherPolyline &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<HalfplaneIntersectionConcept OtherRegion>
constexpr bool boundaryContains (const OtherRegion &other) const
 Tests whether this shape's boundary 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<SegmentConcept OtherSegment>
constexpr bool interiorContains (const OtherSegment &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool interiorContains (const OtherOrientedSegment &other) const
 Tests whether this shape's interior contains the other shape (A∖∂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<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<DiskConcept OtherDisk>
constexpr bool interiorContains (const OtherDisk &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<MonotoneChainConcept OtherChain>
constexpr bool interiorContains (const OtherChain &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool interiorContains (const OtherPolyline &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<HalfplaneIntersectionConcept OtherRegion>
constexpr bool interiorContains (const OtherRegion &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool intersects (const OtherPoint &other) const
 Tests whether this shape and the other shape intersect (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<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<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<DiskConcept OtherDisk>
constexpr bool intersects (const OtherDisk &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<MonotoneChainConcept OtherChain>
constexpr bool intersects (const OtherChain &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PolylineConcept OtherPolyline>
constexpr bool intersects (const OtherPolyline &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<HalfplaneIntersectionConcept OtherRegion>
constexpr bool intersects (const OtherRegion &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool interiorsIntersect (const OtherPoint &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<SegmentConcept OtherSegment>
constexpr bool interiorsIntersect (const OtherSegment &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool interiorsIntersect (const OtherOrientedSegment &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<LineConcept OtherLine>
constexpr bool interiorsIntersect (const OtherLine &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool interiorsIntersect (const OtherOrientedLine &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<RayConcept OtherRay>
constexpr bool interiorsIntersect (const OtherRay &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<HalfplaneConcept OtherHalfplane>
constexpr bool interiorsIntersect (const OtherHalfplane &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<RectangleConcept OtherRectangle>
constexpr bool interiorsIntersect (const OtherRectangle &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<TriangleConcept OtherTriangle>
constexpr bool interiorsIntersect (const OtherTriangle &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<DiskConcept OtherDisk>
constexpr bool interiorsIntersect (const OtherDisk &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<ConvexConcept OtherConvex>
constexpr bool interiorsIntersect (const OtherConvex &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<MonotoneChainConcept OtherChain>
constexpr bool interiorsIntersect (const OtherChain &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<PolylineConcept OtherPolyline>
constexpr bool interiorsIntersect (const OtherPolyline &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<PolygonConcept OtherPolygon>
constexpr bool interiorsIntersect (const OtherPolygon &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool interiorsIntersect (const OtherRegion &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool separates (const OtherPoint &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<SegmentConcept OtherSegment>
constexpr bool separates (const OtherSegment &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool separates (const OtherOrientedSegment &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<LineConcept OtherLine>
constexpr bool separates (const OtherLine &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool separates (const OtherOrientedLine &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<RayConcept OtherRay>
constexpr bool separates (const OtherRay &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<HalfplaneConcept OtherHalfplane>
constexpr bool separates (const OtherHalfplane &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<RectangleConcept OtherRectangle>
constexpr bool separates (const OtherRectangle &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<TriangleConcept OtherTriangle>
constexpr bool separates (const OtherTriangle &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<DiskConcept OtherDisk>
constexpr bool separates (const OtherDisk &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<ConvexConcept OtherConvex>
constexpr bool separates (const OtherConvex &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<MonotoneChainConcept OtherChain>
constexpr bool separates (const OtherChain &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolylineConcept OtherPolyline>
constexpr bool separates (const OtherPolyline &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolygonConcept OtherPolygon>
constexpr bool separates (const OtherPolygon &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool separates (const OtherRegion &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolygonWithHolesConcept OtherHoledRegion>
constexpr bool contains (const OtherHoledRegion &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonWithHolesConcept OtherHoledRegion>
constexpr bool boundaryContains (const OtherHoledRegion &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonWithHolesConcept OtherHoledRegion>
constexpr bool interiorContains (const OtherHoledRegion &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonWithHolesConcept OtherHoledRegion>
bool separates (const OtherHoledRegion &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
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<PointConcept OtherPoint>
constexpr bool crosses (const OtherPoint &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<SegmentConcept OtherSegment>
constexpr bool crosses (const OtherSegment &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool crosses (const OtherOrientedSegment &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<LineConcept OtherLine>
constexpr bool crosses (const OtherLine &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool crosses (const OtherOrientedLine &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<RayConcept OtherRay>
constexpr bool crosses (const OtherRay &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<HalfplaneConcept OtherHalfplane>
constexpr bool crosses (const OtherHalfplane &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<RectangleConcept OtherRectangle>
constexpr bool crosses (const OtherRectangle &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<TriangleConcept OtherTriangle>
constexpr bool crosses (const OtherTriangle &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<DiskConcept OtherDisk>
constexpr bool crosses (const OtherDisk &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<ConvexConcept OtherConvex>
constexpr bool crosses (const OtherConvex &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<MonotoneChainConcept OtherChain>
constexpr bool crosses (const OtherChain &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PolylineConcept OtherPolyline>
constexpr bool crosses (const OtherPolyline &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PolygonConcept OtherPolygon>
constexpr bool crosses (const OtherPolygon &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool crosses (const OtherRegion &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection>)
constexpr bool intersects (const OtherShape &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection>)
constexpr bool interiorsIntersect (const OtherShape &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection> && requires(const
OtherShape& o, const HalfplaneIntersection& self) { o.crosses(self); })
constexpr bool crosses (const OtherShape &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
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 boundaryContains (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape's boundary 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 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 two shapes intersect ((A∖∂A) ∩ (B∖∂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<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<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 boundaryContains (const Shape< OtherPoint > &other) const
 Tests whether this shape's boundary 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 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 two shapes intersect ((A∖∂A) ∩ (B∖∂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 = 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>, LineConcept OtherLine>
constexpr std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > >, Line< 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::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > >, Line< 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>, SegmentConcept OtherSegment>
constexpr std::optional< 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::optional< 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>, RayConcept OtherRay>
constexpr std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< 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 = NumberType, HalfplaneConcept OtherHalfplane>
constexpr HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > intersection (const OtherHalfplane &other) const
 Returns the intersection with a half-plane, as a half-plane intersection.
template<class ResultNumber = NumberType, RectangleConcept OtherRectangle>
constexpr HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > intersection (const OtherRectangle &other) const
 Returns the intersection with a rectangle, as a half-plane intersection.
template<class ResultNumber = NumberType, TriangleConcept OtherTriangle>
constexpr HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > intersection (const OtherTriangle &other) const
 Returns the intersection with a triangle, as a half-plane intersection.
template<class ResultNumber = NumberType, ConvexConcept OtherConvex>
constexpr HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > intersection (const OtherConvex &other) const
 Returns the intersection with a convex polygon, as a half-plane intersection.
template<class ResultNumber = NumberType, HalfplaneIntersectionConcept OtherRegion>
constexpr HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > intersection (const OtherRegion &other) const
 Returns the intersection with another half-plane intersection.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, Polygon< Point< ResultNumber, typename PointType::LabelType > > > > intersection (const OtherPolygon &other) const
 Returns the intersection with a simple polygon (A ∩ B), as components.
template<class ResultNumber = division_result_t<NumberType>, typename OtherShape>
requires (!PointConcept<OtherShape> && (detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection>) && requires(const
OtherShape& o, const HalfplaneIntersection& self) { o.template intersection<ResultNumber>(self); })
auto intersection (const OtherShape &other) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, typename OtherShape>
requires (!PointConcept<OtherShape> && (detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection>) && requires(const
OtherShape& o, const HalfplaneIntersection& self) { o.template regularizedIntersection<ResultNumber>(self); })
auto regularizedIntersection (const OtherShape &other) const
 Forwards a regularized intersection to the shape that owns it.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto squaredDistance (const OtherPoint &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr auto squaredDistance (const OtherSegment &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr auto squaredDistance (const OtherOrientedSegment &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr auto squaredDistance (const OtherLine &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr auto squaredDistance (const OtherOrientedLine &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr auto squaredDistance (const OtherRay &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
constexpr auto squaredDistance (const OtherHalfplane &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
constexpr auto squaredDistance (const OtherRectangle &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
constexpr auto squaredDistance (const OtherTriangle &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
constexpr auto squaredDistance (const OtherConvex &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
constexpr auto squaredDistance (const OtherChain &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
constexpr auto squaredDistance (const OtherPolyline &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
constexpr auto squaredDistance (const OtherPolygon &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = double, DiskConcept OtherDisk>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherDisk &other) const
 Returns the squared Euclidean distance to the given disk.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherRegion>
constexpr auto squaredDistance (const OtherRegion &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires detail::ClosestPointsPairConcept<HalfplaneIntersection<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 &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr auto distanceL1 (const OtherSegment &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr auto distanceL1 (const OtherOrientedSegment &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr auto distanceL1 (const OtherLine &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr auto distanceL1 (const OtherOrientedLine &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr auto distanceL1 (const OtherRay &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
constexpr auto distanceL1 (const OtherHalfplane &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
constexpr auto distanceL1 (const OtherRectangle &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
constexpr auto distanceL1 (const OtherTriangle &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
constexpr auto distanceL1 (const OtherConvex &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
constexpr auto distanceL1 (const OtherChain &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
constexpr auto distanceL1 (const OtherPolyline &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
constexpr auto distanceL1 (const OtherPolygon &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherRegion>
constexpr auto distanceL1 (const OtherRegion &other) const
 Returns the Manhattan (L1) distance to the given shape.
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 = 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 = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto distanceLInf (const OtherPoint &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr auto distanceLInf (const OtherSegment &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr auto distanceLInf (const OtherOrientedSegment &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr auto distanceLInf (const OtherLine &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr auto distanceLInf (const OtherOrientedLine &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr auto distanceLInf (const OtherRay &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
constexpr auto distanceLInf (const OtherHalfplane &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
constexpr auto distanceLInf (const OtherRectangle &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, TriangleConcept OtherTriangle>
constexpr auto distanceLInf (const OtherTriangle &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, ConvexConcept OtherConvex>
constexpr auto distanceLInf (const OtherConvex &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, MonotoneChainConcept OtherChain>
constexpr auto distanceLInf (const OtherChain &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, PolylineConcept OtherPolyline>
constexpr auto distanceLInf (const OtherPolyline &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, PolygonConcept OtherPolygon>
constexpr auto distanceLInf (const OtherPolygon &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherRegion>
constexpr auto distanceLInf (const OtherRegion &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
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 ResultNumber = division_result_t<NumberType>, typename OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection>) && requires(const OtherShape& o, const
HalfplaneIntersection& self) { o.template squaredDistance<ResultNumber>(self); })
constexpr auto squaredDistance (const OtherShape &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, typename OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection>) && requires(const OtherShape& o, const
HalfplaneIntersection& self) { o.template distanceL1<ResultNumber>(self); })
constexpr auto distanceL1 (const OtherShape &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, typename OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection>) && requires(const OtherShape& o, const
HalfplaneIntersection& self) { o.template distanceLInf<ResultNumber>(self); })
constexpr auto distanceLInf (const OtherShape &other) const
 Returns the Chebyshev (L∞) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>>
constexpr auto twiceArea () const
 Returns twice the area of the region.
template<class ResultNumber = division_result_t<NumberType>>
constexpr auto area () const
 Returns the area of the region.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Point< ResultNumber > centroid () const
 Returns the centroid of the region.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Point< ResultNumber > pointInside () const
 Returns a representative point of the region: a point of its interior when the region is full-dimensional, and a point of the region otherwise.
template<class OtherShape>
constexpr bool pointInsideInteriorContainedIn (const OtherShape &shape) const
 Tests whether an exact interior witness of this region lies in the interior of the given shape.
template<PointConcept OtherPoint>
constexpr HalfplaneIntersection< PointType, LabelType > & operator+= (const OtherPoint &translation)
template<PointConcept OtherPoint>
constexpr HalfplaneIntersection< PointType, LabelType > & operator-= (const OtherPoint &translation)
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr HalfplaneIntersection< PointType, LabelType > & operator*= (const Scalar &scalar)
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr HalfplaneIntersection< PointType, LabelType > & operator/= (const Scalar &scalar)
template<class OtherNumber>
constexpr HalfplaneIntersection< PointType, LabelTypescaledUpX (const OtherNumber scalar) const
template<class OtherNumber>
constexpr HalfplaneIntersection< PointType, LabelTypescaledUpY (const OtherNumber scalar) const
template<class OtherNumber>
constexpr HalfplaneIntersection< PointType, LabelTypescaledDownX (const OtherNumber scalar) const
template<class OtherNumber>
constexpr HalfplaneIntersection< PointType, LabelTypescaledDownY (const OtherNumber scalar) const

Friends

template<class OtherPointType, class OtherLabelType>
struct HalfplaneIntersection

Detailed Description

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

Intersection of closed half-planes; convex but possibly unbounded or empty.

Intersection of a finite set of closed half-planes.

The region is stored as a vector of pgl::Halfplane sorted by the pseudo-angle of their oriented boundary directions (counterclockwise from the +x axis). The stored set is kept canonical:

  • no stored half-plane is redundant (each contributes to the boundary),
  • at most one half-plane per boundary direction (the most restrictive wins),
  • when the intersection becomes empty the vector is cleared and a sticky empty flag is set, so all empty regions compare equal.

Consecutive half-planes (cyclically) define the region's vertices in counterclockwise order. The vertices are implicit and generally rational: constructive accessors take a ResultNumber template parameter, following the usual pgl pattern (vertex<pgl::Rational<int64_t>>(i) for exact results).

A default-constructed HalfplaneIntersection is the whole plane (the intersection of an empty family of half-planes) — note that this is the opposite convention of Convex{}, which is the empty set.

Lower-dimensional (degenerate) regions — a line, ray, segment, or point arising from touching constraints — are supported: predicates remain correct, but the stored half-plane list is no longer a canonical function of the point set, so operator== may distinguish equal degenerate regions built from different constraints.

Template Parameters
PointTypeDefining point type of the stored half-planes.

Member Typedef Documentation

◆ HalfplaneType

template<class PointType_, class TLabel>
using pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneType = Halfplane<PointType>

◆ LabelType

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

◆ NumberType

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

◆ PointType

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

Constructor & Destructor Documentation

◆ HalfplaneIntersection() [1/10]

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

Creates the whole plane (the intersection of no half-planes).

◆ HalfplaneIntersection() [2/10]

template<class PointType_, class TLabel>
template<HalfplaneConcept OtherHalfplane>
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( const OtherHalfplane & halfplane)
inlineexplicitconstexpr

Creates the region bounded by a single half-plane.

◆ HalfplaneIntersection() [3/10]

template<class PointType_, class TLabel>
template<std::ranges::input_range Range = std::initializer_list<HalfplaneType>>
requires std::convertible_to<std::ranges::range_value_t<Range>, HalfplaneType> && (!detail::is_halfplane_intersection_v<Range>)
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( Range && halfplanes,
bool trusted = false )
inlineexplicitconstexpr

Creates the intersection of a range of half-planes.

The untrusted path inserts the half-planes one by one, discarding redundant ones and detecting emptiness; the trusted path adopts the range as-is.

Complexity: O(n log n) comparisons (plus O(n^2) element moves in the worst case) untrusted, O(n) trusted.

A region is itself a range of half-planes, so this constructor is excluded for one: copying a region must copy it, and rebuilding it from its stored half-planes would resurrect an empty region as the whole plane, the intersection of the no half-planes an empty region stores. Copy construction and the converting constructor below carry that state over.

Parameters
halfplanesRange of half-planes to intersect.
trustedSet to true if the half-planes are already sorted by boundary pseudo-angle, mutually non-redundant, feasible, and define a region with nonempty interior.

◆ HalfplaneIntersection() [4/10]

template<class PointType_, class TLabel>
template<RectangleConcept OtherRectangle>
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( const OtherRectangle & rectangle)
inlineexplicitconstexpr

Creates the region of a rectangle as four half-planes.

An empty rectangle produces the empty region. A degenerate one produces the corresponding degenerate region: a zero-area rectangle collapses to the segment between its extreme corners, and a single-point rectangle to that point.

◆ HalfplaneIntersection() [5/10]

template<class PointType_, class TLabel>
template<TriangleConcept OtherTriangle>
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( const OtherTriangle & triangle)
inlineexplicitconstexpr

Creates the region of a triangle as three half-planes.

A collinear triangle collapses to the segment spanning its vertices, and a triangle with three equal vertices to that point.

◆ HalfplaneIntersection() [6/10]

template<class PointType_, class TLabel>
template<ConvexConcept OtherConvex>
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( const OtherConvex & convex)
inlineexplicitconstexpr

Creates the region of a convex polygon as its edge half-planes.

An empty convex polygon produces the empty region; a degenerate one (a point or a segment) produces the corresponding degenerate region.

◆ HalfplaneIntersection() [7/10]

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( const OtherPoint & point)
inlineexplicitconstexpr

Creates the degenerate region consisting of a single point.

The region is an axis-aligned point slab (four half-planes); it has empty interior, so isDegenerate is true.

◆ HalfplaneIntersection() [8/10]

template<class PointType_, class TLabel>
template<SegmentConcept OtherSegment>
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( const OtherSegment & segment)
inlineexplicitconstexpr

Creates the degenerate region consisting of a segment.

The region is the segment's supporting-line slab clamped perpendicularly at each endpoint; it has empty interior, so isDegenerate is true. A zero-length segment produces the corresponding point region.

◆ HalfplaneIntersection() [9/10]

template<class PointType_, class TLabel>
template<LineConcept OtherLine>
pgl::HalfplaneIntersection< PointType_, TLabel >::HalfplaneIntersection ( const OtherLine & line)
inlineexplicitconstexpr

Creates the degenerate region consisting of a line.

A line is the intersection of the two opposite closed half-planes bounded by it; the region has empty interior, so isDegenerate is true. A degenerate (single-point) line is undefined behavior.

◆ HalfplaneIntersection() [10/10]

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

Converts a half-plane intersection with a compatible point type.

Member Function Documentation

◆ area()

template<class PointType, class LabelType>
template<class ResultNumber>
auto pgl::HalfplaneIntersection< PointType, LabelType >::area ( ) const
nodiscardconstexpr

Returns the area of the region.

Throws std::logic_error when the region is unbounded (including the whole plane); the empty and degenerate regions have area zero.

Warning
Divides coordinates after casting to ResultNumber when computing the vertices; request a pgl::Rational result type for an exact value.

◆ asConvex()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
Convex< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType_, TLabel >::asConvex ( ) const
inlineconstexpr

Returns the region as a convex polygon.

The empty region converts to the empty convex polygon. Throws std::logic_error when the region is unbounded (including the whole plane).

Warning
Divides coordinates after casting to ResultNumber; request pgl::Rational coordinates for exact vertices.

◆ bbox()

template<class PointType, class LabelType>
template<class ResultNumber>
Rectangle< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::bbox ( ) const
constexpr

Computes the bounding box of the region.

Throws std::logic_error when the region is empty or unbounded. With an integer ResultNumber the box is rounded outward (floors for the minimum corner, ceilings for the maximum corner), so it always encloses the region.

Complexity: O(n) (boundedness check) plus O(log n) extreme queries.

◆ begin()

template<class PointType_, class TLabel>
auto pgl::HalfplaneIntersection< PointType_, TLabel >::begin ( ) const
inlineconstexpr

Returns a constant iterator to the first half-plane, in boundary order.

◆ boundaryContains() [1/19]

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

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

◆ boundaryContains() [2/19]

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

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

◆ boundaryContains() [3/19]

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

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

◆ boundaryContains() [4/19]

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

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

◆ boundaryContains() [5/19]

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

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

◆ boundaryContains() [6/19]

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

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

A boundary has no area, so it holds only a region with no area — which is exactly the union of that region's ring edges.

◆ boundaryContains() [7/19]

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

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

◆ boundaryContains() [8/19]

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

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

◆ boundaryContains() [9/19]

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

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

◆ boundaryContains() [10/19]

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

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

◆ boundaryContains() [11/19]

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

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

◆ boundaryContains() [12/19]

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

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

◆ boundaryContains() [13/19]

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

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

◆ boundaryContains() [14/19]

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

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

◆ boundaryContains() [15/19]

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

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

◆ boundaryContains() [16/19]

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

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

◆ boundaryContains() [17/19]

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

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

◆ boundaryContains() [18/19]

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

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

◆ boundaryContains() [19/19]

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

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

◆ cbegin()

template<class PointType_, class TLabel>
auto pgl::HalfplaneIntersection< PointType_, TLabel >::cbegin ( ) const
inlineconstexpr

Returns a constant iterator to the first half-plane, in boundary order.

◆ cend()

template<class PointType_, class TLabel>
auto pgl::HalfplaneIntersection< PointType_, TLabel >::cend ( ) const
inlineconstexpr

Returns a constant iterator past the last half-plane.

◆ centroid()

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

Returns the centroid of the region.

Throws std::logic_error when the region is unbounded (including the whole plane). The centroid of the empty region is the origin, mirroring Convex.

Warning
Divides coordinates after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ closestPoints()

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

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

The first point lies on this shape and the second on other, which must be bounded polygonal: two unbounded shapes may realize their distance along their whole length, with nothing to anchor a choice to. Empty exactly when squaredDistance is zero. There is no closestSegments counterpart — the point on this shape lies on no edge and at no vertex.

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

◆ contains() [1/19]

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

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

◆ contains() [2/19]

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

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

◆ contains() [3/19]

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

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

◆ contains() [4/19]

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

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

◆ contains() [5/19]

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

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

◆ contains() [6/19]

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

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

A region is contained exactly when its outer polygon is: the region holds the whole outer ring whatever its holes do, and this shape has a connected complement. See implementation/contains.hpp.

◆ contains() [7/19]

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

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

◆ contains() [8/19]

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

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

◆ contains() [9/19]

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

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

◆ contains() [10/19]

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

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

◆ contains() [11/19]

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

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

◆ contains() [12/19]

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

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

◆ contains() [13/19]

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

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

◆ contains() [14/19]

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

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

◆ contains() [15/19]

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

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

◆ contains() [16/19]

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

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

◆ contains() [17/19]

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

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

◆ contains() [18/19]

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

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

◆ contains() [19/19]

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

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

◆ convexHull()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
Convex< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType_, TLabel >::convexHull ( ) const
inlineconstexpr

Returns the region's convex hull.

Alias for asConvex, kept for the convexHull() name shared by every shape that has a bbox.

◆ crosses() [1/18]

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

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

◆ crosses() [2/18]

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

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

◆ crosses() [3/18]

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

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

◆ crosses() [4/18]

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

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

◆ crosses() [5/18]

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

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

◆ crosses() [6/18]

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

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

◆ crosses() [7/18]

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

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

◆ crosses() [8/18]

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

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

◆ crosses() [9/18]

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

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

◆ crosses() [10/18]

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

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

◆ crosses() [11/18]

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

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

◆ crosses() [12/18]

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

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

◆ crosses() [13/18]

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

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

◆ crosses() [14/18]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherRegion>
bool pgl::HalfplaneIntersection< PointType, LabelType >::crosses ( const OtherRegion & other) const
nodiscardconstexpr

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

◆ crosses() [15/18]

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

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

◆ crosses() [16/18]

template<class PointType_, class TLabel>
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<HalfplaneIntersection> && requires(const
OtherShape& o, const HalfplaneIntersection& self) { o.crosses(self); })
bool pgl::HalfplaneIntersection< PointType_, TLabel >::crosses ( const OtherShape & other) const
inlinenodiscardconstexpr

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

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

◆ crosses() [17/18]

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

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

◆ crosses() [18/18]

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

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

◆ distanceL1() [1/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [2/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [3/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [4/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [5/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [6/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [7/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [8/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [9/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [10/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [11/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [12/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [13/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [14/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [15/16]

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

Returns the Manhattan (L1) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceL1() [16/16]

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

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

◆ distanceLInf() [1/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [2/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [3/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [4/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [5/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [6/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [7/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [8/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [9/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [10/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [11/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [12/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [13/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [14/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [15/16]

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

Returns the Chebyshev (L∞) distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ distanceLInf() [16/16]

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

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

◆ edge()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
std::variant< Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > >, Line< Point< ResultNumber, typename PointType::LabelType > > > pgl::HalfplaneIntersection< PointType_, TLabel >::edge ( std::size_t i) const
inlineconstexpr

Returns the boundary contribution of half-plane i as a typed one-dimensional shape.

The edge lies on ∂halfplane(i) clipped by the two angular neighbors: a Segment when both neighbor vertices exist, a Ray when only one does, and the whole boundary Line otherwise. A degenerate region may produce a zero-length segment.

Warning
Divides coordinates after casting to ResultNumber; request pgl::Rational coordinates for exact endpoints.

◆ empty()

template<class PointType_, class TLabel>
bool pgl::HalfplaneIntersection< PointType_, TLabel >::empty ( ) const
inlineconstexpr

Returns whether the region is the empty set.

◆ end()

template<class PointType_, class TLabel>
auto pgl::HalfplaneIntersection< PointType_, TLabel >::end ( ) const
inlineconstexpr

Returns a constant iterator past the last half-plane.

◆ fbox()

template<class PointType, class LabelType>
template<std::floating_point ResultNumber>
Rectangle< Point< ResultNumber > > pgl::HalfplaneIntersection< PointType, LabelType >::fbox ( ) const
constexpr

Computes the floating-point bounding box of the region.

Throws std::logic_error when the region is empty or unbounded.

◆ get()

template<class PointType_, class TLabel>
const HalfplaneType & pgl::HalfplaneIntersection< PointType_, TLabel >::get ( std::ptrdiff_t index) const
inlineconstexpr

Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the end.

◆ getIfHalfplane()

template<class PointType, class LabelType>
std::optional< typename HalfplaneIntersection< PointType, LabelType >::HalfplaneType > pgl::HalfplaneIntersection< PointType, LabelType >::getIfHalfplane ( ) const
nodiscardconstexpr

Returns the half-plane the region equals, if it is one.

Exact: the stored constraint is returned as-is, with no division.

Returns
The half-plane if isHalfplane, std::nullopt otherwise.

◆ getIfLine()

template<class PointType, class LabelType>
std::optional< Line< PointType > > pgl::HalfplaneIntersection< PointType, LabelType >::getIfLine ( ) const
nodiscardconstexpr

Returns the line the region equals, if it is one.

Exact: every stored constraint of a line region is bounded by that line, so its boundary is returned directly, with no division.

Returns
The line if isLine, std::nullopt otherwise.

◆ getIfPoint()

template<class PointType, class LabelType>
template<class ResultNumber>
std::optional< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::getIfPoint ( ) const
nodiscardconstexpr

Returns the point the region collapses to, if it is one.

Template Parameters
ResultNumberCoordinate type of the returned point (default: division_result_t, which is exact).
Warning
Divides coordinates after casting to ResultNumber, so an explicitly requested integral ResultNumber truncates the result – and the point an integral region collapses to need not be on the lattice at all. The default is exact; isPoint is exact regardless.
Returns
The point if isPoint, std::nullopt otherwise.

◆ getIfRay()

template<class PointType, class LabelType>
template<class ResultNumber>
std::optional< Ray< Point< ResultNumber, typename PointType::LabelType > > > pgl::HalfplaneIntersection< PointType, LabelType >::getIfRay ( ) const
nodiscardconstexpr

Returns the ray the region equals, if it is one.

Template Parameters
ResultNumberCoordinate type of the returned ray (default: division_result_t, which is exact).
Warning
Divides coordinates after casting to ResultNumber, so an explicitly requested integral ResultNumber truncates the source – and the source of an integral region need not be on the lattice at all. The default is exact; isRay is exact regardless.
Returns
The ray if isRay, std::nullopt otherwise.

◆ getIfSegment()

template<class PointType, class LabelType>
template<class ResultNumber>
std::optional< Segment< Point< ResultNumber, typename PointType::LabelType > > > pgl::HalfplaneIntersection< PointType, LabelType >::getIfSegment ( ) const
nodiscardconstexpr

Returns the segment the region collapses to, if it is one.

Template Parameters
ResultNumberCoordinate type of the returned endpoints (default: division_result_t, which is exact).
Warning
Divides coordinates after casting to ResultNumber, so an explicitly requested integral ResultNumber truncates the endpoints – which need not be on the lattice at all, and may even round together. The default is exact; isSegment is exact regardless.
Returns
The segment if isSegment, std::nullopt otherwise.

◆ halfplanes()

template<class PointType_, class TLabel>
std::vector< HalfplaneType > pgl::HalfplaneIntersection< PointType_, TLabel >::halfplanes ( ) const
inlineconstexpr

Returns a copy of the stored half-planes, in boundary order.

◆ index()

template<class PointType_, class TLabel>
std::ptrdiff_t pgl::HalfplaneIntersection< PointType_, TLabel >::index ( const HalfplaneType & halfplane) const
inlineconstexpr

Returns the smallest index i with (*this)[i] == halfplane, or -1 if no stored half-plane equals it.

Complexity: O(log n).

◆ insert()

template<class PointType_, class TLabel>
template<HalfplaneConcept OtherHalfplane>
bool pgl::HalfplaneIntersection< PointType_, TLabel >::insert ( const OtherHalfplane & other)
inlineconstexpr

Intersects the region with one more half-plane.

The half-plane is discarded when it is redundant (the region is already contained in it). When it makes the intersection empty, the region switches to the sticky empty state. Otherwise the half-plane is stored and any stored half-planes it makes redundant are removed.

An undefined (degenerate) half-plane bounds no side of the plane, so it carries no constraint and is ignored, leaving the region unchanged.

Complexity: O(log n) comparisons amortized, plus O(n) vector element moves in the worst case.

Returns
true if the region changed, false if the half-plane was discarded as redundant or undefined.

◆ interiorContains() [1/19]

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

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

◆ interiorContains() [2/19]

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

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

◆ interiorContains() [3/19]

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

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

◆ interiorContains() [4/19]

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

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

◆ interiorContains() [5/19]

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

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

◆ interiorContains() [6/19]

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

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

◆ interiorContains() [7/19]

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

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

◆ interiorContains() [8/19]

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

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

◆ interiorContains() [9/19]

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

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

◆ interiorContains() [10/19]

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

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

◆ interiorContains() [11/19]

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

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

◆ interiorContains() [12/19]

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

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

◆ interiorContains() [13/19]

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

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

◆ interiorContains() [14/19]

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

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

◆ interiorContains() [15/19]

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

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

◆ interiorContains() [16/19]

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

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

◆ interiorContains() [17/19]

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

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

◆ interiorContains() [18/19]

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

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

◆ interiorContains() [19/19]

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

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

◆ interiorsIntersect() [1/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [2/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [3/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [4/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [5/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [6/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [7/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [8/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [9/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [10/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [11/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [12/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [13/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [14/18]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherRegion>
bool pgl::HalfplaneIntersection< PointType, LabelType >::interiorsIntersect ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [15/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [16/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

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

◆ interiorsIntersect() [17/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [18/18]

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

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ intersection() [1/15]

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

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

◆ intersection() [2/15]

template<class PointType, class LabelType>
template<class ResultNumber, ConvexConcept OtherConvex>
HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherConvex & other) const
nodiscardconstexpr

Returns the intersection with a convex polygon, as a half-plane intersection.

The result type is closed under intersecting with any convex polygonal region and requires no division, so the result is exact when ResultNumber can represent the input coordinates. The result may be empty (see empty) — no std::optional wrapper is needed.

◆ intersection() [3/15]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherHalfplane & other) const
nodiscardconstexpr

Returns the intersection with a half-plane, as a half-plane intersection.

The result type is closed under this operation and requires no division, so the intersection is exact when ResultNumber can represent the input coordinates. The result may be empty (see empty) — no std::optional wrapper is needed.

◆ intersection() [4/15]

template<class PointType, class LabelType>
template<class ResultNumber, LineConcept OtherLine>
std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > >, Line< Point< ResultNumber, typename PointType::LabelType > > > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherLine & other) const
nodiscardconstexpr

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

Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [5/15]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > >, Line< Point< ResultNumber, typename PointType::LabelType > > > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherOrientedLine & other) const
nodiscardconstexpr

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

Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [6/15]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedSegmentConcept OtherOrientedSegment>
std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherOrientedSegment & other) const
nodiscardconstexpr

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

Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [7/15]

template<class PointType, class LabelType>
template<class ResultNumber, PointConcept OtherPoint>
std::optional< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherPoint & other) const
nodiscardconstexpr

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

◆ intersection() [8/15]

template<class PointType, class LabelType>
template<class ResultNumber, PolygonConcept OtherPolygon>
std::vector< std::variant< Point< ResultNumber, typename PointType::LabelType >, Polyline< Point< ResultNumber, typename PointType::LabelType > >, Polygon< Point< ResultNumber, typename PointType::LabelType > > > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherPolygon & other) const
nodiscard

Returns the intersection with a simple polygon (A ∩ B), as components.

The polygon need not be convex, so the region's convexity buys nothing here: A ∩ B can be several disjoint pieces, and the result is the component vector Polygon::intersection(const OtherPolygon&) const returns — Point for an isolated boundary touch, Polyline for a shared stretch of boundary with no area beside it, Polygon for a filled piece — in no particular order. No component has a hole: both operands have a connected complement. See PolygonWithHoles::regularizedIntersection(const OtherPolygon&) const for the corresponding operation when a holed region participates.

The polygon is bounded, so the region is first clipped to the polygon's bounding rectangle; that leaves A ∩ B untouched — the polygon lies inside its own bounding rectangle — and makes even an unbounded region a convex polygon, which the polygon's own overload then handles. A region with empty interior contributes only its carrier — a point, a segment, a ray or a line — clipped to the polygon.

Complexity: O(n m log(n + m)) for n stored half-planes and m vertices.

Template Parameters
ResultNumberThe number type for the result.
OtherPolygonThe polygon type.
Parameters
otherThe polygon to intersect with.
Returns
The intersection components: points, polylines, and polygons.
Warning
The region's vertices are crossings of constraint lines and so are generally rational; ResultNumber must be able to represent them — ask for pgl::ERational (or another Rational) to keep the result exact. The clipping itself divides after casting to ResultNumber.

◆ intersection() [9/15]

template<class PointType, class LabelType>
template<class ResultNumber, RayConcept OtherRay>
std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > > > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherRay & other) const
nodiscardconstexpr

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

Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [10/15]

template<class PointType, class LabelType>
template<class ResultNumber, RectangleConcept OtherRectangle>
HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherRectangle & other) const
nodiscardconstexpr

Returns the intersection with a rectangle, as a half-plane intersection.

The result type is closed under intersecting with any convex polygonal region and requires no division, so the result is exact when ResultNumber can represent the input coordinates. The result may be empty (see empty) — no std::optional wrapper is needed.

◆ intersection() [11/15]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneIntersectionConcept OtherRegion>
HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherRegion & other) const
nodiscardconstexpr

Returns the intersection with another half-plane intersection.

The result type is closed under intersecting with any convex polygonal region and requires no division, so the result is exact when ResultNumber can represent the input coordinates. The result may be empty (see empty) — no std::optional wrapper is needed.

◆ intersection() [12/15]

template<class PointType, class LabelType>
template<class ResultNumber, SegmentConcept OtherSegment>
std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherSegment & other) const
nodiscardconstexpr

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

Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [13/15]

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

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

Forwards to the other shape's implementation so that each unordered pair needs intersection defined only once, on the higher-ranked shape. The result is then the higher-ranked shape's: intersecting with a PolygonWithHoles gives regions, not the component vector the polygon overload returns.

◆ intersection() [14/15]

template<class PointType, class LabelType>
template<class ResultNumber, TriangleConcept OtherTriangle>
HalfplaneIntersection< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType, LabelType >::intersection ( const OtherTriangle & other) const
nodiscardconstexpr

Returns the intersection with a triangle, as a half-plane intersection.

The result type is closed under intersecting with any convex polygonal region and requires no division, so the result is exact when ResultNumber can represent the input coordinates. The result may be empty (see empty) — no std::optional wrapper is needed.

◆ intersection() [15/15]

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

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

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

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

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

◆ intersects() [1/18]

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

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

◆ intersects() [2/18]

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

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

◆ intersects() [3/18]

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

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

◆ intersects() [4/18]

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

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

◆ intersects() [5/18]

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

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

◆ intersects() [6/18]

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

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

◆ intersects() [7/18]

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

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

◆ intersects() [8/18]

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

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

◆ intersects() [9/18]

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

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

◆ intersects() [10/18]

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

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

◆ intersects() [11/18]

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

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

◆ intersects() [12/18]

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

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

◆ intersects() [13/18]

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

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

◆ intersects() [14/18]

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

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

◆ intersects() [15/18]

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

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

◆ intersects() [16/18]

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

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

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

◆ intersects() [17/18]

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

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

◆ intersects() [18/18]

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

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

◆ isBounded()

template<class PointType_, class TLabel>
bool pgl::HalfplaneIntersection< PointType_, TLabel >::isBounded ( ) const
inlineconstexpr

Returns whether the region is bounded.

The empty region is bounded; the region is otherwise bounded exactly when there are at least three half-planes and every cyclic gap between consecutive boundary directions is below pi.

Complexity: O(n).

◆ isDegenerate()

template<class PointType_, class TLabel>
bool pgl::HalfplaneIntersection< PointType_, TLabel >::isDegenerate ( ) const
inlineconstexpr

Returns whether the region has empty interior (it is empty or lower-dimensional: a line, ray, segment, or point).

◆ isHalfplane()

template<class PointType, class LabelType>
bool pgl::HalfplaneIntersection< PointType, LabelType >::isHalfplane ( ) const
nodiscardconstexpr

Returns whether the region is exactly one closed half-plane.

A region equal to a half-plane keeps exactly one stored constraint: a half-plane can only contain another one when their boundaries share a direction, and insert replaces a same-direction constraint by the tighter one rather than storing both.

Complexity: O(1).

HalfplaneIntersection

Shape-recognition predicates: which lower- or full-dimensional shape the region actually is. Together with empty, isPlane and the ray case, these cover every region a half-plane intersection can describe.

◆ isLine()

template<class PointType, class LabelType>
bool pgl::HalfplaneIntersection< PointType, LabelType >::isLine ( ) const
nodiscardconstexpr

Returns whether the region is exactly one line.

A degenerate region is a point, a segment, a ray, or a line; of those only the line has no vertex, so no coordinate arithmetic is needed to recognize it.

Complexity: O(n).

◆ isPlane()

template<class PointType_, class TLabel>
bool pgl::HalfplaneIntersection< PointType_, TLabel >::isPlane ( ) const
inlineconstexpr

Returns whether the region is the whole plane (no half-planes).

◆ isPoint()

template<class PointType, class LabelType>
bool pgl::HalfplaneIntersection< PointType, LabelType >::isPoint ( ) const
nodiscardconstexpr

Returns whether the region is a single point.

Decided exactly, on rational coordinates when the region is integral, so a point whose coordinates are not representable in NumberType is still recognized. A non-degenerate region is rejected in O(1).

Complexity: O(n) exact-arithmetic vertex computations for a degenerate bounded region, O(n) otherwise.

◆ isRay()

template<class PointType, class LabelType>
bool pgl::HalfplaneIntersection< PointType, LabelType >::isRay ( ) const
nodiscardconstexpr

Returns whether the region is exactly one ray.

Recognized without coordinate arithmetic: among the degenerate regions a point and a segment are bounded, and of the two unbounded ones only the ray has a vertex (its source).

Complexity: O(n).

◆ isSegment()

template<class PointType, class LabelType>
bool pgl::HalfplaneIntersection< PointType, LabelType >::isSegment ( ) const
nodiscardconstexpr

Returns whether the region is a segment of positive length.

Decided exactly, on rational coordinates when the region is integral, so a point whose coordinates are not representable in NumberType is still recognized. A non-degenerate region is rejected in O(1).

Complexity: O(n) exact-arithmetic vertex computations for a degenerate bounded region, O(n) otherwise.

◆ isUndefined()

template<class PointType_, class TLabel>
bool pgl::HalfplaneIntersection< PointType_, TLabel >::isUndefined ( ) const
inlineconstexpr

Returns whether the region is undefined.

A region is never undefined: insert ignores undefined half-planes, so every representable region — including the empty set and the lower-dimensional ones — has a well-defined interpretation. Provided for uniformity with the other shapes.

Returns
false.

◆ label()

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

Returns the label.

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

◆ latticePoints()

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

Returns the integer points the region contains.

The boundary included, as everywhere else. The region is read as the exact convex polygon its constraints cut out – its vertices are crossings, so they are generally not on the grid themselves – and the points come from a sweep over that polygon's columns.

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

◆ minkowskiErosion()

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

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

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

Eroding by a Point is the translation by its negation, so it returns this shape's own type; the other pairs come back as the convex region they are, a HalfplaneIntersection, which holds a lower-dimensional erosion and the empty one as readily as a two-dimensional one. A region of constraints erodes by moving each of them in, which is exact in its own coordinates.

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

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

◆ minkowskiSum()

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

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

The sum is the point set {a + b : a ∈ A, b ∈ B}. Summing with a Point is a translation, so it returns this shape's own type. Every other sum comes back as a HalfplaneIntersection again: the operand may be any unbounded convex shape (UnboundedConvexConcept) or any bounded convex one, and the sum of two convex polyhedra is a convex polyhedron — bounded here only when both operands are. A non-convex operand is refused, its concavity being swept into the answer rather than absorbed. See MinkowskiSummableConcept.

A region is also the one operand whose sum is not on the operands' own lattice: its vertices are crossings of stored boundary lines, so the result carries division_result_t coordinates, exactly as vertex and getIfPoint report one.

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

◆ operator*=() [1/2]

template<class PointType_, class TLabel>
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
HalfplaneIntersection< PointType, LabelType > & pgl::HalfplaneIntersection< PointType_, TLabel >::operator*= ( const Scalar & scalar)
constexpr

◆ operator*=() [2/2]

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

Scales the region around the origin by a scalar in place.

◆ operator+=() [1/2]

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
HalfplaneIntersection< PointType, LabelType > & pgl::HalfplaneIntersection< PointType_, TLabel >::operator+= ( const OtherPoint & translation)
constexpr

◆ operator+=() [2/2]

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
HalfplaneIntersection & pgl::HalfplaneIntersection< PointType_, TLabel >::operator+= ( const OtherPoint & translation)
constexpr

Translates the region by the given point in place.

◆ operator-=() [1/2]

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
HalfplaneIntersection< PointType, LabelType > & pgl::HalfplaneIntersection< PointType_, TLabel >::operator-= ( const OtherPoint & translation)
constexpr

◆ operator-=() [2/2]

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
HalfplaneIntersection & pgl::HalfplaneIntersection< PointType_, TLabel >::operator-= ( const OtherPoint & translation)
constexpr

Translates the region by the negation of the given point in place.

◆ operator/=() [1/2]

template<class PointType_, class TLabel>
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
HalfplaneIntersection< PointType, LabelType > & pgl::HalfplaneIntersection< PointType_, TLabel >::operator/= ( const Scalar & scalar)
constexpr

◆ operator/=() [2/2]

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

Divides the region coordinates by a scalar in place.

◆ operator<=>()

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

Provides an ordering compatible with operator==.

◆ operator=()

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

Assigns from a half-plane intersection with a compatible point type.

◆ operator==()

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

Tests equality of the stored regions.

All empty regions are equal. For full-dimensional regions the stored non-redundant half-planes are a canonical function of the point set, so this is geometric equality; for lower-dimensional regions it is representational (same point set and same stored constraints).

◆ operator[]()

template<class PointType_, class TLabel>
const HalfplaneType & pgl::HalfplaneIntersection< PointType_, TLabel >::operator[] ( std::size_t index) const
inlineconstexpr

Accesses a stored half-plane by index, in boundary (counterclockwise pseudo-angle) order.

◆ pointInside()

template<class PointType, class LabelType>
template<class ResultNumber>
Point< ResultNumber > pgl::HalfplaneIntersection< PointType, LabelType >::pointInside ( ) const
nodiscardconstexpr

Returns a representative point of the region: a point of its interior when the region is full-dimensional, and a point of the region otherwise.

The empty region has no points; querying it is undefined behavior.

Warning
Divides coordinates after casting to ResultNumber; request a pgl::Rational result type for an exact witness.

◆ pointInsideInteriorContainedIn()

template<class PointType, class LabelType>
template<class OtherShape>
bool pgl::HalfplaneIntersection< PointType, LabelType >::pointInsideInteriorContainedIn ( const OtherShape & shape) const
nodiscardconstexpr

Tests whether an exact interior witness of this region lies in the interior of the given shape.

Precondition: the region is full-dimensional (see isDegenerate).

◆ regularizedIntersection() [1/2]

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

Forwards a regularized intersection to the shape that owns it.

◆ regularizedIntersection() [2/2]

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

Re-dispatches a regularized intersection through a runtime shape.

◆ rotate90()

template<class PointType, class LabelType>
void pgl::HalfplaneIntersection< PointType, LabelType >::rotate90 ( int k = 1)
constexpr

Rotates the region by 90k degrees around the origin in place.

◆ rotated90()

template<class PointType, class LabelType>
HalfplaneIntersection< PointType, LabelType > pgl::HalfplaneIntersection< PointType, LabelType >::rotated90 ( int k = 1) const
nodiscardconstexpr

Returns the region rotated by 90k degrees around the origin.

◆ samePointSet()

template<class PointType, class LabelType>
template<AnyShapeConcept OtherShape>
bool pgl::HalfplaneIntersection< PointType, LabelType >::samePointSet ( const OtherShape & other) const
nodiscardconstexpr

Tests whether another shape defines exactly the same point set.

◆ scaledDownX() [1/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection< PointType, LabelType > pgl::HalfplaneIntersection< PointType_, TLabel >::scaledDownX ( const OtherNumber scalar) const
constexpr

◆ scaledDownX() [2/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection pgl::HalfplaneIntersection< PointType_, TLabel >::scaledDownX ( const OtherNumber scalar) const
nodiscardconstexpr

Returns the region with its x-coordinates divided by a divisor.

Warning
Inexact for integer coordinates.

◆ scaledDownY() [1/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection< PointType, LabelType > pgl::HalfplaneIntersection< PointType_, TLabel >::scaledDownY ( const OtherNumber scalar) const
constexpr

◆ scaledDownY() [2/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection pgl::HalfplaneIntersection< PointType_, TLabel >::scaledDownY ( const OtherNumber scalar) const
nodiscardconstexpr

Returns the region with its y-coordinates divided by a divisor.

Warning
Inexact for integer coordinates.

◆ scaleDownX()

template<class PointType, class LabelType>
template<class OtherNumber>
void pgl::HalfplaneIntersection< PointType, LabelType >::scaleDownX ( const OtherNumber scalar)
constexpr

Divides the region's x-coordinates by a divisor in place.

Warning
Inexact for integer coordinates.

◆ scaleDownY()

template<class PointType, class LabelType>
template<class OtherNumber>
void pgl::HalfplaneIntersection< PointType, LabelType >::scaleDownY ( const OtherNumber scalar)
constexpr

Divides the region's y-coordinates by a divisor in place.

Warning
Inexact for integer coordinates.

◆ scaledUpX() [1/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection< PointType, LabelType > pgl::HalfplaneIntersection< PointType_, TLabel >::scaledUpX ( const OtherNumber scalar) const
constexpr

◆ scaledUpX() [2/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection pgl::HalfplaneIntersection< PointType_, TLabel >::scaledUpX ( const OtherNumber scalar) const
nodiscardconstexpr

Returns the region with its x-coordinates multiplied by a factor.

◆ scaledUpY() [1/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection< PointType, LabelType > pgl::HalfplaneIntersection< PointType_, TLabel >::scaledUpY ( const OtherNumber scalar) const
constexpr

◆ scaledUpY() [2/2]

template<class PointType_, class TLabel>
template<class OtherNumber>
HalfplaneIntersection pgl::HalfplaneIntersection< PointType_, TLabel >::scaledUpY ( const OtherNumber scalar) const
nodiscardconstexpr

Returns the region with its y-coordinates multiplied by a factor.

◆ scaleUpX()

template<class PointType, class LabelType>
template<class OtherNumber>
void pgl::HalfplaneIntersection< PointType, LabelType >::scaleUpX ( const OtherNumber scalar)
constexpr

Multiplies the region's x-coordinates by a factor in place.

◆ scaleUpY()

template<class PointType, class LabelType>
template<class OtherNumber>
void pgl::HalfplaneIntersection< PointType, LabelType >::scaleUpY ( const OtherNumber scalar)
constexpr

Multiplies the region's y-coordinates by a factor in place.

◆ separates() [1/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [2/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [3/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [4/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [5/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [6/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherHoledRegion>
bool pgl::HalfplaneIntersection< PointType, LabelType >::separates ( const OtherHoledRegion & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

The region is settled by the cell engine of implementation/separates.hpp; see the notes on pgl::PolygonWithHoles::separates for what a region admits that a simply connected target does not.

◆ separates() [7/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [8/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [9/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [10/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::HalfplaneIntersection< PointType, LabelType >::separates ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [11/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [12/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [13/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [14/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [15/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherRegion>
bool pgl::HalfplaneIntersection< PointType, LabelType >::separates ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [16/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [17/19]

template<class PointType, class LabelType>
template<PolygonSetConcept OtherSet>
bool pgl::HalfplaneIntersection< PointType, LabelType >::separates ( const OtherSet & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

A set of regions is the one target that may already be in several pieces before anything is removed, so this neither folds over its components nor answers false for a remover that misses it. See implementation/separates.hpp.

◆ separates() [18/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [19/19]

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

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ size()

template<class PointType_, class TLabel>
std::size_t pgl::HalfplaneIntersection< PointType_, TLabel >::size ( ) const
inlineconstexpr

Returns the number of stored (non-redundant) half-planes.

◆ squaredDistance() [1/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [2/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [3/16]

template<class PointType, class LabelType>
template<class ResultNumber, DiskConcept OtherDisk>
detail::floating_result_t< ResultNumber > pgl::HalfplaneIntersection< PointType, LabelType >::squaredDistance ( const OtherDisk & other) const
nodiscard

Returns the squared Euclidean distance to the given disk.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double.

◆ squaredDistance() [4/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [5/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [6/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [7/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [8/16]

template<class PointType, class LabelType>
template<class ResultNumber, PointConcept OtherPoint>
auto pgl::HalfplaneIntersection< PointType, LabelType >::squaredDistance ( const OtherPoint & other) const
nodiscardconstexpr

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [9/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [10/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [11/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [12/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [13/16]

template<class PointType, class LabelType>
template<class ResultNumber, HalfplaneIntersectionConcept OtherRegion>
auto pgl::HalfplaneIntersection< PointType, LabelType >::squaredDistance ( const OtherRegion & other) const
nodiscardconstexpr

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [14/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [15/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ squaredDistance() [16/16]

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

Returns the squared Euclidean distance to the given shape.

Warning
Divides after casting to ResultNumber; request a floating-point or pgl::Rational result type for an accurate value.

◆ twiceArea()

template<class PointType, class LabelType>
template<class ResultNumber>
auto pgl::HalfplaneIntersection< PointType, LabelType >::twiceArea ( ) const
nodiscardconstexpr

Returns twice the area of the region.

Throws std::logic_error when the region is unbounded (including the whole plane); the empty and degenerate regions have area zero.

Warning
Divides coordinates after casting to ResultNumber when computing the vertices; request a pgl::Rational result type for an exact value.

◆ vertex()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
Point< ResultNumber, typename PointType::LabelType > pgl::HalfplaneIntersection< PointType_, TLabel >::vertex ( std::size_t i) const
inlineconstexpr

Returns the vertex between half-planes i and i+1 (cyclically).

The pair must define a vertex (see vertexExists). For a bounded region, ascending i walks the vertices counterclockwise.

Template Parameters
ResultNumberCoordinate type of the returned point (default: division_result_t, which is exact).
Warning
Divides coordinates after casting to ResultNumber, so an explicitly requested integral ResultNumber truncates the vertex – which need not be on the lattice at all. The default is exact.

◆ vertexCount()

template<class PointType_, class TLabel>
std::size_t pgl::HalfplaneIntersection< PointType_, TLabel >::vertexCount ( ) const
inlineconstexpr

Returns the number of vertices of the region.

A vertex exists between cyclically consecutive half-planes whose boundary-direction gap is below pi. Complexity: O(n).

◆ vertexExists()

template<class PointType_, class TLabel>
bool pgl::HalfplaneIntersection< PointType_, TLabel >::vertexExists ( std::size_t i) const
inlineconstexpr

Returns whether the half-plane pair (i, i+1) (cyclically) defines a vertex of the region.

◆ vertices()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
std::vector< Point< ResultNumber, typename PointType::LabelType > > pgl::HalfplaneIntersection< PointType_, TLabel >::vertices ( ) const
inlineconstexpr

Returns every vertex of the region, in pair-index order (for a bounded region: counterclockwise).

The pair must define a vertex (see vertexExists). For a bounded region, ascending i walks the vertices counterclockwise.

Template Parameters
ResultNumberCoordinate type of the returned point (default: division_result_t, which is exact).
Warning
Divides coordinates after casting to ResultNumber, so an explicitly requested integral ResultNumber truncates the vertex – which need not be on the lattice at all. The default is exact.

◆ HalfplaneIntersection

template<class PointType_, class TLabel>
template<class OtherPointType, class OtherLabelType>
friend struct HalfplaneIntersection
friend