![]() |
Pangolin
Header-only C++20 plane computational geometry library
|
Axis-aligned rectangle stored by minimum and maximum corners. More...
#include <rectangle.hpp>
Classes | |
| class | BoundaryIterator |
| Forward iterator over the four rectangle boundary edges. More... | |
| class | CornerIterator |
| Forward iterator over the four corners in counterclockwise order. More... | |
Public Types | |
| using | PointType = PointType_ |
| using | NumberType = PointType::NumberType |
| using | LabelType = TLabel |
| template<bool Oriented> | |
| using | BoundaryType = std::conditional_t<Oriented, OrientedSegment<PointType>, Segment<PointType>> |
| Selects unordered or oriented boundary segments. | |
| using | value_type = PointType |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | reference = PointType |
| using | const_reference = PointType |
| using | iterator = CornerIterator |
| using | const_iterator = CornerIterator |
| using | EdgeIterator = BoundaryIterator<false> |
| using | OrientedEdgeIterator = BoundaryIterator<true> |
Public Member Functions | |
| constexpr | Rectangle () |
| Creates the empty rectangle [(0,0),(-1,-1)]. | |
| constexpr | Rectangle (PointType first, PointType second, bool minmax=false) |
| Creates an axis-aligned rectangle from two opposite corners. | |
| constexpr | Rectangle (NumberType x1, NumberType y1, NumberType x2, NumberType y2, bool minmax=false) |
| Creates an axis-aligned rectangle from four coordinates. | |
| template<PointConcept OtherPointType, class OtherLabelType> requires (std::constructible_from<PointType, const OtherPointType&>) | |
| constexpr | Rectangle (const Rectangle< OtherPointType, OtherLabelType > &other) |
| template<PointConcept OtherPointType, class OtherLabelType> requires (std::constructible_from<PointType, const OtherPointType&>) | |
| constexpr Rectangle & | operator= (const Rectangle< OtherPointType, OtherLabelType > &other) |
| Assigns from a rectangle with compatible point and label types. | |
| template<std::ranges::input_range Range = std::initializer_list<PointType>> requires std::ranges::common_range<Range> && std::convertible_to<std::ranges::range_value_t<Range>, PointType> | |
| constexpr | Rectangle (Range &&points) |
| Creates the bounding box of a range of points. | |
| template<std::ranges::input_range Range> requires (!detail::is_point_v<typename std::ranges::range_value_t<Range>> && requires(const typename std::ranges::range_value_t <Range>& shape) { shape.bbox(); }) | |
| constexpr | Rectangle (Range &&shapes) |
| Creates the bounding box of a range of bounded shapes. | |
| constexpr PointType | operator[] (std::size_t index) const |
| Returns corner index for index in [0, 4). | |
| constexpr bool | empty () const |
| Returns whether the rectangle is the empty set of points. | |
| constexpr std::size_t | size () const |
| Returns the number of corners: 4, or 0 when empty. | |
| constexpr PointType | get (std::ptrdiff_t index) const |
| Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the end. | |
| constexpr std::ptrdiff_t | index (const PointType &point) const |
| Returns the smallest index i with (*this)[i] == point, or -1 if no corner equals point. | |
| constexpr const PointType & | min () const |
| Returns the minimum corner (min x, min y). | |
| constexpr const PointType & | max () const |
| Returns the maximum corner (max x, max y). | |
| constexpr auto | width () const |
| Returns the rectangle width. | |
| constexpr auto | height () const |
| Returns the rectangle height. | |
| constexpr CornerIterator | begin () const |
| Returns an iterator to the minimum corner. | |
| constexpr CornerIterator | cbegin () const |
| Returns an iterator to the minimum corner. | |
| constexpr CornerIterator | end () const |
| Returns an iterator past the last corner. | |
| constexpr CornerIterator | cend () const |
| Returns an iterator past the last corner. | |
| constexpr EdgeIterator | edgesBegin () const |
| Returns an iterator to the first edge. | |
| constexpr EdgeIterator | edgesEnd () const |
| Returns an iterator past the last edge. | |
| constexpr OrientedEdgeIterator | orientedEdgesBegin () const |
| Returns an iterator to the first oriented edge. | |
| constexpr OrientedEdgeIterator | orientedEdgesEnd () const |
| Returns an iterator past the last oriented edge. | |
| constexpr bool | operator== (const Rectangle &other) const |
| Provides lexicographic ordering on (min, max). | |
| template<AnyShapeConcept OtherShape> | |
| constexpr bool | samePointSet (const OtherShape &other) const |
| Tests whether another shape defines exactly the same point set. | |
| constexpr auto | operator<=> (const Rectangle &other) const |
| Orders rectangles lexicographically by their (min, max) corners, ignoring the label. | |
| template<class A = LabelType> requires (detail::has_label_v<A>) | |
| constexpr A & | label () const |
| Returns the rectangle label. | |
| template<class ResultNumber = NumberType> | |
| constexpr ResultNumber | area () const |
| Returns the rectangle area. | |
| constexpr auto | twiceArea () const |
| Returns twice the rectangle area. | |
| constexpr bool | isDegenerate () const |
| Returns whether the rectangle has empty interior. | |
| constexpr bool | isPoint () const |
| Returns whether the rectangle collapses to a single point. | |
| constexpr std::optional< PointType > | getIfPoint () const |
| Returns the point the rectangle collapses to, if it does. | |
| constexpr bool | isSegment () const |
| Returns whether the rectangle collapses to a non-degenerate segment. | |
| constexpr std::optional< BoundaryType< false > > | getIfSegment () const |
| Returns the segment the rectangle collapses to, if it does. | |
| constexpr bool | isUndefined () const |
| Returns whether the rectangle is degenerate without collapsing to a point or to a segment. | |
| constexpr Rectangle | bbox () const |
| Returns the bounding box of the rectangle. | |
| template<class ResultNumber = grid_number_t<typename PointType_::NumberType>> requires (detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>) | |
| std::vector< Point< ResultNumber, typename PointType::LabelType > > | latticePoints () const |
| Returns the integer points the rectangle contains. | |
| template<std::floating_point ResultNumber = double> | |
| constexpr Rectangle< Point< ResultNumber > > | fbox () const |
| Returns a bounding box of the rectangle with floating point coordinates. | |
| constexpr std::array< PointType, 4 > | vertices () const |
| Returns the four vertices in counterclockwise order. | |
| constexpr std::array< Segment< PointType >, 4 > | edges () const |
| Returns the four edges as unordered segments. | |
| constexpr std::array< OrientedSegment< PointType >, 4 > | orientedEdges () const |
| Returns the four boundary edges in counterclockwise order. | |
| constexpr | operator Convex< PointType > () const |
| Converts the rectangle to a convex polygon. | |
| constexpr Convex< PointType > | asConvex () const |
| Returns the rectangle as a convex polygon. | |
| constexpr Convex< PointType > | convexHull () const |
| Returns the convex hull of the rectangle's vertices. | |
| constexpr HalfplaneIntersection< PointType > | asHalfplaneIntersection () const |
| Returns the rectangle as a half-plane intersection. | |
| constexpr | operator Polygon< PointType > () const |
| Converts the rectangle to a simple polygon. | |
| constexpr Polygon< PointType > | asPolygon () const |
| Returns the rectangle as a simple polygon. | |
| constexpr PolygonWithHoles< PointType > | asPolygonWithHoles () const |
| Returns the rectangle as a hole-free region. | |
| constexpr PolygonSet< PointType > | asPolygonSet () const |
| Returns the rectangle as a one-component set of regions. | |
| template<PointConcept OtherPoint> | |
| constexpr bool | verticesContain (const OtherPoint &point) const |
| Returns whether a point is one of the rectangle vertices. | |
| 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<HalfplaneConcept OtherHalfplane> | |
| constexpr bool | contains (const OtherHalfplane &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<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<HalfplaneConcept OtherHalfplane> | |
| constexpr bool | interiorContains (const OtherHalfplane &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<TriangleConcept OtherTriangle> | |
| constexpr bool | interiorContains (const OtherTriangle &other) const |
| Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B). | |
| 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<OrientedSegmentConcept OtherOrientedSegment> | |
| constexpr bool | boundaryContains (const OtherOrientedSegment &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<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<HalfplaneConcept OtherHalfplane> | |
| constexpr bool | boundaryContains (const OtherHalfplane &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<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 | intersects (const OtherPoint &other) const |
| Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅). | |
| template<RectangleConcept OtherRectangle> | |
| constexpr bool | intersects (const OtherRectangle &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<Rectangle>) | |
| 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<RectangleConcept OtherRectangle> | |
| constexpr bool | interiorsIntersect (const OtherRectangle &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<Rectangle>) | |
| 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<RectangleConcept OtherRectangle> | |
| constexpr bool | separates (const OtherRectangle &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<LineConcept OtherLine> | |
| constexpr bool | separates (const OtherLine &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<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<DiskConcept OtherDisk> | |
| constexpr bool | separates (const OtherDisk &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). | |
| constexpr bool | separates (const Shape< PointType > &other) const |
| Tests whether removing this shape disconnects the other shape (B∖A is disconnected). | |
| template<DiskConcept OtherDisk> | |
| constexpr bool | interiorContains (const OtherDisk &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<PolygonConcept OtherPolygon> | |
| constexpr bool | interiorContains (const OtherPolygon &other) const |
| Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B). | |
| template<RectangleConcept OtherRectangle> | |
| constexpr bool | crosses (const OtherRectangle &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<LineConcept OtherLine> | |
| constexpr bool | crosses (const OtherLine &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<Rectangle>) | |
| 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 = NumberType, RectangleConcept OtherRectangle> | |
| constexpr std::optional< Rectangle< Point< ResultNumber, typename PointType::LabelType > > > | intersection (const OtherRectangle &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 >, Segment< 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 >, Segment< 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 > > > > | intersection (const OtherRay &other) const |
| Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint. | |
| template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane> | |
| constexpr auto | intersection (const OtherHalfplane &other) const |
| Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint. | |
| template<class ResultNumber = NumberType, HalfplaneIntersectionConcept OtherRegion> | |
| constexpr auto | intersection (const OtherRegion &other) const |
| Adds this rectangle's four constraints to a 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<Rectangle>) && requires(const OtherShape& o, const Rectangle& 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<Rectangle>) && requires(const OtherShape& o, const Rectangle& 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 = 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>, 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>, 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>, 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 = NumberType, RectangleConcept OtherRectangle> | |
| constexpr auto | squaredDistance (const OtherRectangle &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<Rectangle>) && requires(const OtherShape& o, const Rectangle& 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 = NumberType, BoundedPolygonalConcept OtherShape> requires detail::ClosestPairConcept<Rectangle<PointType_, TLabel>, OtherShape> | |
| constexpr auto | closestSegments (const OtherShape &other) const |
| Returns the pair of elements realizing the distance, nothing when the shapes meet. | |
| template<class ResultNumber = division_result_t<NumberType>, class OtherShape> requires detail::ClosestPointsPairConcept<Rectangle<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 = 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>, 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>, 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>, 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 = NumberType, RectangleConcept OtherRectangle> | |
| constexpr auto | distanceL1 (const OtherRectangle &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<Rectangle>) && requires(const OtherShape& o, const Rectangle& 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 = division_result_t<NumberType>, PointConcept OtherPoint> | |
| auto | regularizedUnion (const Shape< OtherPoint > &other) const |
| Returns the regularized union of the two shapes (A ∪ B), re-dispatching through the wrapper's own regularizedUnion. | |
| template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint> | |
| auto | difference (const Shape< OtherPoint > &other) const |
| Returns the regularized set difference of the two shapes (A ∖ B), re-dispatching through the wrapper's own difference. | |
| template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint> | |
| auto | symmetricDifference (const Shape< OtherPoint > &other) const |
| Returns the regularized symmetric difference of the two shapes (A △ B), re-dispatching through the wrapper's own symmetricDifference. | |
| 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 = 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>, 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>, 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>, 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 = NumberType, RectangleConcept OtherRectangle> | |
| constexpr auto | distanceLInf (const OtherRectangle &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<Rectangle>) && requires(const OtherShape& o, const Rectangle& 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 = NumberType, RectangleConcept OtherRectangle> | |
| constexpr auto | hausdorffDistanceL1 (const OtherRectangle &other) const |
| Returns the Manhattan (L1) Hausdorff distance to the given shape. | |
| template<class ResultNumber = NumberType, PointConcept OtherPoint> | |
| constexpr auto | hausdorffDistanceL1 (const OtherPoint &point) const |
| Returns the Manhattan (L1) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment> | |
| constexpr auto | hausdorffDistanceL1 (const OtherSegment &other) const |
| Returns the Manhattan (L1) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment> | |
| constexpr auto | hausdorffDistanceL1 (const OtherOrientedSegment &other) const |
| Returns the Manhattan (L1) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, typename OtherShape> requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>) && requires(const OtherShape& o, const Rectangle& self) { o.template hausdorffDistanceL1<ResultNumber>(self); }) | |
| constexpr auto | hausdorffDistanceL1 (const OtherShape &other) const |
| Returns the Manhattan (L1) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint> | |
| constexpr auto | hausdorffDistanceL1 (const Shape< OtherPoint > &other) const |
| Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own hausdorffDistanceL1. | |
| template<class ResultNumber = NumberType, RectangleConcept OtherRectangle> | |
| constexpr auto | hausdorffDistanceLInf (const OtherRectangle &other) const |
| Returns the Chebyshev (LInf) Hausdorff distance to the given shape. | |
| template<class ResultNumber = NumberType, PointConcept OtherPoint> | |
| constexpr auto | hausdorffDistanceLInf (const OtherPoint &point) const |
| Returns the Chebyshev (LInf) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment> | |
| constexpr auto | hausdorffDistanceLInf (const OtherSegment &other) const |
| Returns the Chebyshev (LInf) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment> | |
| constexpr auto | hausdorffDistanceLInf (const OtherOrientedSegment &other) const |
| Returns the Chebyshev (LInf) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, typename OtherShape> requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>) && requires(const OtherShape& o, const Rectangle& self) { o.template hausdorffDistanceLInf<ResultNumber>(self); }) | |
| constexpr auto | hausdorffDistanceLInf (const OtherShape &other) const |
| Returns the Chebyshev (LInf) Hausdorff distance to the given shape. | |
| template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint> | |
| constexpr auto | hausdorffDistanceLInf (const Shape< OtherPoint > &other) const |
| Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own hausdorffDistanceLInf. | |
| template<class ResultNumber = NumberType, RectangleConcept OtherRectangle> | |
| constexpr auto | squaredHausdorffDistance (const OtherRectangle &other) const |
| Returns the squared Hausdorff distance to another rectangle. | |
| template<class ResultNumber = NumberType, PointConcept OtherPoint> | |
| constexpr auto | squaredHausdorffDistance (const OtherPoint &point) const |
| Returns the squared Hausdorff distance to a point. | |
| template<class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment> | |
| constexpr auto | squaredHausdorffDistance (const OtherSegment &other) const |
| Returns the squared Hausdorff distance to a point. | |
| template<class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment> | |
| constexpr auto | squaredHausdorffDistance (const OtherOrientedSegment &other) const |
| Returns the squared Hausdorff distance to a point. | |
| template<class ResultNumber = division_result_t<NumberType>, typename OtherShape> requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>) && requires(const OtherShape& o, const Rectangle& self) { o.template squaredHausdorffDistance<ResultNumber>(self); }) | |
| constexpr auto | squaredHausdorffDistance (const OtherShape &other) const |
| Returns the squared Hausdorff distance to the given shape. | |
| template<PointConcept OtherPoint> requires (!detail::is_point_v<TShape> && !RectangleConcept<TShape> && requires(const TShape& shape) { shape.bbox(); }) | |
| constexpr void | insert (const OtherPoint &point) |
| Enlarges the rectangle so that it contains the given point. | |
| template<RectangleConcept OtherRectangle> | |
| constexpr void | insert (const OtherRectangle &other) |
| Enlarges the rectangle so that it contains another rectangle. | |
| template<class TShape> requires (!detail::is_point_v<TShape> && !RectangleConcept<TShape> && requires(const TShape& shape) { shape.bbox(); }) | |
| constexpr void | insert (const TShape &shape) |
| Enlarges the rectangle so that it contains a finite shape. | |
| template<std::ranges::input_range Range = std::initializer_list<PointType>> requires std::ranges::common_range<Range> && std::convertible_to<std::ranges::range_value_t<Range>, PointType> && (!requires(const std::remove_cvref_t<Range>& shape) { shape.bbox(); }) | |
| constexpr void | insert (Range &&range) |
| Enlarges the rectangle so that it contains every point in a range. | |
| template<std::ranges::input_range Range> requires (!detail::is_point_v<typename std::ranges::range_value_t<Range>> && requires(const typename std::ranges::range_value_t <Range>& shape) { shape.bbox(); }) | |
| constexpr void | insert (Range &&range) |
| Enlarges the rectangle to contain every point in a range of shapes. | |
| constexpr Segment< PointType > | diameter () const |
| Returns a segment defining a diameter. | |
| template<class ResultNumber = division_result_t<NumberType>> | |
| constexpr Point< ResultNumber > | midpoint () const |
| Returns the midpoint of the rectangle. | |
| template<class ResultNumber = division_result_t<NumberType>> | |
| constexpr Point< ResultNumber > | centroid () const |
| Returns the centroid of the rectangle. | |
| constexpr Disk< PointType, NoLabel > | circumcircle () const |
| Returns the circumcircle of the rectangle. | |
| template<class ResultNumber = division_result_t<NumberType>> | |
| constexpr Point< ResultNumber > | center () const |
| Returns the center of the rectangle. | |
| template<class ResultNumber = division_result_t<NumberType>> | |
| constexpr Point< ResultNumber > | pointInside () const |
| Returns a point inside the rectangle. | |
| 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. | |
| constexpr Rectangle | rotated90 (int k=1) const |
| Returns the rectangle rotated by 90k degrees around the origin. | |
| constexpr void | rotate90 (int k=1) |
| Rotates the rectangle by 90k degrees around the origin in place. | |
| template<class OtherNumber> | |
| constexpr Rectangle | scaledUpX (const OtherNumber scalar) const |
| Returns the rectangle with its x-coordinates multiplied by a factor. | |
| template<class OtherNumber> | |
| constexpr void | scaleUpX (const OtherNumber scalar) |
| Multiplies the rectangle's x-coordinates by a factor in place. | |
| template<class OtherNumber> | |
| constexpr Rectangle | scaledUpY (const OtherNumber scalar) const |
| Returns the rectangle with its y-coordinates multiplied by a factor. | |
| template<class OtherNumber> | |
| constexpr void | scaleUpY (const OtherNumber scalar) |
| Multiplies the rectangle's y-coordinates by a factor in place. | |
| template<class OtherNumber> | |
| constexpr Rectangle | scaledDownX (const OtherNumber scalar) const |
| Returns the rectangle with its x-coordinates divided by a divisor. | |
| template<class OtherNumber> | |
| constexpr void | scaleDownX (const OtherNumber scalar) |
| Divides the rectangle's x-coordinates by a divisor in place. | |
| template<class OtherNumber> | |
| constexpr Rectangle | scaledDownY (const OtherNumber scalar) const |
| Returns the rectangle with its y-coordinates divided by a divisor. | |
| template<class OtherNumber> | |
| constexpr void | scaleDownY (const OtherNumber scalar) |
| Divides the rectangle's y-coordinates by a divisor in place. | |
| template<class OtherShape> requires MinkowskiSummableConcept<Rectangle<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<Rectangle<PointType_, TLabel>, OtherShape> | |
| constexpr auto | minkowskiErosion (const OtherShape &other) const |
| Returns the Minkowski erosion of this shape by another (A ⊖ B). | |
| template<class OtherShape> requires (!MinkowskiSummableConcept<Rectangle<PointType_, TLabel>, OtherShape> && BoundedPolygonalConcept<OtherShape>) | |
| constexpr auto | minkowskiErosion (const OtherShape &other) const |
| Returns the Minkowski erosion of this shape by a bounded polygonal one (A ⊖ B). | |
| template<class ResultNumber = division_result_t<NumberType>, typename OtherShape> requires (!MinkowskiSummableConcept<Rectangle<PointType_, TLabel>, OtherShape> && (detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>) && requires(const OtherShape& o, const Rectangle& self) { o.template minkowskiSum <ResultNumber>(self); }) | |
| auto | minkowskiSum (const OtherShape &other) const |
| Returns the regularized Minkowski sum of the two shapes (A ⊕ B). | |
| template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle> | |
| PolygonSet< Point< ResultNumber, typename PointType::LabelType > > | regularizedUnion (const OtherRectangle &other) const |
| Returns the regularized union of the two shapes (A ∪ B). | |
| template<class ResultNumber = division_result_t<NumberType>, typename OtherShape> requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>) && requires(const OtherShape& o, const Rectangle& self) { o.template regularizedUnion<ResultNumber>(self); }) | |
| auto | regularizedUnion (const OtherShape &other) const |
| Returns the regularized union of the two shapes (A ∪ B). | |
| template<class ResultNumber = division_result_t<NumberType>, PolygonalRegionConcept OtherRegion> | |
| PolygonSet< Point< ResultNumber, typename PointType::LabelType > > | difference (const OtherRegion &other) const |
| Returns the regularized set difference of the two shapes (A ∖ B). | |
| template<class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection> | |
| PolygonSet< Point< ResultNumber, typename PointType::LabelType > > | difference (const OtherIntersection &other) const |
| Returns the regularized set difference of the two shapes (A ∖ B). | |
| template<class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane> | |
| PolygonSet< Point< ResultNumber, typename PointType::LabelType > > | difference (const OtherHalfplane &other) const |
| Returns the regularized set difference of the two shapes (A ∖ B). | |
| template<class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle> | |
| PolygonSet< Point< ResultNumber, typename PointType::LabelType > > | symmetricDifference (const OtherRectangle &other) const |
| Returns the regularized symmetric difference of the two shapes (A △ B). | |
| template<class ResultNumber = division_result_t<NumberType>, typename OtherShape> requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>) && requires(const OtherShape& o, const Rectangle& self) { o.template symmetricDifference<ResultNumber>(self); }) | |
| auto | symmetricDifference (const OtherShape &other) const |
| Returns the regularized symmetric difference of the two shapes (A △ B). | |
| template<PointConcept OtherPoint> | |
| constexpr Rectangle & | operator+= (const OtherPoint &translation) |
| Translates both stored corners in place. | |
| template<PointConcept OtherPoint> | |
| constexpr Rectangle & | operator-= (const OtherPoint &translation) |
| Translates both stored corners by the opposite vector in place. | |
| template<class Scalar> requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>) | |
| constexpr Rectangle & | operator*= (const Scalar &scalar) |
| Scales the rectangle around the origin in place. | |
| template<class Scalar> requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>) | |
| constexpr Rectangle & | operator/= (const Scalar &scalar) |
| Divides the rectangle coordinates by a scalar in place. | |
| template<class ResultNumber, PolygonalRegionConcept OtherRegion> | |
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > | difference (const OtherRegion &other) const |
| template<class ResultNumber, HalfplaneIntersectionConcept OtherIntersection> | |
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > | difference (const OtherIntersection &other) const |
| template<class ResultNumber, HalfplaneConcept OtherHalfplane> | |
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > | difference (const OtherHalfplane &other) const |
| template<class ResultNumber, RectangleConcept OtherRectangle> | |
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > | regularizedUnion (const OtherRectangle &other) const |
| template<class ResultNumber, RectangleConcept OtherRectangle> | |
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > | symmetricDifference (const OtherRectangle &other) const |
| template<bool Oriented> | |
| constexpr Rectangle< PointType, LabelType >::template BoundaryType< Oriented > | boundaryAt (std::size_t index) const |
| template<PointConcept OtherPoint> | |
| constexpr Rectangle< PointType, LabelType > & | operator+= (const OtherPoint &translation) |
| template<PointConcept OtherPoint> | |
| constexpr Rectangle< PointType, LabelType > & | operator-= (const OtherPoint &translation) |
| template<class Scalar> requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>) | |
| constexpr Rectangle< PointType, LabelType > & | operator*= (const Scalar &scalar) |
| template<class Scalar> requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>) | |
| constexpr Rectangle< PointType, LabelType > & | operator/= (const Scalar &scalar) |
| template<class OtherNumber> | |
| constexpr Rectangle< PointType, LabelType > | scaledUpX (const OtherNumber scalar) const |
| template<class OtherNumber> | |
| constexpr Rectangle< PointType, LabelType > | scaledUpY (const OtherNumber scalar) const |
| template<class OtherNumber> | |
| constexpr Rectangle< PointType, LabelType > | scaledDownX (const OtherNumber scalar) const |
| template<class OtherNumber> | |
| constexpr Rectangle< PointType, LabelType > | scaledDownY (const OtherNumber scalar) const |
Axis-aligned rectangle stored by minimum and maximum corners.
Axis-aligned rectangle stored by its minimum and maximum corners.
The stored corners are always (min x, min y) and (max x, max y).
| PointType | Corner point type. |
| using pgl::Rectangle< PointType_, TLabel >::BoundaryType = std::conditional_t<Oriented, OrientedSegment<PointType>, Segment<PointType>> |
Selects unordered or oriented boundary segments.
| Oriented | When true, uses OrientedSegment. |
| using pgl::Rectangle< PointType_, TLabel >::const_iterator = CornerIterator |
| using pgl::Rectangle< PointType_, TLabel >::const_reference = PointType |
| using pgl::Rectangle< PointType_, TLabel >::difference_type = std::ptrdiff_t |
| using pgl::Rectangle< PointType_, TLabel >::EdgeIterator = BoundaryIterator<false> |
| using pgl::Rectangle< PointType_, TLabel >::iterator = CornerIterator |
| using pgl::Rectangle< PointType_, TLabel >::LabelType = TLabel |
| using pgl::Rectangle< PointType_, TLabel >::NumberType = PointType::NumberType |
| using pgl::Rectangle< PointType_, TLabel >::OrientedEdgeIterator = BoundaryIterator<true> |
| using pgl::Rectangle< PointType_, TLabel >::PointType = PointType_ |
| using pgl::Rectangle< PointType_, TLabel >::reference = PointType |
| using pgl::Rectangle< PointType_, TLabel >::size_type = std::size_t |
| using pgl::Rectangle< PointType_, TLabel >::value_type = PointType |
Standard range/container typedefs over the vertex sequence.
|
inlineconstexpr |
Creates the empty rectangle [(0,0),(-1,-1)].
The maximum corner falls below the minimum one, which no pair of opposite corners normalizes to, so the rectangle covers no point at all and behaves as EmptyShape everywhere. See empty.
|
inlineconstexpr |
Creates an axis-aligned rectangle from two opposite corners.
When the normalized minimum and maximum corners coincide with the input points, their labels are preserved. Otherwise synthesized corners use default-constructed labels.
Passing minmax stores the corners as given, which is also the only way to build an empty rectangle other than Rectangle(): corners that invert on either axis are not swapped back but read as the empty set, and normalized to its one canonical representation so that all empty rectangles compare equal.
| first | First opposite corner. |
| second | Second opposite corner. |
| minmax | True if we know that first.x() < second.x() and first.y() < second.y() |
|
inlineconstexpr |
Creates an axis-aligned rectangle from four coordinates.
| x1 | X coordinate of the first corner. |
| y1 | Y coordinate of the first corner. |
| x2 | X coordinate of the second corner. |
| y2 | Y coordinate of the second corner. |
| minmax | True if we know that x1 < x2 and y1 < y2 |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
Creates the bounding box of a range of points.
The rectangle corners are the componentwise minimum and maximum points found in the range. An empty range encloses nothing, so it gives the empty rectangle.
| Range | Input range whose elements can be converted to PointType. |
| points | Range of points to enclose. |
|
inlineexplicitconstexpr |
Creates the bounding box of a range of bounded shapes.
The rectangle corners are the componentwise minimum and maximum points found in the range. An empty range, or one whose shapes are all empty, encloses nothing and gives the empty rectangle.
| Range | Input range whose elements can be converted to PointType. |
| points | Range of points to enclose. |
|
nodiscardconstexpr |
Returns the rectangle area.
| ResultNumber | Result type (default: NumberType). |
|
inlinenodiscardconstexpr |
Returns the rectangle as a convex polygon.
|
inlinenodiscardconstexpr |
Returns the rectangle as a half-plane intersection.
The region is the intersection of the four edge half-planes. A degenerate rectangle produces the corresponding degenerate region (a segment or a point), and an empty one the empty region.
|
inlinenodiscardconstexpr |
Returns the rectangle as a simple polygon.
|
inlinenodiscardconstexpr |
Returns the rectangle as a one-component set of regions.
A rectangle with no area covers nothing that survives regularization, so it gives back the empty set rather than a component without area.
|
inlinenodiscardconstexpr |
Returns the rectangle as a hole-free region.
|
nodiscardconstexpr |
Returns the bounding box of the rectangle.
|
inlineconstexpr |
Returns an iterator to the minimum corner.
|
constexpr |
|
inlinenodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
| OtherPoint | Type of the point. |
| point | Point to test. |
Axis-aligned rectangle predicates plus the rectangle-local clipping helpers used to answer strict interior and separation questions.
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
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.
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
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).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
|
inlineconstexpr |
Returns an iterator to the minimum corner.
|
inlineconstexpr |
Returns an iterator past the last corner.
|
nodiscardconstexpr |
Returns the center of the rectangle.
| ResultNumber | Coordinate type of the center. |
|
nodiscardconstexpr |
Returns the centroid of the rectangle.
| ResultNumber | Coordinate type of the centroid. |
|
nodiscardconstexpr |
Returns the circumcircle of the rectangle.
The returned disk passes through the rectangle corners. The empty rectangle has none, so calling this on one is a precondition violation.
|
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. Empty exactly when squaredDistance is zero. Unlike closestSegments this also takes an unbounded convex other — a line, an oriented line, a ray, a half-plane, a half-plane intersection — which realizes the distance at a point on no edge and at no vertex: there is no element to name there, but there is still a point to give.
| ResultNumber | Coordinate type of the returned points (default: division_result_t). |
ResultNumber it truncates. Request a floating-point or pgl::Rational result type for an accurate value.
|
nodiscardconstexpr |
Returns the pair of elements realizing the distance, nothing when the shapes meet.
The first element is this shape's, the second is other's; each is one of the shape's edges, degenerate to a vertex where the shape has none. Empty exactly when squaredDistance is zero.
| ResultNumber | Coordinate type of the returned segments (default: NumberType). |
other's coordinates and labels are re-expressed in this shape's, so a narrower ResultNumber loses them.
|
inlinenodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
The boundary is included.
| OtherPoint | Type of the point. |
| point | Point to test. |
Axis-aligned rectangle predicates plus the rectangle-local clipping helpers used to answer strict interior and separation questions.
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
The boundary is included.
| OtherNumber | Coordinate type of the other rectangle corners. |
| OtherPoint::LabelType | Label type of the other rectangle corners. |
| other | Other rectangle. |
|
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.
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
inlinenodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape contains the other shape (A ⊇ B).
|
inlinenodiscardconstexpr |
Returns the convex hull of the rectangle's vertices.
A rectangle is already convex, so this is asConvex.
|
inlinenodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
For axis-aligned rectangles, this means each one separates the other.
| OtherNumber | Coordinate type of the other rectangle corners. |
| OtherPoint::LabelType | Label type of the other rectangle corners. |
| other | Other rectangle. |
Axis-aligned rectangle predicates plus the rectangle-local clipping helpers used to answer strict interior and separation questions.
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
inlinenodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
Tests whether the two shapes mutually separate each other (each disconnects the other).
|
nodiscardconstexpr |
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::Rectangle< PointType_, TLabel >::difference | ( | const OtherHalfplane & | other | ) | const |
|
nodiscard |
Returns the regularized set difference of the two shapes (A ∖ B).
A half-plane is the one-constraint half-plane intersection, and is handled as one: see difference(const OtherIntersection&) const.
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::Rectangle< PointType_, TLabel >::difference | ( | const OtherIntersection & | other | ) | const |
|
nodiscard |
Returns the regularized set difference of the two shapes (A ∖ B).
A half-plane intersection may be unbounded, which stops it being a regularizedUnion operand but not a subtrahend: A ∖ B is bounded whenever A is, however far B reaches, so a PolygonSet can hold it. See PolygonWithHoles::difference(const OtherIntersection&) const for the clip that bounds it and for the rest of the contract.
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::Rectangle< PointType_, TLabel >::difference | ( | const OtherRegion & | other | ) | const |
|
nodiscard |
Returns the regularized set difference of the two shapes (A ∖ B).
A difference is not symmetric, so there is no higher-ranked operand to hand the pair to the way regularizedUnion does: a rectangle has to state it against every region itself. It states it once, over all six of them, by going through its polygon spelling — the same conversion every other operation makes, and one that costs nothing, the four corners already being in canonical polygon order. See Polygon::difference for the contract.
| ResultNumber | The number type for the result. |
| other | The shape to remove. |
|
inlinenodiscard |
Returns the regularized set difference of the two shapes (A ∖ B), re-dispatching through the wrapper's own difference.
A difference is not symmetric, so unlike regularizedUnion this cannot be handed to other as it stands. It wraps this shape instead and lets the wrapper visit both sides, which throws if the pair is unsupported — here, whenever other turns out to hold anything without area, or a Disk. An unbounded alternative is fine on this side, the result being contained in this shape either way. See Polygon::difference for the contract.
The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Manhattan (L1) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
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.
|
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.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) distance to the given shape.
An axis-aligned rectangle's closest point has integer coordinate gaps against another axis-aligned shape, so the point/rectangle overloads involve no division and are exact.
|
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.
|
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.
|
nodiscardconstexpr |
Returns the four edges as unordered segments.
The empty rectangle has no edges, so calling this on one is a precondition violation; iterate with edgesBegin / edgesEnd to handle it.
|
inlineconstexpr |
Returns an iterator to the first edge.
Edges are visited in the same order as edges().
|
inlineconstexpr |
Returns an iterator past the last edge.
|
inlinenodiscardconstexpr |
Returns whether the rectangle is the empty set of points.
A rectangle is empty when its stored maximum corner falls below its minimum one. Normalizing two opposite corners never produces that state, so it is reached only by Rectangle(), by the minmax constructor, and by the operations that answer with a rectangle covering nothing – all of which store the one canonical empty pair (0,0),(-1,-1). An empty rectangle behaves as EmptyShape: it has no vertices, no area, and every predicate reads it as the empty set.
Because the empty set has exactly that one representation, and because every rectangle covering a point has min x <= max x, the x axis alone decides the question and the y axis need not be read. An operation that writes corners has to keep it that way: corners that invert belong to the canonical empty pair, never to a rectangle of their own.
That one representation is also why a rational coordinate can read the two corners against the canonical constants rather than order them: it asks the same question without a cross-multiplication.
Complexity: O(1).
|
inlineconstexpr |
Returns an iterator past the last corner.
|
nodiscardconstexpr |
Returns a bounding box of the rectangle with floating point coordinates.
| ResultNumber | Floating point type. |
|
inlineconstexpr |
Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the end.
The empty rectangle has no corners to wrap around, so calling this on one is a precondition violation.
|
nodiscardconstexpr |
Returns the point the rectangle collapses to, if it does.
Complexity: O(1).
|
nodiscardconstexpr |
|
nodiscardconstexpr |
Returns the Manhattan (L1) Hausdorff distance to the given shape.
|
nodiscardconstexpr |
Returns the Manhattan (L1) Hausdorff distance to the given shape.
|
nodiscardconstexpr |
Returns the Manhattan (L1) Hausdorff distance to the given shape.
|
nodiscardconstexpr |
Returns the Manhattan (L1) Hausdorff distance to the given shape.
|
inlinenodiscardconstexpr |
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Forwards to the other shape's implementation so that each unordered pair needs hausdorffDistanceL1 defined only once, on the higher-ranked shape.
|
inlinenodiscardconstexpr |
Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own hausdorffDistanceL1.
Distance is symmetric, so this just calls other's own hausdorffDistanceL1, which visits its wrapped alternative and throws if the pair is unsupported.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
|
nodiscardconstexpr |
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
|
inlinenodiscardconstexpr |
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Forwards to the other shape's implementation so that each unordered pair needs hausdorffDistanceLInf defined only once, on the higher-ranked shape.
|
inlinenodiscardconstexpr |
Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own hausdorffDistanceLInf.
Distance is symmetric, so this just calls other's own hausdorffDistanceLInf, which visits its wrapped alternative and throws if the pair is unsupported.
|
inlinenodiscardconstexpr |
|
inlineconstexpr |
Returns the smallest index i with (*this)[i] == point, or -1 if no corner equals point.
The empty rectangle has no corners, so it always answers -1.
|
constexpr |
Enlarges the rectangle so that it contains the given point.
Existing corner labels are preserved when their coordinates do not change. Newly synthesized corners use default-constructed labels.
An empty rectangle bounds nothing and so cannot be grown: it becomes the inserted point outright, rather than stretching to reach its inverted placeholder corners.
| OtherPoint | Type of the point. |
| point | Point to insert. |
|
constexpr |
Enlarges the rectangle so that it contains another rectangle.
Inserting an empty rectangle changes nothing; inserting into an empty one makes it a copy of other.
| OtherNumber | Coordinate type of the other rectangle. |
| OtherPoint::LabelType | Label type of the other rectangle. |
| other | Rectangle to insert. |
|
constexpr |
Enlarges the rectangle so that it contains a finite shape.
The shape must expose bbox(). Infinite shapes such as lines, rays, and halfplanes do not have a finite bounding box and are intentionally not accepted by this overload. A shape whose bounding box is empty contributes nothing.
| shape | Shape to insert. |
|
inlineconstexpr |
Enlarges the rectangle to contain every point in a range of shapes.
The shape must expose bbox(). Infinite shapes such as lines, rays, and halfplanes do not have a finite bounding box and are intentionally not accepted by this overload.
| Range | Range of bounded shapes. |
| range | Range of shapes to insert. |
|
inlineconstexpr |
Enlarges the rectangle so that it contains every point in a range.
A single bounded shape (which exposes bbox()) is handled by the shape overload, even though it may itself be iterable as a range.
| Range | Range of points. |
| range | Points to insert. |
|
inlinenodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
The boundary is excluded.
| OtherNumber | Coordinate type of the other rectangle corners. |
| OtherPoint::LabelType | Label type of the other rectangle corners. |
| other | Other rectangle. |
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
|
nodiscardconstexpr |
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).
|
nodiscardconstexpr |
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) ≠ ∅).
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Rectangles with empty interiors never satisfy this predicate.
| OtherNumber | Coordinate type of the other rectangle corners. |
| OtherPoint::LabelType | Label type of the other rectangle corners. |
| other | Other rectangle. |
Axis-aligned rectangle predicates plus the rectangle-local clipping helpers used to answer strict interior and separation questions.
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
nodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
inlinenodiscardconstexpr |
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
|
nodiscardconstexpr |
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.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
inlinenodiscardconstexpr |
Adds this rectangle's four constraints to a half-plane intersection without deriving vertices.
|
nodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
inlinenodiscardconstexpr |
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
|
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.
other holds is not known until run time, so neither is the result's.
|
inlinenodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Boundary contact counts as intersection.
| OtherNumber | Coordinate type of the other rectangle corners. |
| OtherPoint::LabelType | Label type of the other rectangle corners. |
| other | Other rectangle. |
Axis-aligned rectangle predicates plus the rectangle-local clipping helpers used to answer strict interior and separation questions.
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
inlinenodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
|
nodiscardconstexpr |
Returns whether the rectangle has empty interior.
The empty rectangle has no area either, so it is degenerate.
Axis-aligned rectangle predicates plus the rectangle-local clipping helpers used to answer strict interior and separation questions.
|
nodiscardconstexpr |
Returns whether the rectangle collapses to a single point.
Complexity: O(1).
|
nodiscardconstexpr |
Returns whether the rectangle collapses to a non-degenerate segment.
True when exactly one of width and height is zero, so the rectangle is a horizontal or vertical segment.
Complexity: O(1).
|
nodiscardconstexpr |
Returns whether the rectangle is degenerate without collapsing to a point or to a segment.
A rectangle is undefined if it is not the empty rectangle but has [0] > [1].
Complexity: O(1).
|
inlineconstexpr |
Returns the rectangle label.
The label is mutable even through a const rectangle: it is metadata that does not participate in equality, hashing, or geometric predicates.
|
nodiscard |
Returns the integer points the rectangle contains.
The box is the product of its two sides, so the answer is: every integer of the x range paired with every integer of the y range, with no edge to walk and no crossing to sort. A degenerate box gives the points of the segment or the point it collapsed to.
| ResultNumber | Integer coordinate type of the points: the shape's own coordinate type when that is a signed integer, the integer a pgl::Rational is built on, and int64_t for anything else. |
| std::logic_error | If a coordinate is not finite, or a lattice point of the shape does not fit ResultNumber. |
| std::length_error | If there are more of them than a vector holds. |
|
inlineconstexpr |
|
nodiscardconstexpr |
Returns the midpoint of the rectangle.
The empty rectangle has no point to be the middle of, so calling this on one is a precondition violation.
| ResultNumber | Coordinate type of the midpoint. |
|
inlineconstexpr |
|
nodiscardconstexpr |
Returns the Minkowski erosion of this shape by a bounded polygonal one (A ⊖ B).
The pairs MinkowskiSummableConcept turns away, which are exactly the ones whose sum needs a region: a sum sweeps the operand's concavity into its answer, so it is the operand that decides the result type, and minkowskiSum hands the pair over to it.
An erosion reads the operand only through its support function, and a support function sees no further than the convex hull – A ⊖ B is A ⊖ hull(B) for a convex A. So this shape keeps the pair and answers it with the same convex region it erodes to by any other operand, at a cost linear in the two sizes: a Polygon, a PolygonWithHoles, a PolygonSet, a Polyline and a MonotoneChain are all as cheap here as their vertex count.
| OtherShape | Type of the shape to erode by. |
| other | Shape to erode by. |
other covers no point.
|
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. Two rectangles are the one non-trivial pair closed under the erosion: their minima and their maxima subtract, and the result is empty when a side of the operand is the longer.
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. |
|
inlinenodiscard |
Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
The pairs MinkowskiSummableConcept rejects are exactly the ones whose sum needs a region-valued result rather than one bounded convex shape; they are implemented on Polygon and PolygonWithHoles. Forwards to the other shape's implementation so that each unordered pair needs the sum defined only once, on the higher-ranked shape.
|
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. |
|
inlineexplicitnodiscardconstexpr |
Converts the rectangle to a convex polygon.
The four corners already follow the canonical convex order (counterclockwise, lexicographically smallest first), and degenerate rectangles collapse to their hull. An empty rectangle gives the empty convex polygon, which has no vertices.
|
inlineexplicitnodiscardconstexpr |
Converts the rectangle to a simple polygon.
The four corners already follow the canonical polygon order (counterclockwise, lexicographically smallest first). An empty rectangle gives the empty polygon, which has no vertices.
|
constexpr |
|
constexpr |
Scales the rectangle around the origin in place.
Negative scalars keep the stored corners normalized through the non-member scaling operator.
| Scalar | Scalar type. |
| scalar | Scale factor. |
|
constexpr |
|
constexpr |
Translates both stored corners in place.
| OtherNumber | Coordinate type of the translation point. |
| OtherPoint::LabelType | Label type of the translation point. |
| translation | Translation vector. |
|
constexpr |
|
constexpr |
Translates both stored corners by the opposite vector in place.
| OtherNumber | Coordinate type of the translation point. |
| OtherPoint::LabelType | Label type of the translation point. |
| translation | Translation vector to subtract. |
|
constexpr |
|
constexpr |
Divides the rectangle coordinates by a scalar in place.
Negative divisors keep the stored corners normalized through the non-member division operator.
| Scalar | Scalar type. |
| scalar | Divisor. |
|
inlineconstexpr |
|
inlineconstexpr |
Assigns from a rectangle with compatible point and label types.
|
inlineconstexpr |
|
inlineconstexpr |
Returns corner index for index in [0, 4).
Corners are returned in counterclockwise order starting from the minimum corner: min, bottomRight, max, topLeft. Two of the four corners are synthesized from the stored min/max, so the result is returned by value.
The empty rectangle has no corners, so size is 0 and every index is out of range; the assertion is the only check.
| index | Corner index. |
|
nodiscardconstexpr |
Returns the four boundary edges in counterclockwise order.
The empty rectangle has no edges, so calling this on one is a precondition violation; iterate with orientedEdgesBegin / orientedEdgesEnd to handle it.
|
inlineconstexpr |
Returns an iterator to the first oriented edge.
Oriented edges are visited in the same order as orientedEdges().
|
inlineconstexpr |
Returns an iterator past the last oriented edge.
|
nodiscardconstexpr |
Returns a point inside the rectangle.
This is the midpoint, even for degenerate rectangles. The empty rectangle has no point inside it, so calling this on one is a precondition violation.
| ResultNumber | Coordinate type of the midpoint. |
|
nodiscardconstexpr |
Tests whether some point in this shape's relative interior lies in the strict interior of shape.
Uses pointInside as the witness. When integer truncation rounds that witness onto or outside the boundary, this shape and shape are scaled so the witness is exact, leaving the containment relation unchanged.
|
inlinenodiscardconstexpr |
Forwards a regularized intersection to the shape that owns it.
|
inlinenodiscard |
Re-dispatches a regularized intersection through a runtime shape.
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::Rectangle< PointType_, TLabel >::regularizedUnion | ( | const OtherRectangle< PointType_, TLabel > & | other | ) | const |
|
nodiscard |
Returns the regularized union of the two shapes (A ∪ B).
Two rectangles are the one pair of PolygonalRegionConcept operands a rectangle owns, being the lowest-ranked of them: every other pair is defined on the higher-ranked operand and reached through the forwarding overload below. The union of two rectangles is a rectangle only by coincidence — two that overlap in a corner make an L, and two that are apart make two pieces — so it answers with a set of regions like every other union. See Polygon::regularizedUnion for the contract.
| ResultNumber | The number type for the result. |
| other | The rectangle to unite with. |
|
inlinenodiscard |
Returns the regularized union of the two shapes (A ∪ B).
Forwards to the other shape's implementation so that each unordered pair needs regularizedUnion defined only once, on the higher-ranked shape. See Polygon::regularizedUnion for the contract.
|
inlinenodiscard |
Returns the regularized union of the two shapes (A ∪ B), re-dispatching through the wrapper's own regularizedUnion.
A union is symmetric, so this just calls other's own regularizedUnion, which visits its wrapped alternative and throws if the pair is unsupported — here, whenever other turns out to hold anything but a bounded polygonal region. See Polygon::regularizedUnion for the contract.
The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.
|
constexpr |
Rotates the rectangle by 90k degrees around the origin in place.
| k | Number of 90-degree CCW rotations (may be negative). |
|
nodiscardconstexpr |
Returns the rectangle rotated by 90k degrees around the origin.
| k | Number of 90-degree CCW rotations (may be negative). |
|
nodiscardconstexpr |
Tests whether another shape defines exactly the same point set.
|
constexpr |
|
nodiscardconstexpr |
Returns the rectangle with its x-coordinates divided by a divisor.
|
constexpr |
|
nodiscardconstexpr |
Returns the rectangle with its y-coordinates divided by a divisor.
|
constexpr |
Divides the rectangle's x-coordinates by a divisor in place.
|
constexpr |
Divides the rectangle's y-coordinates by a divisor in place.
|
constexpr |
|
nodiscardconstexpr |
Returns the rectangle with its x-coordinates multiplied by a factor.
|
constexpr |
|
nodiscardconstexpr |
Returns the rectangle with its y-coordinates multiplied by a factor.
|
constexpr |
Multiplies the rectangle's x-coordinates by a factor in place.
|
constexpr |
Multiplies the rectangle's y-coordinates by a factor in place.
|
inlinenodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
|
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.
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
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.
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
nodiscardconstexpr |
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
|
inlinenodiscardconstexpr |
Returns the number of corners: 4, or 0 when empty.
|
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.
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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>(other), for an accurate value.
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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>(other), for an accurate value.
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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>(other), for an accurate value.
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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>(other), for an accurate value.
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
The closest point of an axis-aligned rectangle has integer coordinate gaps, so this overload involves no division and is exact.
The empty rectangle has no nearest point, so no distance is defined from it; this holds for every distance on this shape, Euclidean, L1, LInf, and Hausdorff alike, and calling one on an empty rectangle is a precondition violation.
| ResultNumber | Coordinate type of the returned distance (default: NumberType). |
| OtherPoint | Type of the point. |
| point | Point to measure from. |
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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>(other), for an accurate value.
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
Rectangle-to-rectangle distance uses axis gaps only and is exact.
| ResultNumber | Coordinate type of the returned distance (default: NumberType). |
| OtherNumber | Coordinate type of the other rectangle corners. |
| OtherPoint::LabelType | Label type of the other rectangle corners. |
| other | Other rectangle. |
|
nodiscardconstexpr |
Returns the squared Euclidean distance to the given shape.
| ResultNumber | Coordinate type of the returned distance (default: division_result_t). |
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>(other), for an accurate value.
|
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.
|
nodiscardconstexpr |
Returns the squared Hausdorff distance to a point.
| ResultNumber | Coordinate type of the returned distance (default: NumberType). |
| OtherPoint | Type of the point. |
| point | Point to measure from. |
|
nodiscardconstexpr |
Returns the squared Hausdorff distance to a point.
| ResultNumber | Coordinate type of the returned distance (default: NumberType). |
| OtherPoint | Type of the point. |
| point | Point to measure from. |
|
nodiscardconstexpr |
Returns the squared Hausdorff distance to another rectangle.
For axis-aligned rectangles, the directed Hausdorff distance is attained at a vertex. It uses only point-to-rectangle distances and is exact.
| ResultNumber | Coordinate type of the returned distance (default: NumberType). |
| OtherNumber | Coordinate type of the other rectangle corners. |
| OtherPoint::LabelType | Label type of the other rectangle corners. |
| other | Other rectangle. |
|
nodiscardconstexpr |
Returns the squared Hausdorff distance to a point.
| ResultNumber | Coordinate type of the returned distance (default: NumberType). |
| OtherPoint | Type of the point. |
| point | Point to measure from. |
|
inlinenodiscardconstexpr |
Returns the squared Hausdorff distance to the given shape.
Forwards to the other shape's implementation so that each unordered pair needs squaredHausdorffDistance defined only once, on the higher-ranked shape.
| PolygonSet< Point< ResultNumber, typename PointType_::LabelType > > pgl::Rectangle< PointType_, TLabel >::symmetricDifference | ( | const OtherRectangle< PointType_, TLabel > & | other | ) | const |
|
nodiscard |
Returns the regularized symmetric difference of the two shapes (A △ B).
Two rectangles are the one pair of PolygonalRegionConcept operands a rectangle owns, being the lowest-ranked of them; every other pair is defined on the higher-ranked operand and reached through the forwarding overload below. See Polygon::symmetricDifference for the contract.
| ResultNumber | The number type for the result. |
| other | The other rectangle. |
|
inlinenodiscard |
Returns the regularized symmetric difference of the two shapes (A △ B).
Forwards to the other shape's implementation so that each unordered pair needs symmetricDifference defined only once, on the higher-ranked shape. See Polygon::symmetricDifference for the contract.
|
inlinenodiscard |
Returns the regularized symmetric difference of the two shapes (A △ B), re-dispatching through the wrapper's own symmetricDifference.
A symmetric difference is symmetric, so this just calls other's own, which visits its wrapped alternative and throws if the pair is unsupported. See Polygon::symmetricDifference for the contract.
The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.
|
nodiscardconstexpr |
Returns twice the rectangle area.
|
nodiscardconstexpr |
|
nodiscardconstexpr |
Returns whether a point is one of the rectangle vertices.
| OtherPoint | Type of the point. |
| point | Point to test. |
|
inlinenodiscardconstexpr |