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

Closed half-plane defined by an oriented boundary line. More...

#include <halfplane.hpp>

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

Public Types

using PointType = PointType_
using NumberType = PointType::NumberType
using LabelType = TLabel
using CoordinateType = detail::promoted_number_t<NumberType>

Public Member Functions

constexpr Halfplane ()=default
 Creates the degenerate half-plane (0,0)->(0,0).
constexpr Halfplane (PointType source, PointType target)
 Creates a half-plane from an oriented boundary line.
constexpr Halfplane (NumberType x1, NumberType y1, NumberType x2, NumberType y2)
 Creates a half-plane from four coordinates.
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
constexpr Halfplane (PointType source, PointType target, A &&label)
 Creates a half-plane from an oriented boundary and stores a label.
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
constexpr Halfplane (NumberType x1, NumberType y1, NumberType x2, NumberType y2, A &&label)
 Same as the four-coordinate constructor, and stores a label.
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
constexpr Halfplane (const Halfplane< OtherPointType, OtherLabelType > &other)
 Converts a half-plane with a different point and/or label type.
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
constexpr Halfplaneoperator= (const Halfplane< OtherPointType, OtherLabelType > &other)
 Assigns from a half-plane with compatible point and label types.
constexpr const PointTypeoperator[] (std::size_t index) const
 Returns defining point 0 for the source and 1 for the target.
constexpr PointTypeoperator[] (std::size_t index)
 Returns defining point 0 for the source and 1 for the target.
constexpr const PointTypeget (std::ptrdiff_t index) const
 Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the end.
constexpr PointTypeget (std::ptrdiff_t index)
constexpr std::ptrdiff_t index (const PointType &point) const
 Returns the smallest index i with (*this)[i] == point, or -1 if no defining point equals point.
constexpr const PointTypesource () const
 Returns the source boundary point.
constexpr PointTypesource ()
constexpr const PointTypetarget () const
 Returns the target boundary point.
constexpr PointTypetarget ()
constexpr const PointTypemin () const
 Returns the lexicographically smallest defining point.
constexpr const PointTypemax () const
 Returns the lexicographically largest defining point.
constexpr Halfplane opposite () const
 Returns the complementary half-plane with reversed boundary orientation.
constexpr auto begin () const
 Returns an iterator to the source defining point.
constexpr auto begin ()
constexpr auto cbegin () const
 Returns an iterator to the source defining point.
constexpr auto end () const
 Returns an iterator past the target defining point.
constexpr auto end ()
constexpr auto cend () const
 Returns an iterator past the target defining point.
constexpr bool operator== (const Halfplane &other) const
 Tests equality of the represented half-plane.
template<AnyShapeConcept OtherShape>
constexpr bool samePointSet (const OtherShape &other) const
 Tests whether another shape defines exactly the same point set.
constexpr auto operator<=> (const Halfplane &other) const
 Provides an ordering compatible with half-plane equality.
template<class A = LabelType>
requires (detail::has_label_v<A>)
constexpr A & label () const
 Returns the half-plane label.
constexpr operator Line< PointType > () const
 Converts to the unoriented boundary line.
constexpr Line< PointTypeasLine () const
 Returns the boundary line without orientation.
constexpr operator OrientedLine< PointType > () const
 Converts to the oriented boundary line.
constexpr OrientedLine< PointTypeasOrientedLine () const
 Returns the oriented boundary line.
constexpr operator HalfplaneIntersection< PointType > () const
 Converts to the equivalent one-constraint half-plane intersection.
constexpr HalfplaneIntersection< PointTypeasHalfplaneIntersection () const
 Returns the half-plane as a half-plane intersection.
constexpr Halfplane rotated90 (int k=1) const
 Returns the half-plane rotated by 90k degrees around the origin.
constexpr void rotate90 (int k=1)
 Rotates the half-plane by 90k degrees around the origin in place.
template<class OtherNumber>
constexpr Halfplane scaledUpX (const OtherNumber scalar) const
 Returns the half-plane with its x-coordinates multiplied by a factor.
template<class OtherNumber>
constexpr void scaleUpX (const OtherNumber scalar)
 Multiplies the half-plane's x-coordinates by a factor in place.
template<class OtherNumber>
constexpr Halfplane scaledUpY (const OtherNumber scalar) const
 Returns the half-plane with its y-coordinates multiplied by a factor.
template<class OtherNumber>
constexpr void scaleUpY (const OtherNumber scalar)
 Multiplies the half-plane's y-coordinates by a factor in place.
template<class OtherNumber>
constexpr Halfplane scaledDownX (const OtherNumber scalar) const
 Returns the half-plane with its x-coordinates divided by a divisor.
template<class OtherNumber>
constexpr void scaleDownX (const OtherNumber scalar)
 Divides the half-plane's x-coordinates by a divisor in place.
template<class OtherNumber>
constexpr Halfplane scaledDownY (const OtherNumber scalar) const
 Returns the half-plane with its y-coordinates divided by a divisor.
template<class OtherNumber>
constexpr void scaleDownY (const OtherNumber scalar)
 Divides the half-plane's y-coordinates by a divisor in place.
constexpr bool isDegenerate () const
 Returns whether the defining points coincide.
constexpr bool isUndefined () const
 Returns whether the half-plane is degenerate without collapsing to a point or to a segment.
