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

Public declaration of pgl::HalfplaneIntersection. More...

#include "shape/polygon.hpp"
#include <algorithm>
#include <cassert>
#include <compare>
#include <concepts>
#include <cstddef>
#include <functional>
#include <optional>
#include <ostream>
#include <ranges>
#include <stdexcept>
#include <type_traits>
#include <utility>
#include <variant>
#include <vector>

Go to the source code of this file.

Classes

struct  pgl::HalfplaneIntersection< PointType_, TLabel >
 Intersection of closed half-planes; convex but possibly unbounded or empty. More...

Namespaces

namespace  pgl

Functions

 pgl::HalfplaneIntersection () -> HalfplaneIntersection< Point<>, NoLabel >
template<HalfplaneConcept H>
 pgl::HalfplaneIntersection (const H &) -> HalfplaneIntersection< typename H::PointType, NoLabel >
template<std::ranges::input_range Range>
requires detail::is_halfplane_v<std::ranges::range_value_t<Range>>
 pgl::HalfplaneIntersection (Range &&) -> HalfplaneIntersection< typename std::remove_cvref_t< std::ranges::range_value_t< Range > >::PointType, NoLabel >
template<std::ranges::input_range Range>
requires detail::is_halfplane_v<std::ranges::range_value_t<Range>>
 pgl::HalfplaneIntersection (Range &&, bool) -> HalfplaneIntersection< typename std::remove_cvref_t< std::ranges::range_value_t< Range > >::PointType, NoLabel >
template<RectangleConcept R>
 pgl::HalfplaneIntersection (const R &) -> HalfplaneIntersection< typename R::PointType, NoLabel >
template<TriangleConcept T>
 pgl::HalfplaneIntersection (const T &) -> HalfplaneIntersection< typename T::PointType, NoLabel >
template<ConvexConcept C>
 pgl::HalfplaneIntersection (const C &) -> HalfplaneIntersection< typename C::PointType, NoLabel >
template<PointConcept P>
 pgl::HalfplaneIntersection (const P &) -> HalfplaneIntersection< Point< typename P::NumberType, typename P::LabelType >, NoLabel >
template<SegmentConcept S>
 pgl::HalfplaneIntersection (const S &) -> HalfplaneIntersection< typename S::PointType, NoLabel >
template<LineConcept L>
 pgl::HalfplaneIntersection (const L &) -> HalfplaneIntersection< typename L::PointType, NoLabel >
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const HalfplaneIntersection< PointType, LabelType > &region, const Point< TranslationNumber, TranslationLabel > &translation)
 Translates a region by a negated point.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const HalfplaneIntersection< PointType, LabelType > &region, const Scalar &scalar)
 Scales a region around the origin.
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const HalfplaneIntersection< PointType, LabelType > &region)
 Scales a region around the origin.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const HalfplaneIntersection< PointType, LabelType > &region, const Scalar &scalar)
 Divides a region around the origin.
template<class PointType, class LabelType>
std::ostream & pgl::operator<< (std::ostream &stream, const HalfplaneIntersection< PointType, LabelType > &region)
 Streams a HalfplaneIntersection as HalfplaneIntersection[h1,h2,...].

Detailed Description

Public declaration of pgl::HalfplaneIntersection.

HalfplaneIntersection stores the intersection of a finite set of closed half-planes: a convex region that — unlike pgl::Convex — may be unbounded (wedge, strip, half-plane, whole plane), may be empty, and may have non-integer vertices even when every stored half-plane has integer coordinates. Half-planes can be inserted at any time; redundant ones are discarded.