![]() |
Pangolin
Header-only C++20 plane computational geometry library
|
The empty set of points in the plane. More...
#include <emptyshape.hpp>
Public Types | |
| using | PointType = PointType_ |
| using | NumberType = typename PointType::NumberType |
| using | LabelType = typename PointType::LabelType |
Public Member Functions | |
| constexpr | EmptyShape ()=default |
| Creates the (unique) empty shape. | |
| constexpr bool | operator== (const EmptyShape &) const =default |
| All empty shapes are equal and unordered among themselves. | |
| constexpr auto | operator<=> (const EmptyShape &) const =default |
| Three-way comparison: all empty shapes are equivalent. | |
| template<AnyShapeConcept OtherShape> | |
| constexpr bool | samePointSet (const OtherShape &other) const |
| Tests whether another shape defines the empty point set. | |
| constexpr bool | isDegenerate () const |
| The empty shape is never degenerate. | |
| constexpr bool | isUndefined () const |
| The empty shape is never undefined. | |
| PointType | get (std::ptrdiff_t) const |
| Always throws: the empty shape has no vertices. | |
| PointType | operator[] (std::size_t) const |
| Always throws: the empty shape has no vertices. | |
| template<class T> | |
| std::ptrdiff_t | index (const T &) const |
| Always throws: the empty shape has no vertices. | |
| template<class T> | |
| constexpr bool | contains (const T &other) const |
| Tests whether this shape contains the other shape (A ⊇ B). | |
| template<PointConcept OtherPoint> | |
| constexpr bool | contains (const EmptyShape< OtherPoint > &) const |
| Tests whether this shape contains the other shape (A ⊇ B). | |
| template<class T> | |
| constexpr bool | boundaryContains (const T &other) const |
| Tests whether this shape's boundary contains the other shape (∂A ⊇ B). | |
| template<PointConcept OtherPoint> | |
| constexpr bool | boundaryContains (const EmptyShape< OtherPoint > &) const |
| Tests whether this shape's boundary contains the other shape (∂A ⊇ B). | |
| template<class T> | |
| constexpr bool | interiorContains (const T &other) const |
| Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B). | |
| template<PointConcept OtherPoint> | |
| constexpr bool | interiorContains (const EmptyShape< OtherPoint > &) const |
| Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B). | |
| template<class T> | |
| constexpr bool | intersects (const T &) const |
| Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅). | |
| template<class T> | |
| constexpr bool | interiorsIntersect (const T &) const |
| Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅). | |
| template<class T> | |
| constexpr bool | separates (const T &) const |
| Tests whether removing this shape disconnects the other shape (B∖A is disconnected). | |
| template<class T> | |
| constexpr bool | crosses (const T &) const |
| Tests whether the two shapes mutually separate each other (each disconnects the other). | |
| template<class ResultNumber = NumberType, class T> | |
| constexpr EmptyShape | intersection (const T &) const |
| Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint. | |
| template<class OtherShape> requires MinkowskiSummableConcept<EmptyShape<PointType_>, OtherShape> | |
| constexpr auto | minkowskiSum (const OtherShape &other) const |
| Returns the Minkowski sum of this shape and another (A ⊕ B). | |
| template<class OtherShape> requires MinkowskiSummableConcept<EmptyShape<PointType_>, OtherShape> | |
| constexpr auto | minkowskiErosion (const OtherShape &other) const |
| Returns the Minkowski erosion of this shape by another (A ⊖ B). | |
| template<PointConcept OtherPoint> | |
| constexpr EmptyShape & | operator+= (const OtherPoint &) |
| Translates the empty shape in place; a no-op. | |
| template<PointConcept OtherPoint> | |
| constexpr EmptyShape & | operator-= (const OtherPoint &) |
| Translates the empty shape in place by a negated point; a no-op. | |
| template<class Scalar> requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>) | |
| constexpr EmptyShape & | operator*= (const Scalar &) |
| Scales the empty shape in place around the origin; a no-op. | |
| template<class Scalar> requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>) | |
| constexpr EmptyShape & | operator/= (const Scalar &) |
| Divides the empty shape in place around the origin; a no-op. | |
| constexpr EmptyShape | rotated90 (int=1) const |
| Returns the empty shape rotated by 90k degrees; a no-op. | |
| constexpr void | rotate90 (int=1) |
| Rotates the empty shape by 90k degrees in place; a no-op. | |
| template<class OtherNumber> | |
| constexpr EmptyShape | scaledUpX (const OtherNumber) const |
| Returns the empty shape with its x-coordinates scaled up; a no-op. | |
| template<class OtherNumber> | |
| constexpr void | scaleUpX (const OtherNumber) |
| Scales the empty shape's x-coordinates up in place; a no-op. | |
| template<class OtherNumber> | |
| constexpr EmptyShape | scaledUpY (const OtherNumber) const |
| Returns the empty shape with its y-coordinates scaled up; a no-op. | |
| template<class OtherNumber> | |
| constexpr void | scaleUpY (const OtherNumber) |
| Scales the empty shape's y-coordinates up in place; a no-op. | |
| template<class OtherNumber> | |
| constexpr EmptyShape | scaledDownX (const OtherNumber) const |
| Returns the empty shape with its x-coordinates scaled down; a no-op. | |
| template<class OtherNumber> | |
| constexpr void | scaleDownX (const OtherNumber) |
| Scales the empty shape's x-coordinates down in place; a no-op. | |
| template<class OtherNumber> | |
| constexpr EmptyShape | scaledDownY (const OtherNumber) const |
| Returns the empty shape with its y-coordinates scaled down; a no-op. | |
| template<class OtherNumber> | |
| constexpr void | scaleDownY (const OtherNumber) |
| Scales the empty shape's y-coordinates down in place; a no-op. | |
Static Public Member Functions | |
| static constexpr std::size_t | size () |
| Returns the number of vertices, always 0. | |
The empty set of points in the plane.
| PointType_ | Point type the shape is nominally parameterized on; only its associated types are used, since an empty shape stores no coordinates. |
| using pgl::EmptyShape< PointType_ >::LabelType = typename PointType::LabelType |
| using pgl::EmptyShape< PointType_ >::NumberType = typename PointType::NumberType |
| using pgl::EmptyShape< PointType_ >::PointType = PointType_ |
|
constexprdefault |
Creates the (unique) empty shape.
|
inlinenodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
inlinenodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
inlinenodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
inlinenodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
inlinenodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
inlinenodiscard |
Always throws: the empty shape has no vertices.
|
inlinenodiscard |
Always throws: the empty shape has no vertices.
|
inlinenodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
inlinenodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
inlinenodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
inlinenodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
inlinenodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
inlinenodiscardconstexpr |
The empty shape is never degenerate.
|
inlinenodiscardconstexpr |
The empty shape is never undefined.
The empty shape is not degenerate, so this always returns false. Provided for uniformity with the other shapes.
|
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. Nothing fits inside the empty set, so every erosion of one is empty – except by another empty shape, which fits vacuously.
Eroding by a shape that covers no point is the whole plane, which a HalfplaneIntersection returns and the tighter result types cannot.
| OtherShape | Type of the shape to erode by. |
| other | Shape to erode by. |
|
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; two bounded convex shapes sum to a Convex, or to a Rectangle when both are rectangles. See MinkowskiSummableConcept for the pairs a Minkowski sum is defined for.
| OtherShape | Type of the other shape. |
| other | Shape to sum with. |
|
inlineconstexpr |
Scales the empty shape in place around the origin; a no-op.
The empty set has no points to scale, so it is left unchanged.
|
inlineconstexpr |
Translates the empty shape in place; a no-op.
The empty set has no points to move, so translation leaves it unchanged.
|
inlineconstexpr |
Translates the empty shape in place by a negated point; a no-op.
The empty set has no points to move, so translation leaves it unchanged.
|
inlineconstexpr |
Divides the empty shape in place around the origin; a no-op.
The empty set has no points to scale, so it is left unchanged.
|
nodiscardconstexprdefault |
Three-way comparison: all empty shapes are equivalent.
|
nodiscardconstexprdefault |
All empty shapes are equal and unordered among themselves.
|
inlinenodiscard |
Always throws: the empty shape has no vertices.
|
inlineconstexpr |
Rotates the empty shape by 90k degrees in place; a no-op.
|
inlinenodiscardconstexpr |
Returns the empty shape rotated by 90k degrees; a no-op.
|
nodiscardconstexpr |
Tests whether another shape defines the empty point set.
|
inlinenodiscardconstexpr |
Returns the empty shape with its x-coordinates scaled down; a no-op.
|
inlinenodiscardconstexpr |
Returns the empty shape with its y-coordinates scaled down; a no-op.
|
inlineconstexpr |
Scales the empty shape's x-coordinates down in place; a no-op.
|
inlineconstexpr |
Scales the empty shape's y-coordinates down in place; a no-op.
|
inlinenodiscardconstexpr |
Returns the empty shape with its x-coordinates scaled up; a no-op.
|
inlinenodiscardconstexpr |
Returns the empty shape with its y-coordinates scaled up; a no-op.
|
inlineconstexpr |
Scales the empty shape's x-coordinates up in place; a no-op.
|
inlineconstexpr |
Scales the empty shape's y-coordinates up in place; a no-op.
|
inlinenodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
inlinestaticnodiscardconstexpr |
Returns the number of vertices, always 0.