35template <
class Vertex>
39template <
class Po
intType>
48template <
class Number,
class Label>
59template <
class ANumber,
class ALabel,
class BNumber,
class BLabel,
class CNumber,
class CLabel>
66template <
class Po
intType,
class Label = NoLabel>
70template <
class Po
intType,
class Label = NoLabel>
74template <
class Po
intType,
class Label = NoLabel>
78template <
class Po
intType,
class Label = NoLabel>
82template <
class Po
intType,
class Label = NoLabel>
86template <
class Po
intType,
class Label = NoLabel>
90template <
class Po
intType,
class Label = NoLabel>
94template <
class Po
intType,
class Label = NoLabel>
98template <
class Po
intType,
class Label = NoLabel>
102template <
class Po
intType,
class Label = NoLabel>
106template <
class Po
intType,
class Label = NoLabel>
110template <
class Po
intType,
class Label = NoLabel>
114template <
class Po
intType,
class Label = NoLabel>
118template <
class Po
intType,
class Label = NoLabel,
class Storage = std::vector<Po
intType>>
122template <
class Po
intType,
class Label = NoLabel>
126template <
class Po
intType,
class Label>
130template <
class Po
intType>
146template <
class Po
intType = Po
int<Rational<BigInt>, NoLabel>,
class Label = NoLabel>
157template <
class Number>
176inline constexpr int shapeRank = -1;
178template <
class Po
intType>
179inline constexpr int shapeRank<EmptyShape<PointType>> = 0;
180template <
class Number,
class Label>
181inline constexpr int shapeRank<Point<Number, Label>> = 10;
182template <
class Po
intType,
class Label>
183inline constexpr int shapeRank<Segment<PointType, Label>> = 20;
184template <
class Po
intType,
class Label>
185inline constexpr int shapeRank<OrientedSegment<PointType, Label>> = 30;
186template <
class Po
intType,
class Label>
187inline constexpr int shapeRank<Line<PointType, Label>> = 40;
188template <
class Po
intType,
class Label>
189inline constexpr int shapeRank<OrientedLine<PointType, Label>> = 50;
190template <
class Po
intType,
class Label>
191inline constexpr int shapeRank<Ray<PointType, Label>> = 60;
192template <
class Po
intType,
class Label>
193inline constexpr int shapeRank<Halfplane<PointType, Label>> = 70;
194template <
class Po
intType,
class Label>
195inline constexpr int shapeRank<Rectangle<PointType, Label>> = 80;
196template <
class Po
intType,
class Label>
197inline constexpr int shapeRank<Triangle<PointType, Label>> = 90;
198template <
class Po
intType,
class Label>
199inline constexpr int shapeRank<Disk<PointType, Label>> = 100;
200template <
class Po
intType,
class Label>
201inline constexpr int shapeRank<Convex<PointType, Label>> = 110;
202template <
class Po
intType,
class Label,
class Storage>
203inline constexpr int shapeRank<MonotoneChain<PointType, Label, Storage>> = 115;
204template <
class Po
intType,
class Label>
205inline constexpr int shapeRank<Polyline<PointType, Label>> = 117;
206template <
class Po
intType,
class Label>
207inline constexpr int shapeRank<Polygon<PointType, Label>> = 120;
208template <
class Po
intType,
class Label>
209inline constexpr int shapeRank<HalfplaneIntersection<PointType, Label>> = 130;
210template <
class Po
intType,
class Label>
211inline constexpr int shapeRank<PolygonWithHoles<PointType, Label>> = 140;
212template <
class Po
intType,
class Label>
213inline constexpr int shapeRank<PolygonSet<PointType, Label>> = 150;
220template <
class T>
struct is_empty_shape : std::false_type {};
221template <
class Po
intType>
struct is_empty_shape<EmptyShape<PointType>> : std::true_type {};
222template <
class T>
inline constexpr bool is_empty_shape_v = is_empty_shape<std::remove_cvref_t<T>>::value;
224template <
class T>
struct is_point : std::false_type {};
225template <
class Number,
class Label>
struct is_point<
Point<Number, Label>> : std::true_type {};
226template <
class T>
inline constexpr bool is_point_v = is_point<std::remove_cvref_t<T>>::value;
228template <
class T>
struct is_segment : std::false_type {};
229template <
class Po
intType,
class Label>
struct is_segment<
Segment<PointType, Label>> : std::true_type {};
230template <
class T>
inline constexpr bool is_segment_v = is_segment<std::remove_cvref_t<T>>::value;
232template <
class T>
struct is_oriented_segment : std::false_type {};
233template <
class Po
intType,
class Label>
struct is_oriented_segment<
OrientedSegment<PointType, Label>> : std::true_type {};
234template <
class T>
inline constexpr bool is_oriented_segment_v = is_oriented_segment<std::remove_cvref_t<T>>::value;
236template <
class T>
struct is_line : std::false_type {};
237template <
class Po
intType,
class Label>
struct is_line<
Line<PointType, Label>> : std::true_type {};
238template <
class T>
inline constexpr bool is_line_v = is_line<std::remove_cvref_t<T>>::value;
240template <
class T>
struct is_oriented_line : std::false_type {};
241template <
class Po
intType,
class Label>
struct is_oriented_line<
OrientedLine<PointType, Label>> : std::true_type {};
242template <
class T>
inline constexpr bool is_oriented_line_v = is_oriented_line<std::remove_cvref_t<T>>::value;
244template <
class T>
struct is_ray : std::false_type {};
245template <
class Po
intType,
class Label>
struct is_ray<
Ray<PointType, Label>> : std::true_type {};
246template <
class T>
inline constexpr bool is_ray_v = is_ray<std::remove_cvref_t<T>>::value;
248template <
class T>
struct is_halfplane : std::false_type {};
249template <
class Po
intType,
class Label>
struct is_halfplane<
Halfplane<PointType, Label>> : std::true_type {};
250template <
class T>
inline constexpr bool is_halfplane_v = is_halfplane<std::remove_cvref_t<T>>::value;
252template <
class T>
struct is_rectangle : std::false_type {};
253template <
class Po
intType,
class Label>
struct is_rectangle<
Rectangle<PointType, Label>> : std::true_type {};
254template <
class T>
inline constexpr bool is_rectangle_v = is_rectangle<std::remove_cvref_t<T>>::value;
256template <
class T>
struct is_triangle : std::false_type {};
257template <
class Po
intType,
class Label>
struct is_triangle<
Triangle<PointType, Label>> : std::true_type {};
258template <
class T>
inline constexpr bool is_triangle_v = is_triangle<std::remove_cvref_t<T>>::value;
260template <
class T>
struct is_convex : std::false_type {};
261template <
class Po
intType,
class Label>
struct is_convex<
Convex<PointType, Label>> : std::true_type {};
262template <
class T>
inline constexpr bool is_convex_v = is_convex<std::remove_cvref_t<T>>::value;
264template <
class T>
struct is_polygon : std::false_type {};
265template <
class Po
intType,
class Label>
struct is_polygon<
Polygon<PointType, Label>> : std::true_type {};
266template <
class T>
inline constexpr bool is_polygon_v = is_polygon<std::remove_cvref_t<T>>::value;
268template <
class T>
struct is_polygon_with_holes : std::false_type {};
269template <
class Po
intType,
class Label>
struct is_polygon_with_holes<
PolygonWithHoles<PointType, Label>> : std::true_type {};
270template <
class T>
inline constexpr bool is_polygon_with_holes_v = is_polygon_with_holes<std::remove_cvref_t<T>>::value;
272template <
class T>
struct is_polygon_set : std::false_type {};
273template <
class Po
intType,
class Label>
struct is_polygon_set<
PolygonSet<PointType, Label>> : std::true_type {};
274template <
class T>
inline constexpr bool is_polygon_set_v = is_polygon_set<std::remove_cvref_t<T>>::value;
276template <
class T>
struct is_halfplane_intersection : std::false_type {};
277template <
class Po
intType,
class Label>
struct is_halfplane_intersection<
HalfplaneIntersection<PointType, Label>> : std::true_type {};
278template <
class T>
inline constexpr bool is_halfplane_intersection_v = is_halfplane_intersection<std::remove_cvref_t<T>>::value;
280template <
class T>
struct is_monotone_chain : std::false_type {};
281template <
class Po
intType,
class Label,
class Storage>
struct is_monotone_chain<
MonotoneChain<PointType, Label, Storage>> : std::true_type {};
282template <
class T>
inline constexpr bool is_monotone_chain_v = is_monotone_chain<std::remove_cvref_t<T>>::value;
284template <
class T>
struct is_polyline : std::false_type {};
285template <
class Po
intType,
class Label>
struct is_polyline<
Polyline<PointType, Label>> : std::true_type {};
286template <
class T>
inline constexpr bool is_polyline_v = is_polyline<std::remove_cvref_t<T>>::value;
288template <
class T>
struct is_disk : std::false_type {};
289template <
class Po
intType,
class Label>
struct is_disk<
Disk<PointType, Label>> : std::true_type {};
290template <
class T>
inline constexpr bool is_disk_v = is_disk<std::remove_cvref_t<T>>::value;
292template <
class T>
struct is_shape : std::false_type {};
293template <
class Po
intType>
struct is_shape<
Shape<PointType>> : std::true_type {};
294template <
class T>
inline constexpr bool is_shape_v = is_shape<std::remove_cvref_t<T>>::value;
296template <
class T>
struct is_transformation : std::false_type {};
297template <
class Number>
struct is_transformation<Transformation<Number>> : std::true_type {};
298template <
class T>
inline constexpr bool is_transformation_v = is_transformation<std::remove_cvref_t<T>>::value;
416template <
class Self,
class Other>
417concept ClosestPairConcept =
419 requires(
const Self& self,
const Other& other) { self.squaredDistance(other); };
431template <
class Self,
class Other>
432concept ClosestPointsPairConcept =
435 requires(
const Self& self,
const Other& other) { self.squaredDistance(other); };
475template <
class A,
class B>
520template <
class Other,
class Predicate>
521constexpr bool reduceDegenerate(
const Other& other, Predicate predicate) {
522 if constexpr (
requires { other.getIfPoint(); }) {
523 if (
const auto vertex = other.getIfPoint()) {
524 return predicate(*
vertex);
527 if constexpr (
requires { other.getIfSegment(); }) {
528 if (
const auto carrier = other.getIfSegment()) {
529 return predicate(*carrier);
554template <
class Other,
class Predicate>
555constexpr bool reduceDegenerateGuarded(
const Other& other, Predicate predicate) {
556 return other.isDegenerate() && reduceDegenerate(other, predicate);
576template <
class TShape>
577constexpr bool coversNoPoint(
const TShape& shape) {
578 if constexpr (
requires { shape.empty(); }) {
579 return shape.empty();
580 }
else if constexpr (
requires { shape.size(); }) {
581 return shape.size() == 0;
606template <
class Other,
class Predicate>
607constexpr bool reduceDegenerateToPoint(
const Other& other, Predicate predicate) {
608 if constexpr (
requires { other.getIfPoint(); }) {
609 if (
const auto vertex = other.getIfPoint()) {
610 return predicate(*
vertex);
The planar subdivision induced by a set of one-dimensional shapes.
Definition arrangement.hpp:171
Arbitrary precision signed integer.
Definition bigint.hpp:157
Stores drawable objects and exports them as an SVG image.
Definition canvas.hpp:128
Undirected simple graph stored as adjacency sets.
Definition graph.hpp:38
Exact rational number class template.
Definition rational.hpp:106
Any concrete geometry type or the runtime Shape wrapper.
Definition forward.hpp:328
Bounded convex primitives.
Definition forward.hpp:339
Bounded polygonal primitives, convex or not.
Definition forward.hpp:373
Definition forward.hpp:315
Definition forward.hpp:322
Definition forward.hpp:305
Definition forward.hpp:312
Definition forward.hpp:319
Definition forward.hpp:309
Shape pairs whose Minkowski sum Pangolin can represent.
Definition forward.hpp:476
Definition forward.hpp:320
Definition forward.hpp:310
Definition forward.hpp:308
Definition forward.hpp:306
Definition forward.hpp:316
Definition forward.hpp:318
Definition forward.hpp:317
Bounded polygonal regions: exactly the shapes a PolygonSet can always represent.
Definition forward.hpp:403
Definition forward.hpp:321
Definition forward.hpp:311
Definition forward.hpp:313
Definition forward.hpp:307
Definition forward.hpp:323
Definition forward.hpp:314
Unbounded convex polyhedral primitives.
Definition forward.hpp:358
Definition arrangement.hpp:67
HalfplaneIntersection() -> HalfplaneIntersection< Point<>, NoLabel >
Definition halfplaneintersection.hpp:2308
Rectangle() -> Rectangle< Point<>, NoLabel >
Definition rectangle.hpp:2384
@ vertex
Definition bitmatrix.hpp:37
Line() -> Line< Point<>, NoLabel >
PolygonSet() -> PolygonSet< Point<>, NoLabel >
Definition polygonset.hpp:1699
OrientedSegment() -> OrientedSegment< Point<>, NoLabel >
MonotoneChain() -> MonotoneChain< Point<>, NoLabel >
Definition monotonechain.hpp:2439
constexpr bool collinear(const Point< ANumber, ALabel > &a, const Point< BNumber, BLabel > &b, const Point< CNumber, CLabel > &c)
Tests whether three points are collinear.
Definition orientation.hpp:651
Shape(const std::variant< T, Ts... > &) -> Shape< detail::shape_point_type_t< T > >
PolygonWithHoles() -> PolygonWithHoles< Point<>, NoLabel >
Definition polygonwithholes.hpp:3093
Convex() -> Convex< Point<>, NoLabel >
Definition convex.hpp:3311
Segment() -> Segment< Point<>, NoLabel >
Halfplane() -> Halfplane< Point<>, NoLabel >
Polyline() -> Polyline< Point<>, NoLabel >
Definition polyline.hpp:2369
Ray() -> Ray< Point<>, NoLabel >
Polygon() -> Polygon< Point<>, NoLabel >
Definition polygon.hpp:3200
Disk() -> Disk< Point<>, NoLabel >
Deduces a default disk with Point<> boundary points and no label.
Definition disk.hpp:1691
OrientedLine() -> OrientedLine< Point<>, NoLabel >
Triangle() -> Triangle< Point<>, NoLabel >
Definition triangle.hpp:2029
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
Closed half-plane defined by an oriented boundary line.
Definition halfplane.hpp:51
Unoriented infinite line.
Definition line.hpp:52
Weakly x-monotone polyline stored by lexicographically sorted vertices.
Definition monotonechain.hpp:146
Sentinel type used when a point carries no extra label.
Definition point.hpp:31
Directed infinite line with left/right side semantics plus optional line label.
Definition orientedline.hpp:53
Directed segment preserving source-to-target order plus optional segment label.
Definition orientedsegment.hpp:44
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
Open polygonal chain stored in traversal order; may self-intersect.
Definition polyline.hpp:69
Half-infinite line starting from one source point plus optional ray label.
Definition ray.hpp:51
Axis-aligned rectangle stored by minimum and maximum corners.
Definition rectangle.hpp:75
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
Closed triangle stored by three vertices.
Definition triangle.hpp:53