GEOS  3.9.1dev
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
geos::noding::SegmentNodeList Class Reference

A list of the SegmentNode present along a NodedSegmentString. More...

#include <SegmentNodeList.h>

Collaboration diagram for geos::noding::SegmentNodeList:
[legend]

Public Types

typedef std::set< SegmentNode *, SegmentNodeLTcontainer
 
typedef container::iterator iterator
 
typedef container::const_iterator const_iterator
 

Public Member Functions

 SegmentNodeList (const NodedSegmentString *newEdge)
 
 SegmentNodeList (const NodedSegmentString &newEdge)
 
 ~SegmentNodeList ()
 
const NodedSegmentStringgetEdge () const
 
SegmentNodeadd (const geom::Coordinate &intPt, std::size_t segmentIndex)
 
SegmentNodeadd (const geom::Coordinate *intPt, std::size_t segmentIndex)
 
std::set< SegmentNode *, SegmentNodeLT > * getNodes ()
 
size_t size () const
 Return the number of nodes in this list. More...
 
container::iterator begin ()
 
container::const_iterator begin () const
 
container::iterator end ()
 
container::const_iterator end () const
 
void addEndpoints ()
 
void addSplitEdges (std::vector< SegmentString * > &edgeList)
 
void addSplitEdges (std::vector< SegmentString * > *edgeList)
 
std::unique_ptr< std::vector< geom::Coordinate > > getSplitCoordinates ()
 

Private Member Functions

void checkSplitEdgesCorrectness (const std::vector< SegmentString * > &splitEdges) const
 
std::unique_ptr< SegmentStringcreateSplitEdge (const SegmentNode *ei0, const SegmentNode *ei1) const
 
void createSplitEdgePts (const SegmentNode *ei0, const SegmentNode *ei1, std::vector< geom::Coordinate > &pts) const
 
void addCollapsedNodes ()
 
void findCollapsesFromExistingVertices (std::vector< std::size_t > &collapsedVertexIndexes) const
 
void findCollapsesFromInsertedNodes (std::vector< std::size_t > &collapsedVertexIndexes) const
 
bool findCollapseIndex (const SegmentNode &ei0, const SegmentNode &ei1, size_t &collapsedVertexIndex) const
 
void addEdgeCoordinates (const SegmentNode *ei0, const SegmentNode *ei1, std::vector< geom::Coordinate > &coordList) const
 
 SegmentNodeList (const SegmentNodeList &other)=delete
 
SegmentNodeListoperator= (const SegmentNodeList &rhs)=delete
 

Private Attributes

std::set< SegmentNode *, SegmentNodeLTnodeMap
 
std::deque< SegmentNodenodeQue
 
const NodedSegmentStringedge
 

Friends

std::ostream & operator<< (std::ostream &os, const SegmentNodeList &l)
 

Detailed Description

A list of the SegmentNode present along a NodedSegmentString.

Definition at line 56 of file SegmentNodeList.h.

Member Typedef Documentation

typedef container::const_iterator geos::noding::SegmentNodeList::const_iterator

Definition at line 136 of file SegmentNodeList.h.

Definition at line 134 of file SegmentNodeList.h.

typedef container::iterator geos::noding::SegmentNodeList::iterator

Definition at line 135 of file SegmentNodeList.h.

Constructor & Destructor Documentation

geos::noding::SegmentNodeList::SegmentNodeList ( const SegmentNodeList other)
privatedelete
geos::noding::SegmentNodeList::SegmentNodeList ( const NodedSegmentString newEdge)
inline

Definition at line 138 of file SegmentNodeList.h.

geos::noding::SegmentNodeList::SegmentNodeList ( const NodedSegmentString newEdge)
inline

Definition at line 140 of file SegmentNodeList.h.

geos::noding::SegmentNodeList::~SegmentNodeList ( )

Member Function Documentation

SegmentNode* geos::noding::SegmentNodeList::add ( const geom::Coordinate intPt,
std::size_t  segmentIndex 
)

Adds an intersection into the list, if it isn't already there. The input segmentIndex is expected to be normalized.

Returns
the SegmentIntersection found or added. It will be destroyed at SegmentNodeList destruction time.
Parameters
intPtthe intersection Coordinate, will be copied
segmentIndex
SegmentNode* geos::noding::SegmentNodeList::add ( const geom::Coordinate intPt,
std::size_t  segmentIndex 
)
inline

Definition at line 163 of file SegmentNodeList.h.

void geos::noding::SegmentNodeList::addCollapsedNodes ( )
private

Adds nodes for any collapsed edge pairs. Collapsed edge pairs can be caused by inserted nodes, or they can be pre-existing in the edge vertex list. In order to provide the correct fully noded semantics, the vertex at the base of a collapsed pair must also be added as a node.

