32template <std::
floating_po
int ResultNumber,
class Value>
33constexpr ResultNumber lowerFloatingBound(
const Value& value) {
34 if constexpr (
requires { value.template lowerBound<ResultNumber>(); }) {
35 return value.template lowerBound<ResultNumber>();
37 return static_cast<ResultNumber
>(value);
41template <std::
floating_po
int ResultNumber,
class Value>
42constexpr ResultNumber upperFloatingBound(
const Value& value) {
43 if constexpr (
requires { value.template upperBound<ResultNumber>(); }) {
44 return value.template upperBound<ResultNumber>();
46 return static_cast<ResultNumber
>(value);
52template <
class Po
intType = Po
int<>,
class Label>
57template <
class Po
intType>
60template <
class Number>
63template <std::ranges::input_range Range>
64 requires detail::is_point_v<std::ranges::range_value_t<Range>>
74template <
class Po
intType_,
class TLabel>
80 static_assert(detail::is_point_v<PointType>,
"Rectangle requires pgl::Point corners");
87 template <
bool Oriented>
95 template <
bool Oriented>
96 class BoundaryIterator;
141 if (second.x() < first.x() || second.y() < first.y()) {
142 points_ = emptyCorners();
145 points_[0] = std::move(first);
146 points_[1] = std::move(second);
150 const NumberType min_x = second.x() < first.x() ? second.x() : first.x();
151 const NumberType min_y = second.y() < first.y() ? second.y() : first.y();
152 const NumberType max_x = first.x() < second.x() ? second.x() : first.x();
153 const NumberType max_y = first.y() < second.y() ? second.y() : first.y();
155 const PointType normalized_min = makeCorner(min_x, min_y);
156 const PointType normalized_max = makeCorner(max_x, max_y);
158 if (first == normalized_min && second == normalized_max) {
159 points_[0] = std::move(first);
160 points_[1] = std::move(second);
164 if (second == normalized_min && first == normalized_max) {
165 points_[0] = std::move(second);
166 points_[1] = std::move(first);
170 points_[0] = normalized_min;
171 points_[1] = normalized_max;
186 template<Po
intConcept OtherPo
intType,
class OtherLabelType>
187 requires(std::constructible_from<PointType, const OtherPointType&>)
190 label_ = detail::copyLabel<LabelType>(other);
194 template<Po
intConcept OtherPo
intType,
class OtherLabelType>
195 requires(std::constructible_from<PointType, const OtherPointType&>)
199 label_ = detail::copyLabel<LabelType>(other);
213 template<std::ranges::input_range Range = std::initializer_list<Po
intType>>
214 requires std::ranges::common_range<Range> &&
215 std::convertible_to<std::ranges::range_value_t<Range>,
PointType>
217 for(
const auto &p : points) {
233 template <std::ranges::input_range Range>
234 requires(!detail::is_point_v<typename std::ranges::range_value_t<Range>> &&
requires(
const typename std::ranges::range_value_t<Range>& shape) { shape.bbox(); })
236 for(
const auto &s : shapes) {
258 case 0:
return min();
259 case 1:
return bottomRight();
260 case 2:
return max();
261 default:
return topLeft();
290 [[nodiscard]]
constexpr bool empty()
const {
298 return points_[0].x() == 0 && points_[1].x() == -1;
300 return points_[1].x() < points_[0].x();
307 [[nodiscard]]
constexpr std::size_t
size()
const {
308 return empty() ? 0 : 4;
320 const std::ptrdiff_t n =
static_cast<std::ptrdiff_t
>(
size());
321 return (*
this)[
static_cast<std::size_t
>(((
index % n) + n) % n)];
331 for (std::ptrdiff_t i = 0; i < static_cast<std::ptrdiff_t>(
size()); ++i) {
332 if ((*
this)[
static_cast<std::size_t
>(i)] == point) {
368 [[nodiscard]]
constexpr auto width()
const {
369 using Result =
decltype(
max().x() -
min().x());
378 [[nodiscard]]
constexpr auto height()
const {
379 using Result =
decltype(
max().y() -
min().y());
399 : rect_(rect), index_(
index) {}
402 return (*rect_)[index_];
417 std::size_t index_ = 0;
423 constexpr CornerIterator
begin()
const {
424 return CornerIterator(
this, 0);
430 constexpr CornerIterator
cbegin()
const {
431 return CornerIterator(
this, 0);
437 constexpr CornerIterator
end()
const {
438 return CornerIterator(
this,
size());
444 constexpr CornerIterator
cend()
const {
445 return CornerIterator(
this,
size());
495 return points_ == other.points_;
499 template<AnyShapeConcept OtherShape>
500 [[nodiscard]]
constexpr bool samePointSet(
const OtherShape& other)
const;
504 return points_ <=> other.points_;
515 template <
class A = LabelType>
516 requires(detail::has_label_v<A>)
527 template <
class ResultNumber = NumberType>
528 [[nodiscard]]
constexpr ResultNumber
area()
const;
562 [[nodiscard]]
constexpr std::optional<PointType>
getIfPoint()
const;
584 [[nodiscard]]
constexpr std::optional<BoundaryType<false>>
getIfSegment()
const;
621 template <
class ResultNumber = gr
id_number_t<
typename Po
intType_::NumberType>>
622 requires(detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
632 template <std::
floating_po
int ResultNumber =
double>
644 [[nodiscard]]
constexpr std::array<PointType, 4>
vertices()
const;
655 [[nodiscard]]
constexpr std::array<Segment<PointType>, 4>
edges()
const;
666 [[nodiscard]]
constexpr std::array<OrientedSegment<PointType>, 4>
orientedEdges()
const;
771 template<Po
intConcept OtherPo
int>
784 template<Po
intConcept OtherPo
int>
785 [[nodiscard]]
constexpr bool contains(
const OtherPoint& point)
const;
788 template<LineConcept OtherLine>
789 [[nodiscard]]
constexpr bool contains(
const OtherLine& other)
const;
792 template<OrientedLineConcept OtherOrientedLine>
793 [[nodiscard]]
constexpr bool contains(
const OtherOrientedLine& other)
const;
796 template<SegmentConcept OtherSegment>
797 [[nodiscard]]
constexpr bool contains(
const OtherSegment& other)
const;
800 template<OrientedSegmentConcept OtherOrientedSegment>
801 [[nodiscard]]
constexpr bool contains(
const OtherOrientedSegment& other)
const;
804 template<RayConcept OtherRay>
805 [[nodiscard]]
constexpr bool contains(
const OtherRay& other)
const;
808 template<HalfplaneConcept OtherHalfplane>
809 [[nodiscard]]
constexpr bool contains(
const OtherHalfplane& other)
const;
821 template<RectangleConcept OtherRectangle>
822 [[nodiscard]]
constexpr bool contains(
const OtherRectangle& other)
const;
825 template<TriangleConcept OtherTriangle>
826 [[nodiscard]]
constexpr bool contains(
const OtherTriangle& other)
const;
829 template<ConvexConcept OtherConvex>
830 [[nodiscard]]
constexpr bool contains(
const OtherConvex& other)
const;
833 template<PolygonConcept OtherPolygon>
834 [[nodiscard]]
constexpr bool contains(
const OtherPolygon& other)
const;
837 template<DiskConcept OtherDisk>
838 [[nodiscard]]
constexpr bool contains(
const OtherDisk& other)
const;
851 template <
class EmptyPo
int>
856 template <
class EmptyPo
int>
861 template <
class EmptyPo
int>
866 template <
class EmptyPo
int>
872 template<Po
intConcept OtherPo
int>
876 template<LineConcept OtherLine>
880 template<OrientedLineConcept OtherOrientedLine>
884 template<SegmentConcept OtherSegment>
888 template<OrientedSegmentConcept OtherOrientedSegment>
892 template<RayConcept OtherRay>
896 template<HalfplaneConcept OtherHalfplane>
909 template<RectangleConcept OtherRectangle>
913 template<TriangleConcept OtherTriangle>
924 template<Po
intConcept OtherPo
int>
928 template<SegmentConcept OtherSegment>
932 template<OrientedSegmentConcept OtherOrientedSegment>
936 template<LineConcept OtherLine>
940 template<OrientedLineConcept OtherOrientedLine>
944 template<RayConcept OtherRay>
948 template<HalfplaneConcept OtherHalfplane>
952 template<RectangleConcept OtherRectangle>
956 template<TriangleConcept OtherTriangle>
960 template<ConvexConcept OtherConvex>
964 template<PolygonConcept OtherPolygon>
968 template<DiskConcept OtherDisk>
981 template<Po
intConcept OtherPo
int>
982 [[nodiscard]]
constexpr bool intersects(
const OtherPoint& other)
const;
985 template<RectangleConcept OtherRectangle>
986 [[nodiscard]]
constexpr bool intersects(
const OtherRectangle& other)
const;
989 template<LineConcept OtherLine>
990 [[nodiscard]]
constexpr bool intersects(
const OtherLine& other)
const;
993 template<OrientedLineConcept OtherOrientedLine>
994 [[nodiscard]]
constexpr bool intersects(
const OtherOrientedLine& other)
const;
997 template<SegmentConcept OtherSegment>
998 [[nodiscard]]
constexpr bool intersects(
const OtherSegment& other)
const;
1001 template<OrientedSegmentConcept OtherOrientedSegment>
1002 [[nodiscard]]
constexpr bool intersects(
const OtherOrientedSegment& other)
const;
1005 template<RayConcept OtherRay>
1006 [[nodiscard]]
constexpr bool intersects(
const OtherRay& other)
const;
1009 template<HalfplaneConcept OtherHalfplane>
1010 [[nodiscard]]
constexpr bool intersects(
const OtherHalfplane& other)
const;
1016 template<
typename OtherShape>
1018 [[nodiscard]]
constexpr bool intersects(
const OtherShape& other)
const {
1019 return other.intersects(*
this);
1023 template <
class EmptyPo
int>
1038 template<Po
intConcept OtherPo
int>
1042 template<RectangleConcept OtherRectangle>
1046 template<LineConcept OtherLine>
1050 template<OrientedLineConcept OtherOrientedLine>
1054 template<SegmentConcept OtherSegment>
1058 template<OrientedSegmentConcept OtherOrientedSegment>
1062 template<RayConcept OtherRay>
1066 template<HalfplaneConcept OtherHalfplane>
1070 template<
typename OtherShape>
1073 return other.interiorsIntersect(*
this);
1077 template <
class EmptyPo
int>
1086 template<RectangleConcept OtherRectangle>
1087 [[nodiscard]]
constexpr bool separates(
const OtherRectangle& other)
const;
1090 template<Po
intConcept OtherPo
int>
1091 [[nodiscard]]
constexpr bool separates(
const OtherPoint& other)
const;
1094 template<LineConcept OtherLine>
1095 [[nodiscard]]
constexpr bool separates(
const OtherLine& other)
const;
1098 template<OrientedLineConcept OtherOrientedLine>
1099 [[nodiscard]]
constexpr bool separates(
const OtherOrientedLine& other)
const;
1102 template<SegmentConcept OtherSegment>
1103 [[nodiscard]]
constexpr bool separates(
const OtherSegment& other)
const;
1106 template<OrientedSegmentConcept OtherOrientedSegment>
1107 [[nodiscard]]
constexpr bool separates(
const OtherOrientedSegment& other)
const;
1110 template<RayConcept OtherRay>
1111 [[nodiscard]]
constexpr bool separates(
const OtherRay& other)
const;
1114 template<HalfplaneConcept OtherHalfplane>
1115 [[nodiscard]]
constexpr bool separates(
const OtherHalfplane& other)
const;
1118 template<TriangleConcept OtherTriangle>
1119 [[nodiscard]]
constexpr bool separates(
const OtherTriangle& other)
const;
1122 template<ConvexConcept OtherConvex>
1123 [[nodiscard]]
constexpr bool separates(
const OtherConvex& other)
const;
1126 template<DiskConcept OtherDisk>
1127 [[nodiscard]]
constexpr bool separates(
const OtherDisk& other)
const;
1130 template<PolygonConcept OtherPolygon>
1131 [[nodiscard]]
constexpr bool separates(
const OtherPolygon& other)
const;
1134 template<MonotoneChainConcept OtherChain>
1135 [[nodiscard]]
constexpr bool contains(
const OtherChain& other)
const;
1138 template<MonotoneChainConcept OtherChain>
1142 template<MonotoneChainConcept OtherChain>
1146 template<MonotoneChainConcept OtherChain>
1147 [[nodiscard]]
constexpr bool separates(
const OtherChain& other)
const;
1150 template<PolylineConcept OtherPolyline>
1151 [[nodiscard]]
constexpr bool contains(
const OtherPolyline& other)
const;
1154 template<PolylineConcept OtherPolyline>
1158 template<PolylineConcept OtherPolyline>
1162 template<PolylineConcept OtherPolyline>
1163 [[nodiscard]]
constexpr bool separates(
const OtherPolyline& other)
const;
1166 template<HalfplaneIntersectionConcept OtherRegion>
1167 [[nodiscard]]
constexpr bool contains(
const OtherRegion& other)
const;
1170 template<HalfplaneIntersectionConcept OtherRegion>
1174 template<HalfplaneIntersectionConcept OtherRegion>
1178 template<HalfplaneIntersectionConcept OtherRegion>
1179 [[nodiscard]]
constexpr bool separates(
const OtherRegion& other)
const;
1188 template<PolygonWithHolesConcept OtherRegion>
1189 [[nodiscard]]
constexpr bool contains(
const OtherRegion& other)
const;
1197 template<PolygonWithHolesConcept OtherRegion>
1201 template<PolygonWithHolesConcept OtherRegion>
1211 template<PolygonWithHolesConcept OtherRegion>
1212 [[nodiscard]]
bool separates(
const OtherRegion& other)
const;
1223 template<PolygonSetConcept OtherSet>
1224 [[nodiscard]]
constexpr bool contains(
const OtherSet& other)
const {
1225 for (
const auto& component : other) {
1234 template<PolygonSetConcept OtherSet>
1236 for (
const auto& component : other) {
1245 template<PolygonSetConcept OtherSet>
1247 for (
const auto& component : other) {
1263 template<PolygonSetConcept OtherSet>
1271 template<DiskConcept OtherDisk>
1275 template<ConvexConcept OtherConvex>
1279 template<PolygonConcept OtherPolygon>
1293 template<RectangleConcept OtherRectangle>
1294 [[nodiscard]]
constexpr bool crosses(
const OtherRectangle& other)
const;
1297 template<Po
intConcept OtherPo
int>
1298 [[nodiscard]]
constexpr bool crosses(
const OtherPoint& other)
const;
1301 template<LineConcept OtherLine>
1302 [[nodiscard]]
constexpr bool crosses(
const OtherLine& other)
const;
1305 template<OrientedLineConcept OtherOrientedLine>
1306 [[nodiscard]]
constexpr bool crosses(
const OtherOrientedLine& other)
const;
1309 template<SegmentConcept OtherSegment>
1310 [[nodiscard]]
constexpr bool crosses(
const OtherSegment& other)
const;
1313 template<OrientedSegmentConcept OtherOrientedSegment>
1314 [[nodiscard]]
constexpr bool crosses(
const OtherOrientedSegment& other)
const;
1317 template<RayConcept OtherRay>
1318 [[nodiscard]]
constexpr bool crosses(
const OtherRay& other)
const;
1321 template<HalfplaneConcept OtherHalfplane>
1322 [[nodiscard]]
constexpr bool crosses(
const OtherHalfplane& other)
const;
1325 template<
typename OtherShape>
1327 [[nodiscard]]
constexpr bool crosses(
const OtherShape& other)
const {
1328 return other.crosses(*
this);
1332 template <
class EmptyPo
int>
1341 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1342 [[nodiscard]]
constexpr std::optional<Point<ResultNumber, typename PointType::LabelType>>
1346 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1347 [[nodiscard]]
constexpr std::optional<Rectangle<Point<ResultNumber, typename PointType::LabelType>>>
1351 template <
class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
1356 template <
class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
1361 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1366 template <
class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
1371 template <
class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
1376 template <
class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
1377 [[nodiscard]]
constexpr auto intersection(
const OtherHalfplane& other)
const;
1380 template <
class ResultNumber = NumberType, HalfplaneIntersectionConcept OtherRegion>
1381 [[nodiscard]]
constexpr auto intersection(
const OtherRegion& other)
const {
1386 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1389 && (detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1390 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1398 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1400 && (detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1401 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1409 template <
class ResultNumber = NumberType,
class EmptyPo
int>
1431 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1445 template <
class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
1449 template <
class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
1453 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1457 template <
class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
1461 template <
class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
1465 template <
class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
1479 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1488 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1489 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1490 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1504 template <
class ResultNumber =
double,
class DiskPo
intType,
class DiskLabel>
1521 template <
class ResultNumber = NumberType, BoundedPolygonalConcept OtherShape>
1522 requires detail::ClosestPairConcept<Rectangle<PointType_, TLabel>, OtherShape>
1541 template <
class ResultNumber = division_result_t<NumberType>,
class OtherShape>
1542 requires detail::ClosestPointsPairConcept<Rectangle<PointType_, TLabel>, OtherShape>
1552 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1553 [[nodiscard]]
constexpr auto distanceL1(
const OtherPoint& point)
const;
1556 template <
class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
1557 [[nodiscard]]
constexpr auto distanceL1(
const OtherLine& other)
const;
1560 template <
class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
1561 [[nodiscard]]
constexpr auto distanceL1(
const OtherOrientedLine& other)
const;
1564 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1565 [[nodiscard]]
constexpr auto distanceL1(
const OtherSegment& other)
const;
1568 template <
class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
1569 [[nodiscard]]
constexpr auto distanceL1(
const OtherOrientedSegment& other)
const;
1572 template <
class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
1573 [[nodiscard]]
constexpr auto distanceL1(
const OtherRay& other)
const;
1576 template <
class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
1577 [[nodiscard]]
constexpr auto distanceL1(
const OtherHalfplane& other)
const;
1580 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1581 [[nodiscard]]
constexpr auto distanceL1(
const OtherRectangle& other)
const;
1589 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1590 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1591 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1594 [[nodiscard]]
constexpr auto distanceL1(
const OtherShape& other)
const {
1613 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1619 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1636 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1655 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1672 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1685 template <
class ResultNumber =
double, Po
intConcept OtherPo
int>
1697 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1701 template <
class ResultNumber = division_result_t<NumberType>, LineConcept OtherLine>
1705 template <
class ResultNumber = division_result_t<NumberType>, OrientedLineConcept OtherOrientedLine>
1706 [[nodiscard]]
constexpr auto distanceLInf(
const OtherOrientedLine& other)
const;
1709 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1710 [[nodiscard]]
constexpr auto distanceLInf(
const OtherSegment& other)
const;
1713 template <
class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
1714 [[nodiscard]]
constexpr auto distanceLInf(
const OtherOrientedSegment& other)
const;
1717 template <
class ResultNumber = division_result_t<NumberType>, RayConcept OtherRay>
1721 template <
class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
1722 [[nodiscard]]
constexpr auto distanceLInf(
const OtherHalfplane& other)
const;
1725 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1726 [[nodiscard]]
constexpr auto distanceLInf(
const OtherRectangle& other)
const;
1734 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1735 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1736 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1751 template <
class ResultNumber =
double, Po
intConcept OtherPo
int>
1757 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1761 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1765 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1769 template <
class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
1778 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1779 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1780 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1795 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1801 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1805 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1809 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1813 template <
class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
1822 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1823 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1824 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1839 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1856 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1867 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1871 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1875 template <
class ResultNumber = division_result_t<NumberType>, OrientedSegmentConcept OtherOrientedSegment>
1884 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1885 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
1886 &&
requires(
const OtherShape& o,
const Rectangle& self) {
1907 template <Po
intConcept OtherPo
int>
1908 constexpr void insert(
const OtherPoint& point);
1920 template <RectangleConcept OtherRectangle>
1921 constexpr void insert(
const OtherRectangle& other);
1934 template <
class TShape>
1935 requires(!detail::is_point_v<TShape> && !
RectangleConcept<TShape> &&
requires(
const TShape& shape) { shape.bbox(); })
1947 template<std::ranges::input_range Range = std::initializer_list<Po
intType>>
1948 requires std::ranges::common_range<Range> &&
1949 std::convertible_to<std::ranges::range_value_t<Range>,
PointType> &&
1950 (!
requires(
const std::remove_cvref_t<Range>& shape) { shape.bbox(); })
1954 for (
const auto& point : range) {
1969 template <std::ranges::input_range Range>
1970 requires(!detail::is_point_v<typename std::ranges::range_value_t<Range>> &&
requires(
const typename std::ranges::range_value_t<Range>& shape) { shape.bbox(); })
1974 for (
const auto& shape : range) {
1999 template <
class ResultNumber = division_result_t<NumberType>>
2009 template <
class ResultNumber = division_result_t<NumberType>>
2028 template <
class ResultNumber = division_result_t<NumberType>>
2042 template <
class ResultNumber = division_result_t<NumberType>>
2053 template <
class OtherShape>
2072 template <
class OtherNumber>
2076 template <
class OtherNumber>
2080 template <
class OtherNumber>
2084 template <
class OtherNumber>
2088 template <
class OtherNumber>
2092 template <
class OtherNumber>
2096 template <
class OtherNumber>
2100 template <
class OtherNumber>
2116 template <
class OtherShape>
2144 template <
class OtherShape>
2170 template <
class OtherShape>
2185 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
2187 && (detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
2188 &&
requires(
const OtherShape& o,
const Rectangle& self) {
2210 template <
class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
2221 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
2222 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
2223 &&
requires(
const OtherShape& o,
const Rectangle& self) {
2245 template <
class ResultNumber = division_result_t<NumberType>, PolygonalRegionConcept OtherRegion>
2258 template <
class ResultNumber = division_result_t<NumberType>, HalfplaneIntersectionConcept OtherIntersection>
2268 template <
class ResultNumber = division_result_t<NumberType>, HalfplaneConcept OtherHalfplane>
2284 template <
class ResultNumber = division_result_t<NumberType>, RectangleConcept OtherRectangle>
2295 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
2296 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Rectangle>)
2297 &&
requires(
const OtherShape& o,
const Rectangle& self) {
2312 template<Po
intConcept OtherPo
int>
2323 template<Po
intConcept OtherPo
int>
2336 template <
class Scalar>
2350 template <
class Scalar>
2354 template <
bool Oriented>
2366 assert(rectangle !=
nullptr);
2367 return rectangle->template boundaryAt<Oriented>(index);
2387 : rectangle(rectangle_arg), index(index_arg) {}
2390 std::size_t
index = 0;
2394 static constexpr std::size_t edgeCount = 4;
2406 static constexpr std::array<PointType, 2> emptyCorners() {
2416 constexpr PointType bottomRight()
const;
2435 template <
bool Oriented>
2438 template <
class Left,
class Right>
2439 static constexpr bool intervalsOverlap(
const Left& first_min,
const Left& first_max,
const Right& second_min,
const Right& second_max);
2441 template <
class Left,
class Right>
2442 static constexpr bool intervalsOverlapStrict(
const Left& first_min,
const Left& first_max,
const Right& second_min,
const Right& second_max);
2444 template <
class Left,
class Right>
2445 static constexpr auto axisDistance(
const Left& first_min,
const Left& first_max,
const Right& second_min,
const Right& second_max)
2446 -> std::common_type_t<Left, Right>;
2452 std::array<PointType, 2> points_{};
2453 [[no_unique_address]]
mutable LabelType label_{};
2467template <
class Po
intType,
class LabelType,
class TranslationNumber,
class TranslationLabel>
2480template <
class Po
intType,
class LabelType,
class Scalar>
2494template <
class Scalar,
class Po
intType,
class LabelType>
2508template <
class Po
intType,
class LabelType,
class Scalar>
2521template <
class Po
intType,
class LabelType>
constexpr value_type operator*() const
Definition rectangle.hpp:2365
constexpr BoundaryIterator operator++(int)
Definition rectangle.hpp:2375
value_type reference
Definition rectangle.hpp:2361
BoundaryType< Oriented > value_type
Definition rectangle.hpp:2359
std::forward_iterator_tag iterator_category
Definition rectangle.hpp:2357
constexpr BoundaryIterator & operator++()
Definition rectangle.hpp:2370
std::forward_iterator_tag iterator_concept
Definition rectangle.hpp:2358
constexpr BoundaryIterator()=default
friend struct Rectangle
Definition rectangle.hpp:2384
constexpr bool operator==(const BoundaryIterator &other) const =default
std::ptrdiff_t difference_type
Definition rectangle.hpp:2360
constexpr CornerIterator & operator++()
Definition rectangle.hpp:404
constexpr CornerIterator()=default
std::forward_iterator_tag iterator_category
Definition rectangle.hpp:391
constexpr CornerIterator operator++(int)
Definition rectangle.hpp:408
std::ptrdiff_t difference_type
Definition rectangle.hpp:393
PointType value_type
Definition rectangle.hpp:392
void pointer
Definition rectangle.hpp:394
PointType reference
Definition rectangle.hpp:395
constexpr bool operator==(const CornerIterator &) const =default
constexpr PointType operator*() const
Definition rectangle.hpp:401
constexpr CornerIterator(const Rectangle *rect, std::size_t index)
Definition rectangle.hpp:398
Bounded polygonal primitives, convex or not.
Definition forward.hpp:373
Definition forward.hpp:319
Shape pairs whose Minkowski sum Pangolin can represent.
Definition forward.hpp:476
Definition forward.hpp:306
Definition forward.hpp:313
Definition arrangement.hpp:67
HalfplaneIntersection() -> HalfplaneIntersection< Point<>, NoLabel >
Definition halfplaneintersection.hpp:2308
@ y
Definition intervaltree.hpp:24
@ x
Definition intervaltree.hpp:24
Rectangle() -> Rectangle< Point<>, NoLabel >
Definition rectangle.hpp:2384
constexpr bool is_Rational_v
Definition rational.hpp:37
constexpr auto operator-(const Point< LeftNumber, LeftLabel > &left, const Point< RightNumber, RightLabel > &right)
Translates a point by the opposite of another point.
Definition transformations.hpp:130
Shape(const std::variant< T, Ts... > &) -> Shape< detail::shape_point_type_t< T > >
std::ostream & operator<<(std::ostream &stream, const Point< Number, Label > &point)
Streams a point as (x,y) or label:(x,y).
Definition io.hpp:27
Public declaration of pgl::Ray.
Closed convex polygon stored by its vertices.
Definition convex.hpp:170
Closed Euclidean disk stored by boundary points plus optional disk label.
Definition disk.hpp:66
The empty set of points in the plane.
Definition emptyshape.hpp:33
Intersection of closed half-planes; convex but possibly unbounded or empty.
Definition halfplaneintersection.hpp:244
Sentinel type used when a point carries no extra label.
Definition point.hpp:31
Two-dimensional point with optional label payload.
Definition point.hpp:129
Set of closed regions with pairwise disjoint interiors.
Definition polygonset.hpp:165
Closed region bounded by one outer simple polygon minus disjoint polygonal holes.
Definition polygonwithholes.hpp:89
Closed simple polygon stored by its vertices.
Definition polygon.hpp:59
Axis-aligned rectangle stored by minimum and maximum corners.
Definition rectangle.hpp:75
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > regularizedUnion(const OtherRectangle &other) const
Returns the regularized union of the two shapes (A ∪ B).
constexpr auto distanceLInf(const OtherOrientedSegment &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:530
constexpr bool crosses(const Shape< PointType > &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:474
constexpr bool separates(const OtherChain &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:3185
constexpr bool separates(const OtherTriangle &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1272
constexpr std::optional< PointType > getIfPoint() const
Returns the point the rectangle collapses to, if it does.
Definition predicates.hpp:881
constexpr PointType get(std::ptrdiff_t index) const
Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the en...
Definition rectangle.hpp:318
constexpr auto closestSegments(const OtherShape &other) const
Returns the pair of elements realizing the distance, nothing when the shapes meet.
Definition closest.hpp:342
constexpr bool contains(const OtherConvex &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:822
constexpr auto distanceLInf(const OtherRay &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:539
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.
Definition intersection.hpp:1008
constexpr bool verticesContain(const OtherPoint &point) const
Returns whether a point is one of the rectangle vertices.
Definition predicates.hpp:921
constexpr bool interiorContains(const OtherLine &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:561
constexpr auto squaredDistance(const OtherOrientedSegment &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:543
constexpr Rectangle rotated90(int k=1) const
Returns the rectangle rotated by 90k degrees around the origin.
Definition transformations.hpp:1157
PointType const_reference
Definition rectangle.hpp:106
constexpr bool contains(const OtherSet &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition rectangle.hpp:1224
constexpr auto hausdorffDistanceLInf(const OtherRectangle &other) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition distancelinf.hpp:982
constexpr CornerIterator cbegin() const
Returns an iterator to the minimum corner.
Definition rectangle.hpp:430
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference(const OtherIntersection &other) const
Returns the regularized set difference of the two shapes (A ∖ B).
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.
Definition intersection.hpp:1029
std::conditional_t< Oriented, OrientedSegment< PointType >, Segment< PointType > > BoundaryType
Definition rectangle.hpp:88
constexpr auto hausdorffDistanceLInf(const OtherSegment &other) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition distancelinf.hpp:1002
constexpr bool boundaryContains(const OtherOrientedSegment &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:291
constexpr bool boundaryContains(const OtherConvex &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:380
constexpr auto distanceLInf(const OtherRectangle &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:573
constexpr auto squaredHausdorffDistance(const OtherRectangle &other) const
Returns the squared Hausdorff distance to another rectangle.
Definition distance.hpp:597
constexpr bool interiorContains(const OtherPoint &point) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:553
CornerIterator const_iterator
Definition rectangle.hpp:108
constexpr HalfplaneIntersection< PointType > asHalfplaneIntersection() const
Returns the rectangle as a half-plane intersection.
Definition rectangle.hpp:712
constexpr bool contains(const OtherRay &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:780
BoundaryIterator< true > OrientedEdgeIterator
Definition rectangle.hpp:111
constexpr void scaleUpY(const OtherNumber scalar)
Multiplies the rectangle's y-coordinates by a factor in place.
Definition transformations.hpp:1202
constexpr auto hausdorffDistanceLInf(const OtherShape &other) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition rectangle.hpp:1827
constexpr auto distanceL1(const OtherLine &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:484
constexpr auto squaredDistance(const OtherShape &other) const
Returns the squared Euclidean distance to the given shape.
Definition rectangle.hpp:1493
constexpr bool interiorsIntersect(const OtherSegment &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:605
constexpr bool separates(const Shape< PointType > &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1360
constexpr Rectangle< Point< ResultNumber > > fbox() const
Returns a bounding box of the rectangle with floating point coordinates.
Definition bounding.hpp:146
constexpr bool crosses(const OtherHalfplane &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:464
constexpr bool contains(const OtherTriangle &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:812
constexpr bool crosses(const OtherOrientedSegment &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:444
constexpr bool interiorContains(const OtherRegion &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
constexpr auto hausdorffDistanceLInf(const OtherPoint &point) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition distancelinf.hpp:993
constexpr bool isPoint() const
Returns whether the rectangle collapses to a single point.
Definition predicates.hpp:876
constexpr bool contains(const Shape< PointType > &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:856
constexpr bool separates(const OtherRectangle &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1177
constexpr ResultNumber area() const
Returns the rectangle area.
Definition measures.hpp:284
constexpr bool contains(const OtherRegion &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2792
constexpr bool separates(const OtherConvex &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1306
constexpr PointType operator[](std::size_t index) const
Returns corner index for index in [0, 4).
Definition rectangle.hpp:255
constexpr bool interiorContains(const OtherTriangle &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:633
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 dist...
Definition rectangle.hpp:1686
constexpr auto squaredHausdorffDistance(const OtherOrientedSegment &other) const
Returns the squared Hausdorff distance to a point.
Definition distance.hpp:628
constexpr Point< ResultNumber > midpoint() const
Returns the midpoint of the rectangle.
Definition measures.hpp:304
constexpr Rectangle & operator+=(const OtherPoint &translation)
Translates both stored corners in place.
constexpr bool isDegenerate() const
Returns whether the rectangle has empty interior.
Definition predicates.hpp:869
constexpr auto hausdorffDistanceLInf(const OtherOrientedSegment &other) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition distancelinf.hpp:1013
auto symmetricDifference(const Shape< OtherPoint > &other) const
Returns the regularized symmetric difference of the two shapes (A △ B), re-dispatching through the wr...
Definition rectangle.hpp:1673
constexpr auto distanceLInf(const OtherOrientedLine &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:494
constexpr bool separates(const OtherPolyline &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:3990
constexpr Point< ResultNumber > pointInside() const
Returns a point inside the rectangle.
Definition measures.hpp:331
constexpr bool intersects(const OtherSegment &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:549
constexpr auto intersection(const OtherHalfplane &other) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition intersection.hpp:1080
constexpr auto distanceL1(const OtherRay &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:551
constexpr void insert(Range &&range)
Enlarges the rectangle to contain every point in a range of shapes.
Definition rectangle.hpp:1971
bool separates(const OtherRegion &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:5707
constexpr auto height() const
Returns the rectangle height.
Definition rectangle.hpp:378
constexpr auto squaredDistance(const OtherLine &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:485
auto regularizedIntersection(const Shape< OtherPoint > &other) const
Re-dispatches a regularized intersection through a runtime shape.
Definition rectangle.hpp:1620
constexpr bool separates(const OtherDisk &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1324
constexpr bool crosses(const OtherPoint &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:408
constexpr bool interiorsIntersect(const OtherRay &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:631
constexpr Rectangle & operator-=(const OtherPoint &translation)
Translates both stored corners by the opposite vector in place.
constexpr bool boundaryContains(const OtherHalfplane &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:331
constexpr bool intersects(const OtherPoint &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:502
constexpr auto minkowskiErosion(const OtherShape &other) const
Returns the Minkowski erosion of this shape by another (A ⊖ B).
Definition minkowskierosion.hpp:633
constexpr auto intersection(const OtherRegion &other) const
Adds this rectangle's four constraints to a half-plane intersection without deriving vertices.
Definition rectangle.hpp:1381
constexpr bool intersects(const OtherHalfplane &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:588
constexpr bool crosses(const OtherShape &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition rectangle.hpp:1327
constexpr bool separates(const OtherOrientedLine &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1217
PointType::NumberType NumberType
Definition rectangle.hpp:77
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.
Definition intersection.hpp:1058
constexpr bool boundaryContains(const OtherRegion &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1698
constexpr bool crosses(const EmptyShape< EmptyPoint > &) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition rectangle.hpp:1333
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > symmetricDifference(const OtherRectangle &other) const
Returns the regularized symmetric difference of the two shapes (A △ B).
constexpr bool interiorContains(const OtherDisk &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1302
constexpr OrientedEdgeIterator orientedEdgesEnd() const
Returns an iterator past the last oriented edge.
Definition rectangle.hpp:484
constexpr bool boundaryContains(const OtherTriangle &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:364
constexpr bool boundaryContains(const OtherPolygon &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1046
constexpr Point< ResultNumber > centroid() const
Returns the centroid of the rectangle.
Definition measures.hpp:313
constexpr Rectangle scaledDownX(const OtherNumber scalar) const
Returns the rectangle with its x-coordinates divided by a divisor.
constexpr Rectangle(PointType first, PointType second, bool minmax=false)
Creates an axis-aligned rectangle from two opposite corners.
Definition rectangle.hpp:139
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.
Definition intersection.hpp:1040
constexpr bool interiorContains(const OtherRay &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:601
constexpr auto minkowskiSum(const OtherShape &other) const
Returns the Minkowski sum of this shape and another (A ⊕ B).
Definition minkowski.hpp:800
constexpr const PointType & min() const
Definition rectangle.hpp:347
constexpr bool interiorContains(const OtherChain &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1513
PointType value_type
Definition rectangle.hpp:102
constexpr bool operator==(const Rectangle &other) const
Provides lexicographic ordering on (min, max).
Definition rectangle.hpp:494
constexpr bool separates(const OtherHalfplane &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1261
PointType reference
Definition rectangle.hpp:105
constexpr bool separates(const OtherPolygon &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:2018
constexpr bool samePointSet(const OtherShape &other) const
Tests whether another shape defines exactly the same point set.
Definition samepointset.hpp:1983
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference(const OtherRegion &other) const
Returns the regularized set difference of the two shapes (A ∖ B).
constexpr bool interiorsIntersect(const Shape< PointType > &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:666
constexpr bool intersects(const OtherLine &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:523
constexpr auto regularizedIntersection(const OtherShape &other) const
Forwards a regularized intersection to the shape that owns it.
Definition rectangle.hpp:1404
constexpr bool empty() const
Returns whether the rectangle is the empty set of points.
Definition rectangle.hpp:290
constexpr std::array< OrientedSegment< PointType >, 4 > orientedEdges() const
Returns the four boundary edges in counterclockwise order.
Definition bounding.hpp:210
constexpr bool interiorContains(const OtherOrientedSegment &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:591
constexpr bool boundaryContains(const OtherRegion &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
auto regularizedUnion(const OtherShape &other) const
Returns the regularized union of the two shapes (A ∪ B).
Definition rectangle.hpp:2226
constexpr bool interiorsIntersect(const OtherPoint &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:551
constexpr PolygonWithHoles< PointType > asPolygonWithHoles() const
Returns the rectangle as a hole-free region.
Definition rectangle.hpp:747
constexpr void rotate90(int k=1)
Rotates the rectangle by 90k degrees around the origin in place.
Definition transformations.hpp:1166
constexpr bool contains(const OtherPolyline &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2422
constexpr bool interiorContains(const OtherRegion &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:2094
constexpr bool contains(const OtherHalfplane &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:790
constexpr A & label() const
Returns the rectangle label.
Definition rectangle.hpp:517
constexpr EdgeIterator edgesEnd() const
Returns an iterator past the last edge.
Definition rectangle.hpp:464
constexpr bool interiorsIntersect(const OtherLine &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:573
constexpr std::array< Segment< PointType >, 4 > edges() const
Returns the four edges as unordered segments.
Definition bounding.hpp:199
constexpr auto squaredDistance(const OtherOrientedLine &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:507
constexpr bool interiorContains(const OtherSegment &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:581
constexpr auto distanceL1(const OtherRectangle &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:585
constexpr bool isSegment() const
Returns whether the rectangle collapses to a non-degenerate segment.
Definition predicates.hpp:889
constexpr bool interiorContains(const OtherHalfplane &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:611
constexpr auto hausdorffDistanceL1(const OtherSegment &other) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition distancel1.hpp:1014
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 haus...
Definition rectangle.hpp:1840
auto minkowskiSum(const OtherShape &other) const
Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
Definition rectangle.hpp:2191
constexpr auto squaredDistance(const OtherPoint &point) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:474
auto regularizedUnion(const Shape< OtherPoint > &other) const
Returns the regularized union of the two shapes (A ∪ B), re-dispatching through the wrapper's own reg...
Definition rectangle.hpp:1637
constexpr Point< ResultNumber > center() const
Returns the center of the rectangle.
Definition measures.hpp:325
constexpr auto closestPoints(const OtherShape &other) const
Returns the pair of points realizing the distance, nothing when the shapes meet.
Definition closest.hpp:349
constexpr Rectangle(Range &&shapes)
Creates the bounding box of a range of bounded shapes.
Definition rectangle.hpp:235
constexpr auto squaredHausdorffDistance(const OtherShape &other) const
Returns the squared Hausdorff distance to the given shape.
Definition rectangle.hpp:1889
constexpr bool boundaryContains(const OtherPoint &point) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:267
constexpr void insert(Range &&range)
Enlarges the rectangle so that it contains every point in a range.
Definition rectangle.hpp:1951
constexpr bool interiorsIntersect(const OtherShape &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition rectangle.hpp:1072
constexpr bool boundaryContains(const OtherSegment &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:281
constexpr Rectangle scaledDownY(const OtherNumber scalar) const
Returns the rectangle with its y-coordinates divided by a divisor.
constexpr PolygonSet< PointType > asPolygonSet() const
Returns the rectangle as a one-component set of regions.
Definition rectangle.hpp:759
constexpr bool crosses(const OtherSegment &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:434
constexpr void scaleDownY(const OtherNumber scalar)
Divides the rectangle's y-coordinates by a divisor in place.
Definition transformations.hpp:1238
constexpr bool separates(const OtherOrientedSegment &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1239
constexpr bool boundaryContains(const OtherDisk &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1056
constexpr auto distanceLInf(const OtherPoint &point) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:461
constexpr bool intersects(const OtherOrientedLine &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:536
constexpr bool boundaryContains(const OtherPolyline &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1306
constexpr auto distanceL1(const OtherOrientedSegment &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:542
std::size_t size_type
Definition rectangle.hpp:103
constexpr bool crosses(const OtherLine &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:414
constexpr auto distanceL1(const OtherOrientedLine &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:506
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 dist...
Definition rectangle.hpp:1752
constexpr bool separates(const OtherPoint &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1201
constexpr void insert(const TShape &shape)
Enlarges the rectangle so that it contains a finite shape.
constexpr std::array< PointType, 4 > vertices() const
Returns the four vertices in counterclockwise order.
Definition bounding.hpp:188
constexpr bool contains(const OtherRectangle &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:800
constexpr auto twiceArea() const
Returns twice the rectangle area.
Definition measures.hpp:291
constexpr bool interiorContains(const OtherSet &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition rectangle.hpp:1246
constexpr bool interiorContains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition rectangle.hpp:862
constexpr Disk< PointType, NoLabel > circumcircle() const
Returns the circumcircle of the rectangle.
Definition measures.hpp:318
constexpr bool boundaryContains(const OtherChain &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1197
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.
Definition intersection.hpp:1047
constexpr bool separates(const OtherRay &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1249
constexpr auto hausdorffDistanceL1(const OtherShape &other) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition rectangle.hpp:1783
constexpr Convex< PointType > asConvex() const
Returns the rectangle as a convex polygon.
Definition rectangle.hpp:690
constexpr auto distanceL1(const OtherShape &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition rectangle.hpp:1594
constexpr bool interiorsIntersect(const OtherHalfplane &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:648
constexpr void scaleDownX(const OtherNumber scalar)
Divides the rectangle's x-coordinates by a divisor in place.
Definition transformations.hpp:1220
constexpr Rectangle(NumberType x1, NumberType y1, NumberType x2, NumberType y2, bool minmax=false)
Creates an axis-aligned rectangle from four coordinates.
Definition rectangle.hpp:183
constexpr bool boundaryContains(const OtherRay &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:321
BoundaryIterator< false > EdgeIterator
Definition rectangle.hpp:110
constexpr bool interiorsIntersect(const OtherOrientedSegment &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:618
constexpr bool contains(const OtherPolygon &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:1767
constexpr std::ptrdiff_t index(const PointType &point) const
Definition rectangle.hpp:330
constexpr bool interiorContains(const OtherPolygon &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1312
constexpr Convex< PointType > convexHull() const
Returns the convex hull of the rectangle's vertices.
Definition rectangle.hpp:699
constexpr void insert(const OtherRectangle &other)
Enlarges the rectangle so that it contains another rectangle.
Definition bounding.hpp:353
constexpr auto hausdorffDistanceL1(const OtherPoint &point) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition distancel1.hpp:1005
constexpr auto squaredDistance(const OtherRay &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:552
constexpr bool crosses(const OtherRay &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:454
constexpr bool boundaryContains(const OtherLine &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:301
constexpr bool contains(const OtherDisk &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:832
constexpr auto distanceL1(const OtherHalfplane &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:573
constexpr CornerIterator begin() const
Returns an iterator to the minimum corner.
Definition rectangle.hpp:423
constexpr Rectangle scaledUpX(const OtherNumber scalar) const
Returns the rectangle with its x-coordinates multiplied by a factor.
PointType PointType
Definition rectangle.hpp:76
constexpr bool intersects(const Shape< PointType > &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:606
constexpr bool separates(const OtherRegion &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:4639
constexpr bool interiorsIntersect(const OtherRectangle &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:560
constexpr bool isUndefined() const
Returns whether the rectangle is degenerate without collapsing to a point or to a segment.
Definition predicates.hpp:903
constexpr bool boundaryContains(const Shape< PointType > &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1134
bool separates(const OtherSet &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:5963
constexpr bool separates(const OtherSegment &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1227
constexpr Rectangle(Range &&points)
Creates the bounding box of a range of points.
Definition rectangle.hpp:216
constexpr Rectangle(const Rectangle< OtherPointType, OtherLabelType > &other)
Definition rectangle.hpp:188
constexpr auto intersection(const Shape< OtherPoint > &other) const
Returns the intersection of the two shapes (A ∩ B), re-dispatching through the wrapper's own intersec...
Definition rectangle.hpp:1614
constexpr void scaleUpX(const OtherNumber scalar)
Multiplies the rectangle's x-coordinates by a factor in place.
Definition transformations.hpp:1184
constexpr auto distanceL1(const OtherPoint &point) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:473
constexpr bool pointInsideInteriorContainedIn(const OtherShape &shape) const
Tests whether some point in this shape's relative interior lies in the strict interior of shape.
Definition measures.hpp:337
constexpr auto minkowskiErosion(const OtherShape &other) const
Returns the Minkowski erosion of this shape by a bounded polygonal one (A ⊖ B).
constexpr bool contains(const OtherOrientedLine &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:750
constexpr const PointType & max() const
Definition rectangle.hpp:359
PolygonSet< Point< ResultNumber, typename PointType::LabelType > > difference(const OtherHalfplane &other) const
Returns the regularized set difference of the two shapes (A ∖ B).
constexpr auto intersection(const OtherShape &other) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition rectangle.hpp:1393
constexpr bool interiorContains(const OtherOrientedLine &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:571
constexpr auto squaredHausdorffDistance(const OtherPoint &point) const
Returns the squared Hausdorff distance to a point.
Definition distance.hpp:608
constexpr EdgeIterator edgesBegin() const
Returns an iterator to the first edge.
Definition rectangle.hpp:455
constexpr auto hausdorffDistanceL1(const OtherRectangle &other) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition distancel1.hpp:994
constexpr auto operator<=>(const Rectangle &other) const
Orders rectangles lexicographically by their (min, max) corners, ignoring the label.
Definition rectangle.hpp:503
std::vector< Point< ResultNumber, typename PointType::LabelType > > latticePoints() const
Returns the integer points the rectangle contains.
Definition lattice.hpp:546
constexpr std::size_t size() const
Returns the number of corners: 4, or 0 when empty.
Definition rectangle.hpp:307
constexpr bool boundaryContains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition rectangle.hpp:857
constexpr bool boundaryContains(const OtherOrientedLine &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:311
constexpr bool interiorContains(const OtherPolyline &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1739
constexpr bool intersects(const OtherOrientedSegment &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:559
constexpr Rectangle()
Creates the empty rectangle [(0,0),(-1,-1)].
Definition rectangle.hpp:120
constexpr auto distanceL1(const OtherSegment &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:515
constexpr bool contains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition rectangle.hpp:852
constexpr bool interiorContains(const OtherConvex &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:643
constexpr OrientedEdgeIterator orientedEdgesBegin() const
Returns an iterator to the first oriented edge.
Definition rectangle.hpp:475
constexpr bool contains(const OtherPoint &point) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:728
constexpr CornerIterator cend() const
Returns an iterator past the last corner.
Definition rectangle.hpp:444
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 haus...
Definition rectangle.hpp:1796
constexpr bool intersects(const OtherRay &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:569
constexpr bool contains(const OtherOrientedSegment &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:770
constexpr void insert(const OtherPoint &point)
Enlarges the rectangle so that it contains the given point.
Definition bounding.hpp:311
constexpr bool contains(const OtherRegion &other) const
Tests whether this shape contains the other shape (A ⊇ B).
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.
Definition intersection.hpp:998
constexpr auto distanceLInf(const OtherLine &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:472
constexpr bool intersects(const EmptyShape< EmptyPoint > &) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition rectangle.hpp:1024
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.
Definition intersection.hpp:1065
constexpr bool crosses(const OtherRectangle &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:384
detail::floating_result_t< ResultNumber > squaredDistance(const Disk< DiskPointType, DiskLabel > &disk) const
Returns the squared Euclidean distance to a disk.
Definition rectangle.hpp:1505
std::ptrdiff_t difference_type
Definition rectangle.hpp:104
constexpr bool contains(const OtherChain &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2060
CornerIterator iterator
Definition rectangle.hpp:107
constexpr auto squaredDistance(const OtherRectangle &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:586
auto difference(const Shape< OtherPoint > &other) const
Returns the regularized set difference of the two shapes (A ∖ B), re-dispatching through the wrapper'...
Definition rectangle.hpp:1656
constexpr auto squaredDistance(const OtherHalfplane &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:574
constexpr auto distanceLInf(const OtherHalfplane &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:561
constexpr auto hausdorffDistanceL1(const OtherOrientedSegment &other) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition distancel1.hpp:1025
constexpr Rectangle bbox() const
Returns the bounding box of the rectangle.
Definition bounding.hpp:140
constexpr bool contains(const OtherSegment &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:760
constexpr auto distanceLInf(const OtherSegment &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:503
constexpr CornerIterator end() const
Returns an iterator past the last corner.
Definition rectangle.hpp:437
constexpr auto width() const
Returns the rectangle width.
Definition rectangle.hpp:368
constexpr auto distanceLInf(const OtherShape &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition rectangle.hpp:1739
constexpr bool interiorsIntersect(const OtherOrientedLine &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:589
constexpr bool separates(const OtherLine &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:1207
constexpr bool boundaryContains(const OtherSet &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition rectangle.hpp:1235
constexpr bool interiorsIntersect(const EmptyShape< EmptyPoint > &) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition rectangle.hpp:1078
constexpr auto squaredDistance(const OtherSegment &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:516
constexpr std::optional< BoundaryType< false > > getIfSegment() const
Returns the segment the rectangle collapses to, if it does.
Definition predicates.hpp:895
constexpr bool interiorContains(const OtherRectangle &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:621
constexpr bool contains(const OtherLine &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:740
constexpr Rectangle scaledUpY(const OtherNumber scalar) const
Returns the rectangle with its y-coordinates multiplied by a factor.
constexpr Segment< PointType > diameter() const
Returns a segment defining a diameter.
Definition measures.hpp:297
constexpr EmptyShape< EmptyPoint > intersection(const EmptyShape< EmptyPoint > &) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition rectangle.hpp:1410
constexpr bool intersects(const OtherShape &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition rectangle.hpp:1018
constexpr bool crosses(const OtherOrientedLine &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:424
constexpr auto squaredHausdorffDistance(const OtherSegment &other) const
Returns the squared Hausdorff distance to a point.
Definition distance.hpp:617
constexpr Polygon< PointType > asPolygon() const
Returns the rectangle as a simple polygon.
Definition rectangle.hpp:737
constexpr bool intersects(const OtherRectangle &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:510
auto symmetricDifference(const OtherShape &other) const
Returns the regularized symmetric difference of the two shapes (A △ B).
Definition rectangle.hpp:2300
TLabel LabelType
Definition rectangle.hpp:78
constexpr bool boundaryContains(const OtherRectangle &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:341
constexpr bool separates(const EmptyShape< EmptyPoint > &) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition rectangle.hpp:867
Unoriented closed segment between two endpoints plus optional segment label.
Definition segment.hpp:58
Runtime variant wrapper over the supported primitive shapes.
Definition shape.hpp:160