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)
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);
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;
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)) {
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:50
const geom::Coordinate & getIntersection(std::size_t intIndex) const
Definition: LineIntersector.h:211
size_t getIntersectionNum() const
Definition: LineIntersector.h:198
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
An interface for classes which support adding nodes to a segment string.
Definition: NodableSegmentString.h:36
Represents a list of contiguous line segments, and supports noding the segments.
Definition: NodedSegmentString.h:59
static SegmentString::NonConstVect * getNodedSubstrings(const SegmentString::NonConstVect &segStrings)
Returns allocated object.
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
NodedSegmentString(geom::CoordinateSequence *newPts, const void *newContext)
Creates a new segment string from a list of vertices.
Definition: NodedSegmentString.h:102
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
void addIntersection(const geom::Coordinate &intPt, std::size_t segmentIndex)
Add an SegmentNode for intersection intIndex.
Definition: NodedSegmentString.h:189
geom::CoordinateSequence * getCoordinates() const override
Return a pointer to the CoordinateSequence associated with this SegmentString.
int getSegmentOctant(std::size_t index) const
Gets the octant of the segment starting at vertex index.
Definition: NodedSegmentString.h:143
static int octant(double dx, double dy)
A list of the SegmentNode present along a NodedSegmentString.
Definition: SegmentNodeList.h:54
void addSplitEdges(std::vector< SegmentString * > &edgeList)
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:45
Indicates one or more illegal arguments.
Definition: IllegalArgumentException.h:33
Basic namespace for all GEOS functionalities.
Definition: geos.h:39