32template <
class Po
intType_ = Po
int<>>
51 template<AnyShapeConcept OtherShape>
52 [[nodiscard]]
constexpr bool samePointSet(
const OtherShape& other)
const;
57 [[nodiscard]]
static constexpr std::size_t
size() {
84 throw std::logic_error(
"EmptyShape::get: the empty shape has no vertices");
91 throw std::logic_error(
"EmptyShape::operator[]: the empty shape has no vertices");
98 [[nodiscard]] std::ptrdiff_t
index(
const T&)
const {
99 throw std::logic_error(
"EmptyShape::index: the empty shape has no vertices");
117 [[nodiscard]]
constexpr bool contains(
const T& other)
const {
118 if constexpr (
requires { other.empty(); }) {
119 return other.empty();
125 template <Po
intConcept OtherPo
int>
134 if constexpr (
requires { other.empty(); }) {
135 return other.empty();
141 template <Po
intConcept OtherPo
int>
150 if constexpr (
requires { other.empty(); }) {
151 return other.empty();
157 template <Po
intConcept OtherPo
int>
176 [[nodiscard]]
constexpr bool separates(
const T&)
const {
182 [[nodiscard]]
constexpr bool crosses(
const T&)
const {
187 template <
class ResultNumber = NumberType,
class T>
205 template <
class OtherShape>
207 [[nodiscard]]
constexpr auto minkowskiSum(
const OtherShape& other)
const;
232 template <
class OtherShape>
243 template <Po
intConcept OtherPo
int>
255 template <Po
intConcept OtherPo
int>
267 template <
class Scalar>
280 template <
class Scalar>
295 template <
class OtherNumber>
301 template <
class OtherNumber>
305 template <
class OtherNumber>
311 template <
class OtherNumber>
315 template <
class OtherNumber>
321 template <
class OtherNumber>
325 template <
class OtherNumber>
331 template <
class OtherNumber>
344template <
class Po
intType,
class TranslationNumber,
class TranslationLabel>
347 using ResultPoint = std::decay_t<decltype(std::declval<const PointType&>() -
348 std::declval<const Point<TranslationNumber, TranslationLabel>&>())>;
361template <
class Po
intType,
class Scalar>
362 requires(!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
364 using ResultPoint = std::decay_t<decltype(std::declval<const PointType&>() *
365 std::declval<const Scalar&>())>;
370template <
class Scalar,
class Po
intType>
371 requires(!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
373 return empty * scalar;
385template <
class Po
intType,
class Scalar>
386 requires(!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
388 using ResultPoint = std::decay_t<decltype(std::declval<const PointType&>() /
389 std::declval<const Scalar&>())>;
399template <
class Po
intType>
401 return stream <<
"EmptyShape()";
Shape pairs whose Minkowski sum Pangolin can represent.
Definition forward.hpp:476
Definition arrangement.hpp:67
constexpr auto operator-(const Point< LeftNumber, LeftLabel > &left, const Point< RightNumber, RightLabel > &right)
Translates a point by the opposite of another point.
Definition transformations.hpp:130
std::ostream & operator<<(std::ostream &stream, const Point< Number, Label > &point)
Streams a point as (x,y) or label:(x,y).
Definition io.hpp:27
Public declaration of pgl::Point and point-label helpers.
The empty set of points in the plane.
Definition emptyshape.hpp:33
constexpr EmptyShape intersection(const T &) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition emptyshape.hpp:188
constexpr bool contains(const T &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition emptyshape.hpp:117
constexpr EmptyShape rotated90(int=1) const
Returns the empty shape rotated by 90k degrees; a no-op.
Definition emptyshape.hpp:287
constexpr bool separates(const T &) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition emptyshape.hpp:176
typename PointType::LabelType LabelType
Definition emptyshape.hpp:36
constexpr EmptyShape & operator-=(const OtherPoint &)
Translates the empty shape in place by a negated point; a no-op.
Definition emptyshape.hpp:256
constexpr auto minkowskiSum(const OtherShape &other) const
Returns the Minkowski sum of this shape and another (A ⊕ B).
Definition minkowski.hpp:881
constexpr auto operator<=>(const EmptyShape &) const =default
Three-way comparison: all empty shapes are equivalent.
constexpr bool interiorContains(const EmptyShape< OtherPoint > &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition emptyshape.hpp:158
constexpr bool operator==(const EmptyShape &) const =default
All empty shapes are equal and unordered among themselves.
EPoint PointType
Definition emptyshape.hpp:34
constexpr bool contains(const EmptyShape< OtherPoint > &) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition emptyshape.hpp:126
typename PointType::NumberType NumberType
Definition emptyshape.hpp:35
constexpr bool intersects(const T &) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition emptyshape.hpp:164
static constexpr std::size_t size()
Returns the number of vertices, always 0.
Definition emptyshape.hpp:57
constexpr EmptyShape scaledDownX(const OtherNumber) const
Returns the empty shape with its x-coordinates scaled down; a no-op.
Definition emptyshape.hpp:316
constexpr EmptyShape & operator+=(const OtherPoint &)
Translates the empty shape in place; a no-op.
Definition emptyshape.hpp:244
PointType get(std::ptrdiff_t) const
Always throws: the empty shape has no vertices.
Definition emptyshape.hpp:83
constexpr void scaleDownX(const OtherNumber)
Scales the empty shape's x-coordinates down in place; a no-op.
Definition emptyshape.hpp:322
constexpr bool boundaryContains(const T &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition emptyshape.hpp:132
std::ptrdiff_t index(const T &) const
Always throws: the empty shape has no vertices.
Definition emptyshape.hpp:98
constexpr bool isDegenerate() const
The empty shape is never degenerate.
Definition emptyshape.hpp:64
constexpr void scaleUpY(const OtherNumber)
Scales the empty shape's y-coordinates up in place; a no-op.
Definition emptyshape.hpp:312
constexpr EmptyShape scaledDownY(const OtherNumber) const
Returns the empty shape with its y-coordinates scaled down; a no-op.
Definition emptyshape.hpp:326
constexpr bool isUndefined() const
The empty shape is never undefined.
Definition emptyshape.hpp:76
PointType operator[](std::size_t) const
Always throws: the empty shape has no vertices.
Definition emptyshape.hpp:90
constexpr auto minkowskiErosion(const OtherShape &other) const
Returns the Minkowski erosion of this shape by another (A ⊖ B).
Definition minkowskierosion.hpp:655
constexpr bool boundaryContains(const EmptyShape< OtherPoint > &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition emptyshape.hpp:142
constexpr EmptyShape scaledUpX(const OtherNumber) const
Returns the empty shape with its x-coordinates scaled up; a no-op.
Definition emptyshape.hpp:296
constexpr bool interiorContains(const T &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition emptyshape.hpp:148
constexpr EmptyShape scaledUpY(const OtherNumber) const
Returns the empty shape with its y-coordinates scaled up; a no-op.
Definition emptyshape.hpp:306
constexpr EmptyShape()=default
Creates the (unique) empty shape.
constexpr void scaleDownY(const OtherNumber)
Scales the empty shape's y-coordinates down in place; a no-op.
Definition emptyshape.hpp:332
constexpr bool samePointSet(const OtherShape &other) const
Tests whether another shape defines the empty point set.
Definition samepointset.hpp:1941
constexpr void rotate90(int=1)
Rotates the empty shape by 90k degrees in place; a no-op.
Definition emptyshape.hpp:292
constexpr bool interiorsIntersect(const T &) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition emptyshape.hpp:170
constexpr bool crosses(const T &) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition emptyshape.hpp:182
constexpr void scaleUpX(const OtherNumber)
Scales the empty shape's x-coordinates up in place; a no-op.
Definition emptyshape.hpp:302
Two-dimensional point with optional label payload.
Definition point.hpp:129
TLabel LabelType
Definition point.hpp:133
ERational NumberType
Definition point.hpp:131