constexpr bool isVertical () const
 Returns whether the boundary line is vertical.
constexpr bool isHorizontal () const
 Returns whether the boundary line is horizontal.
template<PointConcept OtherPoint>
constexpr bool verticesContain (const OtherPoint &point) const
 Returns whether the given point is one of the stored defining points.
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<LineConcept OtherLine>
constexpr bool boundaryContains (const OtherLine &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<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<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<HalfplaneConcept OtherHalfplane>
constexpr bool boundaryContains (const OtherHalfplane &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool boundaryContains (const OtherConvex &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool boundaryContains (const OtherPolygon &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool boundaryContains (const OtherDisk &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool contains (const OtherPoint &point) 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<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<RayConcept OtherRay>
constexpr bool contains (const OtherRay &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<HalfplaneConcept OtherHalfplane>
constexpr bool contains (const OtherHalfplane &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool contains (const OtherTriangle &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool contains (const OtherConvex &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool contains (const OtherPolygon &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool contains (const OtherDisk &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
constexpr bool contains (const Shape< PointType > &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
constexpr bool boundaryContains (const Shape< PointType > &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
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 separates (const EmptyShape< EmptyPoint > &) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PointConcept OtherPoint>
constexpr bool interiorContains (const OtherPoint &point) 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<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<RayConcept OtherRay>
constexpr bool interiorContains (const OtherRay &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<HalfplaneConcept OtherHalfplane>
constexpr bool interiorContains (const OtherHalfplane &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool interiorContains (const OtherTriangle &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool interiorContains (const OtherConvex &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool interiorContains (const OtherDisk &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<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<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<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 ≠ ∅).
constexpr bool intersects (const Shape< PointType > &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Halfplane>)
constexpr bool intersects (const OtherShape &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<class EmptyPoint>
constexpr bool intersects (const EmptyShape< EmptyPoint > &) 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<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<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<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<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Halfplane>)
constexpr bool interiorsIntersect (const OtherShape &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<class EmptyPoint>
constexpr bool interiorsIntersect (const EmptyShape< EmptyPoint > &) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
constexpr bool interiorsIntersect (const Shape< PointType > &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<LineConcept OtherLine>
constexpr bool separates (const OtherLine &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PointConcept OtherPoint>
constexpr bool separates (const OtherPoint &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<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<RayConcept OtherRay>
constexpr bool separates (const OtherRay &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<HalfplaneConcept OtherHalfplane>
constexpr bool separates (const OtherHalfplane &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<ConvexConcept OtherConvex>
constexpr bool separates (const OtherConvex &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<MonotoneChainConcept OtherChain>
constexpr bool contains (const OtherChain &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool boundaryContains (const OtherChain &other) const
 Tests whether this shape's boundary contains the other shape (∂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<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 contains (const OtherPolyline &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool boundaryContains (const OtherPolyline &other) const
 Tests whether this shape's boundary contains the other shape (∂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<PolylineConcept OtherPolyline>
constexpr bool separates (const OtherPolyline &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool contains (const OtherRegion &other) const
 Tests whether this shape 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<HalfplaneIntersectionConcept OtherRegion>
constexpr bool interiorContains (const OtherRegion &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
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 OtherRegion>
constexpr bool contains (const OtherRegion &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool boundaryContains (const OtherRegion &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool interiorContains (const OtherRegion &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
bool separates (const OtherRegion &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<DiskConcept OtherDisk>
constexpr bool separates (const OtherDisk &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
constexpr bool separates (const Shape< PointType > &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolygonConcept OtherPolygon>
constexpr bool interiorContains (const OtherPolygon &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<LineConcept OtherLine>
constexpr bool crosses (const OtherLine &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PointConcept OtherPoint>
constexpr bool crosses (const OtherPoint &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<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<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<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Halfplane>)
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 crosses (const EmptyShape< EmptyPoint > &) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
constexpr bool crosses (const Shape< PointType > &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 >, Line< Point< ResultNumber, typename PointType::LabelType > >, Ray< 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 >, Line< Point< ResultNumber, typename PointType::LabelType > >, Ray< 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 of the two half-planes as a half-plane intersection.
template<class ResultNumber = NumberType, HalfplaneIntersectionConcept OtherRegion>
constexpr auto intersection (const OtherRegion &other) const
 Adds this half-plane to an existing half-plane intersection without deriving vertices.
template<class ResultNumber = division_result_t<NumberType>, typename OtherShape>
requires (!PointConcept<OtherShape> && !HalfplaneIntersectionConcept<OtherShape> && (detail::shapeRank<OtherShape>
> detail::shapeRank<Halfplane>) && requires(const OtherShape& o, const Halfplane& self) { o.template intersection
<ResultNumber>(self); })
constexpr 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<Halfplane>) && requires(const
OtherShape& o, const Halfplane& self) { o.template regularizedIntersection<ResultNumber>(self); })
constexpr auto regularizedIntersection (const OtherShape &other) const
 Forwards a regularized intersection to the shape that owns it.
template<class ResultNumber = NumberType, class EmptyPoint>
constexpr EmptyShape< EmptyPoint > intersection (const EmptyShape< EmptyPoint > &) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto squaredDistance (const OtherPoint &point) 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>, typename OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Halfplane>) && requires(const OtherShape& o, const Halfplane& 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 = double, class DiskPointType, class DiskLabel>
detail::floating_result_t< ResultNumber > squaredDistance (const Disk< DiskPointType, DiskLabel > &disk) const
 Returns the squared Euclidean distance to a disk.
template<class ResultNumber = division_result_t<NumberType>, class OtherShape>
requires detail::ClosestPointsPairConcept<Halfplane<PointType_, TLabel>, OtherShape>
constexpr auto closestPoints (const OtherShape &other) const
 Returns the pair of points realizing the distance, nothing when the shapes meet.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto distanceL1 (const OtherPoint &point) const
 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>, typename OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Halfplane>) && requires(const OtherShape& o, const Halfplane& 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>, 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 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 &point) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
constexpr auto distanceLInf (const OtherSegment &other) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
constexpr auto distanceLInf (const OtherOrientedSegment &other) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
constexpr auto distanceLInf (const OtherLine &other) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
constexpr auto distanceLInf (const OtherOrientedLine &other) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
constexpr auto distanceLInf (const OtherRay &other) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
constexpr auto distanceLInf (const OtherHalfplane &other) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = division_result_t<NumberType>, typename OtherShape>
requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Halfplane>) && requires(const OtherShape& o, const Halfplane& self)
{ o.template distanceLInf<ResultNumber>(self); })
constexpr auto distanceLInf (const OtherShape &other) const
 Returns the Chebyshev (LInf) distance to the given shape.
template<class ResultNumber = double, PointConcept OtherPoint>
constexpr auto distanceLInf (const Shape< OtherPoint > &other) const
 Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceLInf.
template<class ResultNumber = division_result_t<NumberType>>
constexpr ResultNumber slope () const
 Returns the slope of the boundary line.
template<class OtherShape>
requires MinkowskiSummableConcept<Halfplane<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<Halfplane<PointType_, TLabel>, OtherShape>
constexpr auto minkowskiErosion (const OtherShape &other) const
 Returns the Minkowski erosion of this shape by another (A ⊖ B).
template<class ResultNumber = double, DiskConcept OtherDisk>
Halfplane< Point< ResultNumber, typename PointType_::LabelType > > minkowskiErosion (const OtherDisk &other) const
 Returns the Minkowski erosion of this half-plane by a disk (A ⊖ B), a half-plane.
template<class ResultNumber = double, DiskConcept OtherDisk>
Halfplane< Point< ResultNumber, typename PointType_::LabelType > > minkowskiSum (const OtherDisk &other) const
 Returns the Minkowski sum of this half-plane and a disk (A ⊕ B), a half-plane.
template<PointConcept OtherPoint>
constexpr Halfplaneoperator+= (const OtherPoint &translation)
 Translates the half-plane by the given point in place.
template<PointConcept OtherPoint>
constexpr Halfplaneoperator-= (const OtherPoint &translation)
 Translates the half-plane by the negation of the given point in place.
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr Halfplaneoperator*= (const Scalar &scalar)
 Scales the half-plane around the origin by a scalar in place.
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr Halfplaneoperator/= (const Scalar &scalar)
 Divides the half-plane coordinates by a scalar in place.
template<class ResultNumber = NumberType>
constexpr Point< ResultNumber > pointInside () const
 Returns a point inside the halfplane.
template<class OtherShape>
constexpr bool pointInsideInteriorContainedIn (const OtherShape &shape) const
 Tests whether some point in this shape's relative interior lies in the strict interior of shape.
template<PointConcept OtherPoint>
constexpr Halfplane< PointType, LabelType > & operator+= (const OtherPoint &translation)
template<PointConcept OtherPoint>
constexpr Halfplane< PointType, LabelType > & operator-= (const OtherPoint &translation)
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr Halfplane< PointType, LabelType > & operator*= (const Scalar &scalar)
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr Halfplane< PointType, LabelType > & operator/= (const Scalar &scalar)
template<class OtherNumber>
constexpr Halfplane< PointType, LabelTypescaledUpX (const OtherNumber scalar) const
template<class OtherNumber>
constexpr Halfplane< PointType, LabelTypescaledUpY (const OtherNumber scalar) const
template<class OtherNumber>
constexpr Halfplane< PointType, LabelTypescaledDownX (const OtherNumber scalar) const
template<class OtherNumber>
constexpr Halfplane< PointType, LabelTypescaledDownY (const OtherNumber scalar) const

Static Public Member Functions

static constexpr std::size_t size ()
 Returns the number of defining points (always 2).

Detailed Description

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

Closed half-plane defined by an oriented boundary line.

Closed half-plane stored by an oriented boundary line.

The half-plane contains all points on the left side of the oriented line from source to target, including the boundary itself.

Template Parameters
PointTypeDefining point type.

Member Typedef Documentation

◆ CoordinateType

template<class PointType_, class TLabel>
using pgl::Halfplane< PointType_, TLabel >::CoordinateType = detail::promoted_number_t<NumberType>

◆ LabelType

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

◆ NumberType

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

◆ PointType

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

Constructor & Destructor Documentation

◆ Halfplane() [1/6]

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

Creates the degenerate half-plane (0,0)->(0,0).

◆ Halfplane() [2/6]

template<class PointType_, class TLabel>
pgl::Halfplane< PointType_, TLabel >::Halfplane ( PointType source,
PointType target )
inlineconstexpr

Creates a half-plane from an oriented boundary line.

The point order is preserved exactly as provided.

Parameters
sourceSource boundary point.
targetTarget boundary point.

◆ Halfplane() [3/6]

template<class PointType_, class TLabel>
pgl::Halfplane< PointType_, TLabel >::Halfplane ( NumberType x1,
NumberType y1,
NumberType x2,
NumberType y2 )
inlineconstexpr

Creates a half-plane from four coordinates.

Parameters
x1X coordinate of the source boundary point.
y1Y coordinate of the source boundary point.
x2X coordinate of the target boundary point.
y2Y coordinate of the target boundary point.

◆ Halfplane() [4/6]

template<class PointType_, class TLabel>
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
pgl::Halfplane< PointType_, TLabel >::Halfplane ( PointType source,
PointType target,
A && label )
inlineconstexpr

Creates a half-plane from an oriented boundary and stores a label.

The point order is preserved exactly as provided.

Template Parameters
AType convertible to LabelType.

◆ Halfplane() [5/6]

template<class PointType_, class TLabel>
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
pgl::Halfplane< PointType_, TLabel >::Halfplane ( NumberType x1,
NumberType y1,
NumberType x2,
NumberType y2,
A && label )
inlineconstexpr

Same as the four-coordinate constructor, and stores a label.

◆ Halfplane() [6/6]

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

Converts a half-plane with a different point and/or label type.

The boundary points are converted to PointType, preserving their order, and the label is copied when both sides carry one.

Member Function Documentation

◆ asHalfplaneIntersection()

template<class PointType_, class TLabel>
HalfplaneIntersection< PointType > pgl::Halfplane< PointType_, TLabel >::asHalfplaneIntersection ( ) const
inlinenodiscardconstexpr

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

Returns
Half-plane intersection whose single stored half-plane is this one.

◆ asLine()

template<class PointType_, class TLabel>
Line< PointType > pgl::Halfplane< PointType_, TLabel >::asLine ( ) const
inlinenodiscardconstexpr

Returns the boundary line without orientation.

Returns
Boundary line of the half-plane.

◆ asOrientedLine()

template<class PointType_, class TLabel>
OrientedLine< PointType > pgl::Halfplane< PointType_, TLabel >::asOrientedLine ( ) const
inlinenodiscardconstexpr

Returns the oriented boundary line.

Returns
Oriented boundary line of the half-plane.

◆ begin() [1/2]

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

◆ begin() [2/2]

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

Returns an iterator to the source defining point.

Returns
Pointer to the source point.

◆ boundaryContains() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Halfplane< 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::Halfplane< 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 TLabel>
template<ConvexConcept OtherConvex>
bool pgl::Halfplane< PointType_, TLabel >::boundaryContains ( const OtherConvex & other) const
inlinenodiscardconstexpr

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

◆ boundaryContains() [4/19]

template<class PointType_, class TLabel>
template<DiskConcept OtherDisk>
bool pgl::Halfplane< PointType_, TLabel >::boundaryContains ( const OtherDisk & other) const
inlinenodiscardconstexpr

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::Halfplane< PointType, LabelType >::boundaryContains ( const OtherHalfplane< PointType_, TLabel > & other) const
nodiscardconstexpr

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

◆ boundaryContains() [6/19]

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

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

◆ boundaryContains() [7/19]

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

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

◆ boundaryContains() [8/19]

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

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

◆ boundaryContains() [9/19]

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

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

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ boundaryContains() [10/19]

template<class PointType_, class TLabel>
template<PolygonConcept OtherPolygon>
bool pgl::Halfplane< PointType_, TLabel >::boundaryContains ( const OtherPolygon & other) const
inlinenodiscardconstexpr

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

◆ boundaryContains() [11/19]

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

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

◆ boundaryContains() [12/19]

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

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

◆ boundaryContains() [13/19]

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

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

◆ boundaryContains() [14/19]

template<class PointType_, class TLabel>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Halfplane< PointType_, TLabel >::boundaryContains ( const OtherRegion & 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() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< 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>
bool pgl::Halfplane< PointType, LabelType >::boundaryContains ( const Shape< PointType > & other) const
nodiscardconstexpr

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

◆ cbegin()

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

Returns an iterator to the source defining point.

Returns
Pointer to the source point.

◆ cend()

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

Returns an iterator past the target defining point.

Returns
Pointer past the target point.

◆ closestPoints()

template<class PointType_, class TLabel>
requires detail::ClosestPointsPairConcept<Halfplane<PointType_, TLabel>, OtherShape>
template<class ResultNumber, class OtherShape>
requires detail::ClosestPointsPairConcept<Halfplane<PointType_, TLabel>, OtherShape>
auto pgl::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< PointType, LabelType >::contains ( const OtherHalfplane< PointType_, TLabel > & other) const
nodiscardconstexpr

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

◆ contains() [6/19]

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

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

◆ contains() [7/19]

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

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

◆ contains() [8/19]

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

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

◆ contains() [9/19]

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

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

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ contains() [10/19]

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

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

◆ contains() [11/19]

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

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

◆ contains() [12/19]

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

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

◆ contains() [13/19]

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

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

◆ contains() [14/19]

template<class PointType_, class TLabel>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Halfplane< PointType_, TLabel >::contains ( const OtherRegion & 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() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< 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>
bool pgl::Halfplane< PointType, LabelType >::contains ( const Shape< PointType > & other) const
nodiscardconstexpr

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

◆ crosses() [1/10]

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

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

◆ crosses() [2/10]

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

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

◆ crosses() [3/10]

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

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

◆ crosses() [4/10]

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

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

◆ crosses() [5/10]

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

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

◆ crosses() [6/10]

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

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

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ crosses() [7/10]

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

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

◆ crosses() [8/10]

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

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

◆ crosses() [9/10]

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

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

◆ crosses() [10/10]

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

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

◆ distanceL1() [1/9]

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

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

◆ distanceL1() [2/9]

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

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

◆ distanceL1() [3/9]

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

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

◆ distanceL1() [4/9]

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

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

◆ distanceL1() [5/9]

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

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

◆ distanceL1() [6/9]

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

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

◆ distanceL1() [7/9]

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

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

◆ distanceL1() [8/9]

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

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

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

◆ distanceL1() [9/9]

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

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

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

◆ distanceLInf() [1/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

◆ distanceLInf() [2/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

◆ distanceLInf() [3/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

◆ distanceLInf() [4/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

◆ distanceLInf() [5/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

◆ distanceLInf() [6/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

◆ distanceLInf() [7/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

◆ distanceLInf() [8/9]

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

Returns the Chebyshev (LInf) distance to the given shape.

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

◆ distanceLInf() [9/9]

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

Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own distanceLInf.

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

◆ end() [1/2]

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

◆ end() [2/2]

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

Returns an iterator past the target defining point.

Returns
Pointer past the target point.

◆ get() [1/2]

template<class PointType_, class TLabel>
PointType & pgl::Halfplane< PointType_, TLabel >::get ( std::ptrdiff_t index)
inlineconstexpr

◆ get() [2/2]

template<class PointType_, class TLabel>
const PointType & pgl::Halfplane< 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.

◆ index()

template<class PointType_, class TLabel>
std::ptrdiff_t pgl::Halfplane< PointType_, TLabel >::index ( const PointType & point) const
inlineconstexpr

Returns the smallest index i with (*this)[i] == point, or -1 if no defining point equals point.

◆ interiorContains() [1/18]

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

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

◆ interiorContains() [2/18]

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

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

◆ interiorContains() [3/18]

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

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

◆ interiorContains() [4/18]

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

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

◆ interiorContains() [5/18]

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

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

◆ interiorContains() [6/18]

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

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

◆ interiorContains() [7/18]

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

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

◆ interiorContains() [8/18]

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

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

◆ interiorContains() [9/18]

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

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

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ interiorContains() [10/18]

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

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

◆ interiorContains() [11/18]

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

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

◆ interiorContains() [12/18]

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

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

◆ interiorContains() [13/18]

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

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

◆ interiorContains() [14/18]

template<class PointType_, class TLabel>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Halfplane< PointType_, TLabel >::interiorContains ( const OtherRegion & other) const
nodiscardconstexpr

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

◆ interiorContains() [15/18]

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

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

◆ interiorContains() [16/18]

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

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

◆ interiorContains() [17/18]

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

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

◆ interiorContains() [18/18]

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

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

◆ interiorsIntersect() [1/10]

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

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

◆ interiorsIntersect() [2/10]

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

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

◆ interiorsIntersect() [3/10]

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

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

◆ interiorsIntersect() [4/10]

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

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

◆ interiorsIntersect() [5/10]

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

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

◆ interiorsIntersect() [6/10]

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

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

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ interiorsIntersect() [7/10]

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

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

◆ interiorsIntersect() [8/10]

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

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

◆ interiorsIntersect() [9/10]

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

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

◆ interiorsIntersect() [10/10]

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

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

◆ intersection() [1/11]

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

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

◆ intersection() [2/11]

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

Returns the intersection of the two half-planes as a half-plane intersection.

The result type represents the intersection exactly (no coordinate divisions) whatever the configuration: a wedge, a strip, a nested or identical half-plane, a line, or the empty set (see HalfplaneIntersection::empty) — so no std::optional wrapper is needed. This concrete overload also keeps the pair away from the reversing fallback below, which would recurse forever.

◆ intersection() [3/11]

template<class PointType, class LabelType>
template<class ResultNumber, LineConcept OtherLine>
std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Line< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > > > > pgl::Halfplane< 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() [4/11]

template<class PointType, class LabelType>
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Line< Point< ResultNumber, typename PointType::LabelType > >, Ray< Point< ResultNumber, typename PointType::LabelType > > > > pgl::Halfplane< 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() [5/11]

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::Halfplane< 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() [6/11]

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

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

◆ intersection() [7/11]

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::Halfplane< 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() [8/11]

template<class PointType_, class TLabel>
template<class ResultNumber = NumberType, HalfplaneIntersectionConcept OtherRegion>
auto pgl::Halfplane< PointType_, TLabel >::intersection ( const OtherRegion & other) const
inlinenodiscardconstexpr

Adds this half-plane to an existing half-plane intersection without deriving vertices.

◆ intersection() [9/11]

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::Halfplane< 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() [10/11]

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

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

Warning
Divides coordinates after casting to ResultNumber.

◆ intersection() [11/11]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto pgl::Halfplane< 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/10]

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

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

◆ intersects() [2/10]

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

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

◆ intersects() [3/10]

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

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

◆ intersects() [4/10]

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

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

◆ intersects() [5/10]

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

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

◆ intersects() [6/10]

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

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

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ intersects() [7/10]

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

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

◆ intersects() [8/10]

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

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

◆ intersects() [9/10]

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

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

◆ intersects() [10/10]

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

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

◆ isDegenerate()

template<class PointType, class LabelType>
bool pgl::Halfplane< PointType, LabelType >::isDegenerate ( ) const
nodiscardconstexpr

Returns whether the defining points coincide.

Returns
true if the boundary degenerates to a point.

◆ isHorizontal()

template<class PointType, class LabelType>
bool pgl::Halfplane< PointType, LabelType >::isHorizontal ( ) const
nodiscardconstexpr

Returns whether the boundary line is horizontal.

Returns
true if both defining points share the same y-coordinate.

◆ isUndefined()

template<class PointType, class LabelType>
bool pgl::Halfplane< PointType, LabelType >::isUndefined ( ) const
nodiscardconstexpr

Returns whether the half-plane is degenerate without collapsing to a point or to a segment.

When the boundary degenerates to a point it has no direction, so the side it bounds is not determined and the half-plane has no reasonable interpretation: every degenerate half-plane is undefined.

Complexity: O(1).

Returns
isDegenerate.

◆ isVertical()

template<class PointType, class LabelType>
bool pgl::Halfplane< PointType, LabelType >::isVertical ( ) const
nodiscardconstexpr

Returns whether the boundary line is vertical.

Returns
true if both defining points share the same x-coordinate.

◆ label()

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

Returns the half-plane label.

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

Returns
Reference to the stored label.

◆ max()

template<class PointType_, class TLabel>
const PointType & pgl::Halfplane< PointType_, TLabel >::max ( ) const
inlineconstexpr

Returns the lexicographically largest defining point.

Returns
Reference to the larger stored point.

◆ min()

template<class PointType_, class TLabel>
const PointType & pgl::Halfplane< PointType_, TLabel >::min ( ) const
inlineconstexpr

Returns the lexicographically smallest defining point.

Returns
Reference to the smaller stored point.

◆ minkowskiErosion() [1/2]

template<class PointType_, class TLabel>
template<class ResultNumber, DiskConcept OtherDisk>
Halfplane< Point< ResultNumber, typename PointType_::LabelType > > pgl::Halfplane< PointType_, TLabel >::minkowskiErosion ( const OtherDisk & other) const
nodiscard

Returns the Minkowski erosion of this half-plane by a disk (A ⊖ B), a half-plane.

The mirror of minkowskiSum(const OtherDisk&) const, and the same support point: the boundary keeps its direction and slides in by the disk's radius along the outward unit normal, where the sum slides it out. Both are square roots, so ResultNumber defaults to double here as it does there.

Template Parameters
ResultNumberCoordinate type of the result.
Parameters
otherThe disk to erode by.
Returns
The erosion, as a half-plane.
Warning
Takes a square root of the boundary direction's length.

◆ minkowskiErosion() [2/2]

template<class PointType, class LabelType>
requires MinkowskiSummableConcept<Halfplane<PointType_, TLabel>, OtherShape>
template<class OtherShape>
requires MinkowskiSummableConcept<Halfplane<PointType_, TLabel>, OtherShape>
auto pgl::Halfplane< 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 half-plane eroded by anything bounded is that same half-plane, moved in by the operand's support point.

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

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

◆ minkowskiSum() [1/2]

template<class PointType_, class TLabel>
template<class ResultNumber, DiskConcept OtherDisk>
Halfplane< Point< ResultNumber, typename PointType_::LabelType > > pgl::Halfplane< PointType_, TLabel >::minkowskiSum ( const OtherDisk & other) const
nodiscard

Returns the Minkowski sum of this half-plane and a disk (A ⊕ B), a half-plane.

A half-plane absorbs anything bounded, a disk included: the boundary keeps its direction and slides out by the disk's radius, so the sum is this half-plane translated by c − r·n̂, with c the disk's centre and the outward unit normal.

That normal is where the exactness goes. Every other operand's support point is a vertex, found by comparing cross products with no division anywhere; a disk's is a point of its circle, and reaching it needs both the radius (a square root of what a disk stores) and the boundary direction's length. So this overload carries a ResultNumber of its own and defaults it to double, exactly as Disk::minkowskiSum(const OtherDisk&) const does and for the same reason — and unlike that one, this sum is irrational even for a disk that carries an exact centre and radius, unless the boundary direction happens to be a unit vector.

Template Parameters
ResultNumberCoordinate type of the result.
Parameters
otherThe disk to sum with.
Returns
The sum, as a half-plane.
Precondition
The half-plane is defined (a degenerate one bounds no side).
Warning
Takes a square root, and is exact for no integer input worth relying on.

◆ minkowskiSum() [2/2]

template<class PointType, class LabelType>
requires MinkowskiSummableConcept<Halfplane<PointType_, TLabel>, OtherShape>
template<class OtherShape>
requires MinkowskiSummableConcept<Halfplane<PointType_, TLabel>, OtherShape>
auto pgl::Halfplane< 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. This shape is unbounded, so its every other sum is unbounded too and comes back as a HalfplaneIntersection: the operand may be any other unbounded convex shape (UnboundedConvexConcept) or any bounded convex one, and the sum of two convex polyhedra is a convex polyhedron. A non-convex operand is refused, its concavity being swept into the answer rather than absorbed. See MinkowskiSummableConcept.

A half-plane is the one unbounded shape with a tighter answer for a bounded operand: it absorbs anything bounded and polygonal, convex or not, and comes back a Halfplane translated to that operand's support point.

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

◆ operator HalfplaneIntersection< PointType >()

template<class PointType_, class TLabel>
pgl::Halfplane< PointType_, TLabel >::operator HalfplaneIntersection< PointType > ( ) const
inlineexplicitnodiscardconstexpr

Converts to the equivalent one-constraint half-plane intersection.

Returns
Half-plane intersection whose single stored half-plane is this one.

◆ operator Line< PointType >()

template<class PointType, class LabelType>
pgl::Halfplane< PointType, LabelType >::operator Line< PointType > ( ) const
explicitnodiscardconstexpr

Converts to the unoriented boundary line.

Returns
Boundary line of the half-plane.

◆ operator OrientedLine< PointType >()

template<class PointType, class LabelType>
pgl::Halfplane< PointType, LabelType >::operator OrientedLine< PointType > ( ) const
explicitnodiscardconstexpr

Converts to the oriented boundary line.

Returns
Oriented boundary line of the half-plane.

◆ operator*=() [1/2]

template<class PointType_, class TLabel>
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
Halfplane< PointType, LabelType > & pgl::Halfplane< 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>)
Halfplane & pgl::Halfplane< PointType_, TLabel >::operator*= ( const Scalar & scalar)
constexpr

Scales the half-plane around the origin by a scalar in place.

◆ operator+=() [1/2]

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

◆ operator+=() [2/2]

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

Translates the half-plane by the given point in place.

◆ operator-=() [1/2]

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

◆ operator-=() [2/2]

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

Translates the half-plane 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>)
Halfplane< PointType, LabelType > & pgl::Halfplane< 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>)
Halfplane & pgl::Halfplane< PointType_, TLabel >::operator/= ( const Scalar & scalar)
constexpr

Divides the half-plane coordinates by a scalar in place.

◆ operator<=>()

template<class PointType, class LabelType>
auto pgl::Halfplane< PointType, LabelType >::operator<=> ( const Halfplane< PointType_, TLabel > & other) const
nodiscardconstexpr

Provides an ordering compatible with half-plane equality.

Parameters
otherHalf-plane to compare with.
Returns
Comparison result on the oriented boundary line.
Warning
Coordinates are cubed but a single promotion is used.

◆ operator=()

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

Assigns from a half-plane with compatible point and label types.

◆ operator==()

template<class PointType, class LabelType>
bool pgl::Halfplane< PointType, LabelType >::operator== ( const Halfplane< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests equality of the represented half-plane.

Two half-planes are equal when their oriented boundary lines are equal.

Parameters
otherHalf-plane to compare with.
Returns
true if both half-planes represent the same geometric set.

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ operator[]() [1/2]

template<class PointType_, class TLabel>
PointType & pgl::Halfplane< PointType_, TLabel >::operator[] ( std::size_t index)
inlineconstexpr

Returns defining point 0 for the source and 1 for the target.

Parameters
indexDefining-point index.
Returns
Reference to the selected defining point.

◆ operator[]() [2/2]

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

Returns defining point 0 for the source and 1 for the target.

Parameters
indexDefining-point index.
Returns
Reference to the selected defining point.

◆ opposite()

template<class PointType_, class TLabel>
Halfplane pgl::Halfplane< PointType_, TLabel >::opposite ( ) const
inlineconstexpr

Returns the complementary half-plane with reversed boundary orientation.

Returns
Half-plane on the opposite side of the same boundary line.

◆ pointInside()

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

Returns a point inside the halfplane.

Returns
Returns the point strictly inside the halfplane.

◆ pointInsideInteriorContainedIn()

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

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

Uses pointInside as the witness; it lies exactly in this halfplane's interior, so no scaled fallback is required.

◆ 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<Halfplane>) && requires(const
OtherShape& o, const Halfplane& self) { o.template regularizedIntersection<ResultNumber>(self); })
auto pgl::Halfplane< PointType_, TLabel >::regularizedIntersection ( const OtherShape & other) const
inlinenodiscardconstexpr

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::Halfplane< 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::Halfplane< PointType, LabelType >::rotate90 ( int k = 1)
constexpr

Rotates the half-plane by 90k degrees around the origin in place.

Parameters
kNumber of 90-degree CCW rotations (may be negative).

◆ rotated90()

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

Returns the half-plane rotated by 90k degrees around the origin.

Parameters
kNumber of 90-degree CCW rotations (may be negative).
Returns
Rotated half-plane.

◆ samePointSet()

template<class PointType, class LabelType>
template<AnyShapeConcept OtherShape>
bool pgl::Halfplane< 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>
Halfplane< PointType, LabelType > pgl::Halfplane< PointType_, TLabel >::scaledDownX ( const OtherNumber scalar) const
constexpr

◆ scaledDownX() [2/2]

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

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

◆ scaledDownY() [1/2]

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

◆ scaledDownY() [2/2]

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

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

◆ scaleDownX()

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

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

◆ scaleDownY()

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

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

◆ scaledUpX() [1/2]

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

◆ scaledUpX() [2/2]

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

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

◆ scaledUpY() [1/2]

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

◆ scaledUpY() [2/2]

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

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

◆ scaleUpX()

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

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

◆ scaleUpY()

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

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

◆ separates() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< PointType, LabelType >::separates ( const OtherHalfplane< PointType_, TLabel > & 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<LineConcept OtherLine>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherLine & other) const
nodiscardconstexpr

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

◆ separates() [7/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherOrientedLine & 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<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherOrientedSegment & 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<PointConcept OtherPoint>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherPoint & other) const
nodiscardconstexpr

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

Halfplane

Half-plane containment, intersection, and topological predicates, together with the helper routines used for strict side/interior tests.

◆ separates() [10/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherPolygon & 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<PolylineConcept OtherPolyline>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherPolyline & 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<RayConcept OtherRay>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherRay & 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<RectangleConcept OtherRectangle>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherRectangle & 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<PolygonWithHolesConcept OtherRegion>
bool pgl::Halfplane< PointType, LabelType >::separates ( const OtherRegion & 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() [15/19]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherRegion>
bool pgl::Halfplane< 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::Halfplane< 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::Halfplane< 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::Halfplane< 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>
bool pgl::Halfplane< PointType, LabelType >::separates ( const Shape< PointType > & other) const
nodiscardconstexpr

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

◆ size()

template<class PointType_, class TLabel>
constexpr std::size_t pgl::Halfplane< PointType_, TLabel >::size ( )
inlinestaticconstexpr

Returns the number of defining points (always 2).

◆ slope()

template<class PointType, class LabelType>
template<class ResultNumber>
ResultNumber pgl::Halfplane< PointType, LabelType >::slope ( ) const
nodiscardconstexpr

Returns the slope of the boundary line.

Undefined behavior for vertical boundaries.

Template Parameters
ResultNumberCoordinate type of the returned slope.
Returns
Slope.

◆ source() [1/2]

template<class PointType_, class TLabel>
PointType & pgl::Halfplane< PointType_, TLabel >::source ( )
inlineconstexpr

◆ source() [2/2]

template<class PointType_, class TLabel>
const PointType & pgl::Halfplane< PointType_, TLabel >::source ( ) const
inlineconstexpr

Returns the source boundary point.

Returns
Reference to the source point.

◆ squaredDistance() [1/9]

template<class PointType_, class TLabel>
template<class ResultNumber = double, class DiskPointType, class DiskLabel>
detail::floating_result_t< ResultNumber > pgl::Halfplane< PointType_, TLabel >::squaredDistance ( const Disk< DiskPointType, DiskLabel > & disk) const
inlinenodiscard

Returns the squared Euclidean distance to a disk.

Forwards to Disk::squaredDistance. Reports in detail::floating_result_t<ResultNumber>: a distance realized on a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double.

◆ squaredDistance() [2/9]

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

Returns the squared Euclidean distance to the given shape.

Zero when the half-plane intersects the shape; otherwise the shape lies entirely outside, so its distance to the half-plane equals its distance to the boundary line asLine().

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

◆ squaredDistance() [3/9]

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

Returns the squared Euclidean distance to the given shape.

Zero when the half-plane intersects the shape; otherwise the shape lies entirely outside, so its distance to the half-plane equals its distance to the boundary line asLine().

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

◆ squaredDistance() [4/9]

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

Returns the squared Euclidean distance to the given shape.

Zero when the half-plane intersects the shape; otherwise the shape lies entirely outside, so its distance to the half-plane equals its distance to the boundary line asLine().

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

◆ squaredDistance() [5/9]

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

Returns the squared Euclidean distance to the given shape.

Zero when the half-plane intersects the shape; otherwise the shape lies entirely outside, so its distance to the half-plane equals its distance to the boundary line asLine().

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

◆ squaredDistance() [6/9]

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

Returns the squared Euclidean distance to the given shape.

Zero when the half-plane intersects the shape; otherwise the shape lies entirely outside, so its distance to the half-plane equals its distance to the boundary line asLine().

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

◆ squaredDistance() [7/9]

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

Returns the squared Euclidean distance to the given shape.

Zero when the half-plane intersects the shape; otherwise the shape lies entirely outside, so its distance to the half-plane equals its distance to the boundary line asLine().

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

◆ squaredDistance() [8/9]

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

Returns the squared Euclidean distance to the given shape.

Zero when the half-plane intersects the shape; otherwise the shape lies entirely outside, so its distance to the half-plane equals its distance to the boundary line asLine().

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

◆ squaredDistance() [9/9]

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

Returns the squared Euclidean distance to the given shape.

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

◆ target() [1/2]

template<class PointType_, class TLabel>
PointType & pgl::Halfplane< PointType_, TLabel >::target ( )
inlineconstexpr

◆ target() [2/2]

template<class PointType_, class TLabel>
const PointType & pgl::Halfplane< PointType_, TLabel >::target ( ) const
inlineconstexpr

Returns the target boundary point.

Returns
Reference to the target point.

◆ verticesContain()

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

Returns whether the given point is one of the stored defining points.