GEOS 3.14.0dev
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
geos::noding::SegmentString Class Reference

An interface for classes which represent a sequence of contiguous line segments. More...

#include <SegmentString.h>

Inheritance diagram for geos::noding::SegmentString:
geos::noding::BasicSegmentString geos::noding::NodableSegmentString geos::noding::NodedSegmentString

Public Types

typedef std::vector< const SegmentString * > ConstVect
 
typedef std::vector< SegmentString * > NonConstVect
 

Public Member Functions

 SegmentString (const void *newContext, geom::CoordinateSequence *newSeq)
 Construct a SegmentString.
 
const void * getData () const
 Gets the user-defined data for this segment string.
 
void setData (const void *data)
 Sets the user-defined data for this segment string.
 
std::size_t size () const
 
template<typename CoordType = geom::Coordinate>
const CoordType & getCoordinate (std::size_t i) const
 
const geom::CoordinateSequencegetCoordinates () const
 Return a pointer to the CoordinateSequence associated with this SegmentString.
 
geom::CoordinateSequencegetCoordinates ()
 
int getSegmentOctant (std::size_t index) const
 Gets the octant of the segment starting at vertex index.
 
const geom::CoordinateXY & nextInRing (std::size_t index) const
 
const geom::CoordinateXY & prevInRing (std::size_t index) const
 
bool isClosed () const
 
virtual std::ostream & print (std::ostream &os) const
 

Static Public Member Functions

static int getSegmentOctant (const SegmentString &ss, std::size_t index)
 

Protected Attributes

geom::CoordinateSequenceseq
 

Friends

std::ostream & operator<< (std::ostream &os, const SegmentString &ss)
 

Detailed Description

An interface for classes which represent a sequence of contiguous line segments.

SegmentStrings can carry a context object, which is useful for preserving topological or parentage information.

Constructor & Destructor Documentation

◆ SegmentString()

geos::noding::SegmentString::SegmentString ( const void *  newContext,
geom::CoordinateSequence newSeq 
)
inline

Construct a SegmentString.

Parameters
newContextthe context associated to this SegmentString
newSeqcoordinates of this SegmentString

Member Function Documentation

◆ getCoordinates()

const geom::CoordinateSequence * geos::noding::SegmentString::getCoordinates ( ) const
inline

Return a pointer to the CoordinateSequence associated with this SegmentString.

Note
The CoordinateSequence is owned by this SegmentString!

◆ getData()

const void * geos::noding::SegmentString::getData ( ) const
inline

Gets the user-defined data for this segment string.

Returns
the user-defined data

◆ getSegmentOctant()

int geos::noding::SegmentString::getSegmentOctant ( std::size_t  index) const
inline

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

◆ nextInRing()

const geom::CoordinateXY & geos::noding::SegmentString::nextInRing ( std::size_t  index) const
inline

Gets the next vertex in a ring from a vertex index.

Parameters
indexthe vertex index
Returns
the next vertex in the ring
See also
isClosed

◆ prevInRing()

const geom::CoordinateXY & geos::noding::SegmentString::prevInRing ( std::size_t  index) const
inline

Gets the previous vertex in a ring from a vertex index.

Parameters
indexthe vertex index
Returns
the previous vertex in the ring
See also
isClosed

◆ setData()

void geos::noding::SegmentString::setData ( const void *  data)
inline

Sets the user-defined data for this segment string.

Parameters
dataan Object containing user-defined data

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