void geos::noding::SegmentNodeList::addEdgeCoordinates ( const SegmentNode ei0,
const SegmentNode ei1,
std::vector< geom::Coordinate > &  coordList 
) const
private
void geos::noding::SegmentNodeList::addEndpoints ( )

Adds entries for the first and last points of the edge to the list

void geos::noding::SegmentNodeList::addSplitEdges ( std::vector< SegmentString * > &  edgeList)

Creates new edges for all the edges that the intersections in this list split the parent edge into. Adds the edges to the input list (this is so a single list can be used to accumulate all split edges for a Geometry).

Referenced by geos::noding::NodedSegmentString::getNodedSubstrings().

Here is the caller graph for this function:

void geos::noding::SegmentNodeList::addSplitEdges ( std::vector< SegmentString * > *  edgeList)
inline

Definition at line 221 of file SegmentNodeList.h.

References geos::geom::operator<<().

Here is the call graph for this function:

container::iterator geos::noding::SegmentNodeList::begin ( )
inline

Definition at line 187 of file SegmentNodeList.h.

container::const_iterator geos::noding::SegmentNodeList::begin ( ) const
inline

Definition at line 192 of file SegmentNodeList.h.

void geos::noding::SegmentNodeList::checkSplitEdgesCorrectness ( const std::vector< SegmentString * > &  splitEdges) const
private

Checks the correctness of the set of split edges corresponding to this edge

Parameters
splitEdgesthe split edges for this edge (in order)
std::unique_ptr<SegmentString> geos::noding::SegmentNodeList::createSplitEdge ( const SegmentNode ei0,
const SegmentNode ei1 
) const
private

Create a new "split edge" with the section of points between (and including) the two intersections. The label for the new edge is the same as the label for the parent edge.

ownership of return value is transferred

void geos::noding::SegmentNodeList::createSplitEdgePts ( const SegmentNode ei0,
const SegmentNode ei1,
std::vector< geom::Coordinate > &  pts 
) const
private

Extracts the points for a split edge running between two nodes. The extracted points should contain no duplicate points. There should always be at least two points extracted (which will be the given nodes).

Parameters
ei0the start node of the split edge
ei1the end node of the split edge
Returns
the points for the split edge
container::iterator geos::noding::SegmentNodeList::end ( )
inline

Definition at line 197 of file SegmentNodeList.h.

container::const_iterator geos::noding::SegmentNodeList::end ( ) const
inline

Definition at line 202 of file SegmentNodeList.h.

bool geos::noding::SegmentNodeList::findCollapseIndex ( const SegmentNode ei0,
const SegmentNode ei1,
size_t &  collapsedVertexIndex 
) const
private
void geos::noding::SegmentNodeList::findCollapsesFromExistingVertices ( std::vector< std::size_t > &  collapsedVertexIndexes) const
private

Adds nodes for any collapsed edge pairs which are pre-existing in the vertex list.

void geos::noding::SegmentNodeList::findCollapsesFromInsertedNodes ( std::vector< std::size_t > &  collapsedVertexIndexes) const
private

Adds nodes for any collapsed edge pairs caused by inserted nodes Collapsed edge pairs occur when the same coordinate is inserted as a node both before and after an existing edge vertex. To provide the correct fully noded semantics, the vertex must be added as a node as well.

const NodedSegmentString& geos::noding::SegmentNodeList::getEdge ( ) const
inline

Definition at line 145 of file SegmentNodeList.h.

std::set<SegmentNode*, SegmentNodeLT>* geos::noding::SegmentNodeList::getNodes ( )
inline

Definition at line 174 of file SegmentNodeList.h.

std::unique_ptr<std::vector<geom::Coordinate> > geos::noding::SegmentNodeList::getSplitCoordinates ( )

Gets the list of coordinates for the fully noded segment string, including all original segment string vertices and vertices introduced by nodes in this list. Repeated coordinates are collapsed.

Returns
an array of Coordinates
SegmentNodeList& geos::noding::SegmentNodeList::operator= ( const SegmentNodeList rhs)
privatedelete
size_t geos::noding::SegmentNodeList::size ( ) const
inline

Return the number of nodes in this list.

Definition at line 181 of file SegmentNodeList.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const SegmentNodeList l 
)
friend

Member Data Documentation

const NodedSegmentString& geos::noding::SegmentNodeList::edge
private

Definition at line 62 of file SegmentNodeList.h.

std::set<SegmentNode*, SegmentNodeLT> geos::noding::SegmentNodeList::nodeMap
private

Definition at line 58 of file SegmentNodeList.h.

std::deque<SegmentNode> geos::noding::SegmentNodeList::nodeQue
private

Definition at line 59 of file SegmentNodeList.h.


The documentation for this class was generated from the following file: