Pangolin
Header-only C++20 plane computational geometry library
Loading...
Searching...
No Matches
emptyshape.hpp File Reference

Public declaration of pgl::EmptyShape. More...

#include "shape/point.hpp"
#include <compare>
#include <cstddef>
#include <ostream>
#include <stdexcept>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

struct  pgl::EmptyShape< PointType_ >
 The empty set of points in the plane. More...

Namespaces

namespace  pgl

Functions

template<class PointType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const EmptyShape< PointType > &, const Point< TranslationNumber, TranslationLabel > &)
 Translates the empty shape by a negated point; a no-op.
template<class PointType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const EmptyShape< PointType > &, const Scalar &)
 Scales the empty shape around the origin; a no-op.
template<class Scalar, class PointType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const EmptyShape< PointType > &empty)
 Scales the empty shape around the origin; a no-op.
template<class PointType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const EmptyShape< PointType > &, const Scalar &)
 Divides the empty shape around the origin; a no-op.
template<class PointType>
std::ostream & pgl::operator<< (std::ostream &stream, const EmptyShape< PointType > &)
 Streams the empty shape.

Detailed Description

Public declaration of pgl::EmptyShape.

EmptyShape models the empty set of points in the plane. It is a full-fledged shape alternative so it can be stored in pgl::Shape, but every predicate is vacuously false, it has no vertices, and any intersection with it is again empty. Because it answers every relation generically, it can be added to the Shape variant without special-casing it anywhere else.