GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
geos::noding::NodedSegmentString Class Reference

Represents a list of contiguous line segments, and supports noding the segments. More...

#include <NodedSegmentString.h>

Inheritance diagram for geos::noding::NodedSegmentString:
[legend]
Collaboration diagram for geos::noding::NodedSegmentString:
[legend]

Public Member Functions

std::unique_ptr< std::vector< geom::Coordinate > > getNodedCoordinates ()
 
 NodedSegmentString (geom::CoordinateSequence *newPts, const void *newContext)
 Creates a new segment string from a list of vertices. More...
 
 NodedSegmentString (SegmentString *ss)
 
 ~NodedSegmentString () override=default
 
SegmentNodeaddIntersectionNode (geom::Coordinate *intPt, std::size_t segmentIndex)
 Adds an intersection node for a given point and segment to this segment string. More...
 
SegmentNodeListgetNodeList ()
 
const SegmentNodeListgetNodeList () const
 
size_t size () const override
 
const geom::CoordinategetCoordinate (size_t i) const override
 
geom::CoordinateSequencegetCoordinates () const override
 Return a pointer to the CoordinateSequence associated with this SegmentString. More...
 
geom::CoordinateSequencereleaseCoordinates ()
 
bool isClosed () const override
 
std::ostream & print (std::ostream &os) const override
 
int getSegmentOctant (size_t index) const
 Gets the octant of the segment starting at vertex index. More...
 
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 intersection list. More...
 
void addIntersection (algorithm::LineIntersector *li, size_t segmentIndex, size_t geomIndex, size_t intIndex)
 Add an SegmentNode for intersection intIndex. More...
 
void addIntersection (const geom::Coordinate &intPt, size_t segmentIndex)
 Add an SegmentNode for intersection intIndex. More...
 
- Public Member Functions inherited from geos::noding::NodableSegmentString
 NodableSegmentString (const void *newContext)
 
- Public Member Functions inherited from geos::noding::SegmentString
 SegmentString (const void *newContext)
 Construct a SegmentString. More...
 
virtual ~SegmentString ()
 
const void * getData () const
 Gets the user-defined data for this segment string. More...
 
void setData (const void *data)
 Sets the user-defined data for this segment string. More...
 

Static Public Member Functions

template<class II >
static void getNodedSubstrings (II from, II too_far, SegmentString::NonConstVect *resultEdgelist)
 
template<class C >
static void getNodedSubstrings (C *segStrings, SegmentString::NonConstVect *resultEdgelist)
 
static void getNodedSubstrings (const SegmentString::NonConstVect &segStrings, SegmentString::NonConstVect *resultEdgeList)
 
static SegmentString::NonConstVectgetNodedSubstrings (const SegmentString::NonConstVect &segStrings)
 Returns allocated object. More...
 

Static Private Member Functions

static int safeOctant (const geom::Coordinate &p0, const geom::Coordinate &p1)
 

Private Attributes

SegmentNodeList nodeList
 
std::unique_ptr< geom::CoordinateSequencepts
 

Additional Inherited Members

- Public Types inherited from geos::noding::SegmentString
typedef std::vector< const SegmentString * > ConstVect
 
typedef std::vector< SegmentString * > NonConstVect
 

Detailed Description

Represents a list of contiguous line segments, and supports noding the segments.

The line segments are represented by an array of Coordinates. Intended to optimize the noding of contiguous segments by reducing the number of allocated objects. SegmentStrings can carry a context object, which is useful for preserving topological or parentage information. All noded substrings are initialized with the same context object.

Definition at line 57 of file NodedSegmentString.h.

Constructor & Destructor Documentation

geos::noding::NodedSegmentString::NodedSegmentString ( geom::CoordinateSequence newPts,
const void *  newContext 
)
inline

Creates a new segment string from a list of vertices.

Parameters
newPtsCoordinateSequence representing the string, ownership transferred.
newContextthe user-defined data of this segment string (may be null)

Definition at line 100 of file NodedSegmentString.h.

geos::noding::NodedSegmentString::NodedSegmentString ( SegmentString ss)
inline

Definition at line 106 of file NodedSegmentString.h.

geos::noding::NodedSegmentString::~NodedSegmentString ( )
overridedefault

Member Function Documentation

