GEOS 3.13.1
AdjacentEdgeLocator.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (c) 2024 Martin Davis
7 * Copyright (C) 2024 Paul Ramsey <pramsey@cleverelephant.ca>
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#pragma once
17
18#include <geos/geom/CoordinateSequence.h>
19#include <geos/geom/Location.h>
20#include <geos/export.h>
21
22
23// Forward declarations
24namespace geos {
25namespace operation {
26namespace relateng {
27 class NodeSections;
28 class NodeSection;
29}
30}
31namespace geom {
32 class CoordinateXY;
33 class Geometry;
34 class LinearRing;
35 class Polygon;
36}
37}
38
39
40using geos::geom::CoordinateXY;
46
47
48
49namespace geos { // geos.
50namespace operation { // geos.operation
51namespace relateng { // geos.operation.relateng
52
67class GEOS_DLL AdjacentEdgeLocator {
68
69public:
70
71 AdjacentEdgeLocator(const Geometry* geom)
72 {
73 init(geom);
74 }
75
76 Location locate(const CoordinateXY* p);
77
83 AdjacentEdgeLocator& operator=(const AdjacentEdgeLocator&) = delete;
84
85
86private:
87
88 // Members
89
90 std::vector<const CoordinateSequence*> ringList;
91
92 /*
93 * When we have to reorient rings, we end up allocating new
94 * rings, since we cannot reorient the rings of the input
95 * geometry, so this is where we store those "local" rings.
96 */
97 std::vector<std::unique_ptr<CoordinateSequence>> localRingList;
98
99
100 // Methods
101
102 void addSections(
103 const CoordinateXY* p,
104 const CoordinateSequence* ring,
105 NodeSections& sections);
106
107 NodeSection* createSection(
108 const CoordinateXY* p,
109 const CoordinateXY* prev,
110 const CoordinateXY* next);
111
112 void init(const Geometry* geom);
113
114 void addRings(const Geometry* geom);
115
116 void addRing(const LinearRing* ring, bool requireCW);
117
118
119};
120
121} // namespace geos.operation.relateng
122} // namespace geos.operation
123} // namespace geos
124
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
Definition AdjacentEdgeLocator.h:67
AdjacentEdgeLocator(const AdjacentEdgeLocator &)=delete
Definition NodeSection.h:55
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
Basic namespace for all GEOS functionalities.
Definition geos.h:39