GEOS 3.15.0beta1
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::PathString 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, const std::shared_ptr< const geom::CoordinateSequence > &newSeq)
 Construct a SegmentString.
std::size_t size () const
std::size_t getSize () const override
template<typename CoordType = geom::Coordinate>
const CoordType & getCoordinate (std::size_t i) const
double getLength () const override
const std::shared_ptr< const geom::CoordinateSequence > & getCoordinates () const override
 Return a pointer to the CoordinateSequence associated with this SegmentString.
void setCoordinates (const std::shared_ptr< const geom::CoordinateSequence > &newSeq)
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
Public Member Functions inherited from geos::noding::PathString
 PathString (const void *p_context=nullptr)
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.

Static Public Member Functions

static int getSegmentOctant (const SegmentString &ss, std::size_t index)
static std::vector< SegmentString * > toRawPointerVector (const std::vector< std::unique_ptr< SegmentString > > &segStrings)
static std::vector< SegmentString * > toRawPointerVector (const std::vector< std::unique_ptr< PathString > > &segStrings)
Static Public Member Functions inherited from geos::noding::PathString
static std::vector< PathString * > toRawPointerVector (const std::vector< std::unique_ptr< PathString > > &segStrings)

Protected Attributes

std::shared_ptr< const 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,
const std::shared_ptr< const geom::CoordinateSequence > & newSeq )
inline

Construct a SegmentString.

Parameters
newContextthe context associated to this SegmentString
newSeqcoordinates of this SegmentString

Referenced by geos::noding::BasicSegmentString::BasicSegmentString().

Member Function Documentation

◆ getCoordinates()

const std::shared_ptr< const geom::CoordinateSequence > & geos::noding::SegmentString::getCoordinates ( ) const
inlineoverridevirtual

Return a pointer to the CoordinateSequence associated with this SegmentString.

Implements geos::noding::PathString.

◆ getLength()

double geos::noding::SegmentString::getLength ( ) const
inlineoverridevirtual

◆ 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

◆ getSize()

std::size_t geos::noding::SegmentString::getSize ( ) const
inlineoverridevirtual

◆ 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

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