23 #ifndef GEOS_NODING_NODEDSEGMENTSTRING_H
24 #define GEOS_NODING_NODEDSEGMENTSTRING_H
26 #include <geos/export.h>
27 #include <geos/noding/NodableSegmentString.h>
28 #include <geos/geom/CoordinateSequence.h>
29 #include <geos/algorithm/LineIntersector.h>
30 #include <geos/noding/SegmentNode.h>
31 #include <geos/noding/SegmentNodeList.h>
32 #include <geos/noding/SegmentString.h>
33 #include <geos/geom/Coordinate.h>
39 #pragma warning(disable: 4251 4355)
63 getNodedSubstrings(II from, II too_far,
64 SegmentString::NonConstVect* resultEdgelist)
66 for(II i = from; i != too_far; ++i) {
75 getNodedSubstrings(C* segStrings,
76 SegmentString::NonConstVect* resultEdgelist)
78 getNodedSubstrings(segStrings->begin(), segStrings->end(), resultEdgelist);
81 static void getNodedSubstrings(
const SegmentString::NonConstVect& segStrings,
82 SegmentString::NonConstVect* resultEdgeList);
86 const SegmentString::NonConstVect& segStrings);
88 std::unique_ptr<std::vector<geom::Coordinate>> getNodedCoordinates();
109 , pts(ss->getCoordinates()->clone())
112 ~NodedSegmentString()
override =
default;
127 std::size_t normalizedSegmentIndex = segmentIndex;
130 std::size_t nextSegIndex = normalizedSegmentIndex + 1;
131 if(nextSegIndex < size()) {
133 getCoordinate(nextSegIndex);
137 if(intPt->equals2D(nextPt)) {
138 normalizedSegmentIndex = nextSegIndex;
143 SegmentNode* ei = getNodeList().add(*intPt, normalizedSegmentIndex);
152 size()
const override
162 bool isClosed()
const override;
164 std::ostream& print(std::ostream& os)
const override;
182 size_t segmentIndex,
size_t geomIndex);
193 size_t geomIndex,
size_t intIndex);
203 size_t segmentIndex);
210 std::unique_ptr<geom::CoordinateSequence> pts;
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
An interface for classes which support adding nodes to a segment string.
Definition: NodableSegmentString.h:37
Represents a list of contiguous line segments, and supports noding the segments.
Definition: NodedSegmentString.h:57
void addIntersections(algorithm::LineIntersector *li, size_t segmentIndex, size_t geomIndex)
Add SegmentNodes for one or both intersections found for a segment of an edge to the edge intersectio...
void addIntersection(algorithm::LineIntersector *li, size_t segmentIndex, size_t geomIndex, size_t intIndex)
Add an SegmentNode for intersection intIndex.
static SegmentString::NonConstVect * getNodedSubstrings(const SegmentString::NonConstVect &segStrings)
Returns allocated object.
SegmentNode * addIntersectionNode(geom::Coordinate *intPt, std::size_t segmentIndex)
Adds an intersection node for a given point and segment to this segment string.
Definition: NodedSegmentString.h:125
int getSegmentOctant(size_t index) const
Gets the octant of the segment starting at vertex index.
NodedSegmentString(geom::CoordinateSequence *newPts, const void *newContext)
Creates a new segment string from a list of vertices.
Definition: NodedSegmentString.h:100
void addIntersection(const geom::Coordinate &intPt, size_t segmentIndex)
Add an SegmentNode for intersection intIndex.
geom::CoordinateSequence * getCoordinates() const override
Return a pointer to the CoordinateSequence associated with this SegmentString.
A list of the SegmentNode present along a NodedSegmentString.
Definition: SegmentNodeList.h:56
void addSplitEdges(std::vector< SegmentString * > &edgeList)
Represents an intersection point between two NodedSegmentString.
Definition: SegmentNode.h:47
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26