19 #ifndef GEOS_NODING_SEGMENTNODELIST_H
20 #define GEOS_NODING_SEGMENTNODELIST_H
22 #include <geos/export.h>
24 #include <geos/inline.h>
31 #include <geos/noding/SegmentNode.h>
35 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
41 class CoordinateSequence;
45 class NodedSegmentString;
56 class GEOS_DLL SegmentNodeList {
58 std::set<SegmentNode*, SegmentNodeLT> nodeMap;
61 const NodedSegmentString& edge;
69 void checkSplitEdgesCorrectness(std::vector<SegmentString*>& splitEdges);
79 SegmentString* createSplitEdge(SegmentNode* ei0, SegmentNode* ei1);
89 void addCollapsedNodes();
95 void findCollapsesFromExistingVertices(
96 std::vector<std::size_t>& collapsedVertexIndexes);
105 void findCollapsesFromInsertedNodes(
106 std::vector<std::size_t>& collapsedVertexIndexes);
108 bool findCollapseIndex(SegmentNode& ei0, SegmentNode& ei1,
109 size_t& collapsedVertexIndex);
112 SegmentNodeList(
const SegmentNodeList& other) =
delete;
113 SegmentNodeList& operator=(
const SegmentNodeList& rhs) =
delete;
117 friend std::ostream& operator<< (std::ostream& os,
const SegmentNodeList& l);
119 typedef std::set<SegmentNode*, SegmentNodeLT> container;
120 typedef container::iterator iterator;
121 typedef container::const_iterator const_iterator;
123 SegmentNodeList(
const NodedSegmentString* newEdge): edge(*newEdge) {}
125 SegmentNodeList(
const NodedSegmentString& newEdge): edge(newEdge) {}
127 const NodedSegmentString&
135 virtual ~SegmentNodeList();
147 SegmentNode* add(
const geom::Coordinate& intPt, std::size_t segmentIndex);
150 add(
const geom::Coordinate* intPt, std::size_t segmentIndex)
152 return add(*intPt, segmentIndex);
160 std::set<SegmentNode*, SegmentNodeLT>*
170 return nodeMap.size();
176 return nodeMap.begin();
178 container::const_iterator
181 return nodeMap.begin();
186 return nodeMap.end();
188 container::const_iterator
191 return nodeMap.end();
205 void addSplitEdges(std::vector<SegmentString*>& edgeList);
208 addSplitEdges(std::vector<SegmentString*>* edgeList)
211 addSplitEdges(*edgeList);
217 std::ostream& operator<< (std::ostream& os,
const SegmentNodeList& l);