void geos::noding::NodedSegmentString::addIntersection ( algorithm::LineIntersector li,
size_t  segmentIndex,
size_t  geomIndex,
size_t  intIndex 
)

Add an SegmentNode for intersection intIndex.

An intersection that falls exactly on a vertex of the SegmentString is normalized to use the higher of the two possible segmentIndexes

void geos::noding::NodedSegmentString::addIntersection ( const geom::Coordinate intPt,
size_t  segmentIndex 
)

Add an SegmentNode for intersection intIndex.

An intersection that falls exactly on a vertex of the edge is normalized to use the higher of the two possible segmentIndexes

SegmentNode* geos::noding::NodedSegmentString::addIntersectionNode ( geom::Coordinate intPt,
std::size_t  segmentIndex 
)
inline

Adds an intersection node for a given point and segment to this segment string.

If an intersection already exists for this exact location, the existing node will be returned.

Parameters
intPtthe location of the intersection
segmentIndexthe index of the segment containing the intersection
Returns
the intersection node for the point

Definition at line 125 of file NodedSegmentString.h.

References geos::geom::Coordinate::equals2D().

Here is the call graph for this function:

void geos::noding::NodedSegmentString::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 intersection list.

const geom::Coordinate& geos::noding::NodedSegmentString::getCoordinate ( size_t  i) const
overridevirtual
geom::CoordinateSequence* geos::noding::NodedSegmentString::getCoordinates ( ) const
overridevirtual

Return a pointer to the CoordinateSequence associated with this SegmentString.

Note
The CoordinateSequence is owned by this SegmentString!

Implements geos::noding::SegmentString.

std::unique_ptr<std::vector<geom::Coordinate> > geos::noding::NodedSegmentString::getNodedCoordinates ( )
template<class II >
static void geos::noding::NodedSegmentString::getNodedSubstrings ( II  from,
II  too_far,
SegmentString::NonConstVect resultEdgelist 
)
inlinestatic

Definition at line 63 of file NodedSegmentString.h.

References geos::noding::SegmentNodeList::addSplitEdges(), and getNodeList().

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

Here is the call graph for this function:

Here is the caller graph for this function:

template<class C >
static void geos::noding::NodedSegmentString::getNodedSubstrings ( C *  segStrings,
SegmentString::NonConstVect resultEdgelist 
)
inlinestatic

Definition at line 75 of file NodedSegmentString.h.

static void geos::noding::NodedSegmentString::getNodedSubstrings ( const SegmentString::NonConstVect segStrings,
SegmentString::NonConstVect resultEdgeList 
)
static
static SegmentString::NonConstVect* geos::noding::NodedSegmentString::getNodedSubstrings ( const SegmentString::NonConstVect segStrings)
static

Returns allocated object.

SegmentNodeList& geos::noding::NodedSegmentString::getNodeList ( )

Referenced by getNodedSubstrings().

Here is the caller graph for this function:

const SegmentNodeList& geos::noding::NodedSegmentString::getNodeList ( ) const
int geos::noding::NodedSegmentString::getSegmentOctant ( size_t  index) const

Gets the octant of the segment starting at vertex index.

Parameters
indexthe index of the vertex starting the segment. Must not be the last index in the vertex list
Returns
the octant of the segment at the vertex
bool geos::noding::NodedSegmentString::isClosed ( ) const
overridevirtual
std::ostream& geos::noding::NodedSegmentString::print ( std::ostream &  os) const
overridevirtual

Reimplemented from geos::noding::SegmentString.

geom::CoordinateSequence* geos::noding::NodedSegmentString::releaseCoordinates ( )
static int geos::noding::NodedSegmentString::safeOctant ( const geom::Coordinate p0,
const geom::Coordinate p1 
)
staticprivate
size_t geos::noding::NodedSegmentString::size ( ) const
inlineoverridevirtual

Implements geos::noding::SegmentString.

Definition at line 152 of file NodedSegmentString.h.

Member Data Documentation

SegmentNodeList geos::noding::NodedSegmentString::nodeList
private

Definition at line 208 of file NodedSegmentString.h.

std::unique_ptr<geom::CoordinateSequence> geos::noding::NodedSegmentString::pts
private

Definition at line 210 of file NodedSegmentString.h.


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