5namespace fishnet::geometry::__impl{
9 using numeric_type = T;
10 constexpr static GeometryType type = GeometryType::POLYGON;
11 PolygonStub(RingStub<T> boundary, std::vector<RingStub<T>> holes){}
12 bool operator==(
const PolygonStub<T> & other)
const noexcept{
15 RingStub<T> getBoundary()
const{
16 return RingStub<T>({}, {});
18 std::vector<RingStub<T>> getHoles()
const{
21 bool isSimple()
const{
27 PointStub<double> centroid()
const{
28 return PointStub<double>(0,0);
30 EnvelopeStub<T> aaBB()
const{
31 return EnvelopeStub<T>(0,0,0,0);
33 bool isInside(PointStub<T> point)
const{
36 bool isOnBoundary(PointStub<T> point)
const{
39 bool isOutside(PointStub<T> point)
const{
42 bool containsInHole(PointStub<T> point)
const{
45 bool containsInHole(PolygonStub<T> polygon)
const{
48 bool contains(PointStub<T> point)
const{
51 bool contains(SegmentStub<T> segment)
const{
54 bool contains(RingStub<T> ring)
const{
57 bool contains(PolygonStub<T> polygon)
const{
60 bool intersects(SegmentStub<T> segment)
const{
63 bool intersects(LineStub<T> line)
const{
66 std::vector<PointStub<double>> intersections(SegmentStub<T> segment)
const{
69 std::vector<PointStub<double>> intersections(LineStub<T> line)
const{
72 bool crosses(PolygonStub<T> polygon)
const{
75 bool touches(PolygonStub<T> polygon)
const{
78 double distance(PolygonStub<T> polygon)
const{
81 size_t hash() const noexcept {
84 std::string toString()
const{
99 const std::remove_cvref_t<P> & polygon,
100 const __impl::PolygonStub<typename std::remove_cvref_t<P>::numeric_type> & otherPolygon,
101 const __impl::RingStub<typename std::remove_cvref_t<P>::numeric_type> & ring,
102 const __impl::PointStub<typename std::remove_cvref_t<P>::numeric_type> & point,
103 const __impl::SegmentStub<typename std::remove_cvref_t<P>::numeric_type> & segment,
104 const __impl::LineStub<typename std::remove_cvref_t<P>::numeric_type> & line
106 {polygon.getBoundary()} ->
IRing;
108 {polygon.isSimple()} -> std::same_as<bool>;
109 {polygon.area()} -> std::convertible_to<double>;
110 {polygon.centroid()} ->
IPoint;
112 {polygon.isInside(point)} -> std::same_as<bool>;
113 {polygon.isOnBoundary(point)} -> std::same_as<bool>;
114 {polygon.isOutside(point)} -> std::same_as<bool>;
115 {polygon.containsInHole(point)} -> std::same_as<bool>;
116 {polygon.containsInHole(otherPolygon)} -> std::same_as<bool>;
117 {polygon.contains(point)} -> std::same_as<bool>;
118 {polygon.contains(segment)} -> std::same_as<bool>;
119 {polygon.contains(ring)} -> std::same_as<bool>;
120 {polygon.contains(otherPolygon)} -> std::same_as<bool>;
121 {polygon.intersects(segment)} -> std::same_as<bool>;
122 {polygon.intersects(line)} -> std::same_as<bool>;
123 {polygon.intersections(segment)} ->
PointRange;
125 {polygon.crosses(otherPolygon)} -> std::same_as<bool>;
126 {polygon.touches(otherPolygon)} -> std::same_as<bool>;
127 {polygon.distance(otherPolygon)} -> std::convertible_to<double>;
IPolygon implementation backed by an OGRPolygon.
Definition OGRPolygonAdapter.hpp:22
Definition GeometryBase.hpp:11
Interface for a point.
Definition IPoint.hpp:92
Interface for a polygon A polygon is a two-dimensional shape defined by a boundary and zero or more h...
Definition IPolygon.hpp:98
Interface for a ring A ring is a closed loop of segments, forming a boundary of a shape.
Definition IRing.hpp:143
Definition IPoint.hpp:138
Definition IPolygon.hpp:134
Definition BoundingBoxWrapper.hpp:5