25 #include <geos/export.h> 26 #include <geos/algorithm/LineIntersector.h> 27 #include <geos/geom/Coordinate.h> 28 #include <geos/geom/CoordinateSequence.h> 29 #include <geos/noding/NodedSegmentString.h> 30 #include <geos/noding/NodableSegmentString.h> 31 #include <geos/noding/Octant.h> 32 #include <geos/noding/SegmentNode.h> 33 #include <geos/noding/SegmentNodeList.h> 34 #include <geos/noding/SegmentString.h> 35 #include <geos/util/IllegalArgumentException.h> 41 #pragma warning(disable: 4251 4355) // warning C4355: 'this' : used in base member initializer list 65 getNodedSubstrings(II from, II too_far,
66 SegmentString::NonConstVect* resultEdgelist)
68 for(II i = from; i != too_far; ++i) {
77 getNodedSubstrings(C* segStrings,
78 SegmentString::NonConstVect* resultEdgelist)
80 getNodedSubstrings(segStrings->begin(), segStrings->end(), resultEdgelist);
83 static void getNodedSubstrings(
const SegmentString::NonConstVect& segStrings,
84 SegmentString::NonConstVect* resultEdgeList);
87 static SegmentString::NonConstVect* getNodedSubstrings(
88 const SegmentString::NonConstVect& segStrings);
90 std::vector<geom::Coordinate> getNodedCoordinates();
111 , pts(ss->getCoordinates()->clone())
114 ~NodedSegmentString()
override =
default;
116 SegmentNodeList& getNodeList();
118 const SegmentNodeList& getNodeList()
const;
121 size()
const override 126 const geom::Coordinate& getCoordinate(std::size_t i)
const override;
128 geom::CoordinateSequence* getCoordinates()
const override;
129 geom::CoordinateSequence* releaseCoordinates();
131 bool isClosed()
const override;
133 std::ostream& print(std::ostream& os)
const override;
145 if (index >= size() - 1) {
148 return safeOctant(getCoordinate(index), getCoordinate(index + 1));
158 std::size_t segmentIndex, std::size_t geomIndex)
161 addIntersection(li, segmentIndex, geomIndex, i);
173 std::size_t segmentIndex,
174 std::size_t geomIndex, std::size_t intIndex)
176 ::geos::ignore_unused_variable_warning(geomIndex);
179 addIntersection(intPt, segmentIndex);
190 std::size_t segmentIndex)
192 std::size_t normalizedSegmentIndex = segmentIndex;
194 if (segmentIndex > size() - 2) {
199 auto nextSegIndex = normalizedSegmentIndex + 1;
200 if (nextSegIndex < size()) {
206 if(intPt.equals2D(nextPt)) {
207 normalizedSegmentIndex = nextSegIndex;
215 nodeList.add(intPt, normalizedSegmentIndex);
222 std::unique_ptr<geom::CoordinateSequence> pts;
226 if(p0.equals2D(p1)) {
int getSegmentOctant(std::size_t index) const
Gets the octant of the segment starting at vertex index.
Definition: NodedSegmentString.h:143
An interface for classes which support adding nodes to a segment string.
Definition: NodableSegmentString.h:36
size_t getIntersectionNum() const
Definition: LineIntersector.h:198
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:45
Represents a list of contiguous line segments, and supports noding the segments.
Definition: NodedSegmentString.h:59
const geom::Coordinate & getIntersection(std::size_t intIndex) const
Definition: LineIntersector.h:211
Indicates one or more illegal arguments.
Definition: IllegalArgumentException.h:33
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:50
void addSplitEdges(std::vector< SegmentString *> &edgeList)
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25
A list of the SegmentNode present along a NodedSegmentString.
Definition: SegmentNodeList.h:54
void addIntersection(const geom::Coordinate &intPt, std::size_t segmentIndex)
Add an SegmentNode for intersection intIndex.
Definition: NodedSegmentString.h:189
NodedSegmentString(geom::CoordinateSequence *newPts, const void *newContext)
Creates a new segment string from a list of vertices.
Definition: NodedSegmentString.h:102
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
void addIntersection(algorithm::LineIntersector *li, std::size_t segmentIndex, std::size_t geomIndex, std::size_t intIndex)
Add an SegmentNode for intersection intIndex.
Definition: NodedSegmentString.h:172
void addIntersections(algorithm::LineIntersector *li, std::size_t segmentIndex, std::size_t geomIndex)
Add SegmentNodes for one or both intersections found for a segment of an edge to the edge intersectio...
Definition: NodedSegmentString.h:157
static int octant(double dx, double dy)