GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
geos::operation::buffer::OffsetSegmentString Class Reference

#include <OffsetSegmentString.h>

Collaboration diagram for geos::operation::buffer::OffsetSegmentString:
[legend]

Public Member Functions

 OffsetSegmentString ()
 
 ~OffsetSegmentString ()
 
void reset ()
 
void setPrecisionModel (const geom::PrecisionModel *nPrecisionModel)
 
void setMinimumVertexDistance (double nMinVertexDistance)
 
void addPt (const geom::Coordinate &pt)
 
void addPts (const geom::CoordinateSequence &pts, bool isForward)
 
void closeRing ()
 
geom::CoordinateSequencegetCoordinates ()
 
size_t size () const
 

Private Member Functions

bool isRedundant (const geom::Coordinate &pt) const
 Tests whether the given point is redundant relative to the previous point in the list (up to tolerance) More...
 
 OffsetSegmentString (const OffsetSegmentString &)=delete
 
OffsetSegmentStringoperator= (const OffsetSegmentString &)=delete
 

Private Attributes

geom::CoordinateArraySequenceptList
 
const geom::PrecisionModelprecisionModel
 
double minimumVertexDistance
 The distance below which two adjacent points on the curve are considered to be coincident. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const OffsetSegmentString &node)
 

Detailed Description

A dynamic list of the vertices in a constructed offset curve.

Automatically removes close vertices which are closer than a given tolerance.

Author
Martin Davis

Definition at line 43 of file OffsetSegmentString.h.

Constructor & Destructor Documentation

geos::operation::buffer::OffsetSegmentString::OffsetSegmentString ( const OffsetSegmentString )
privatedelete
geos::operation::buffer::OffsetSegmentString::OffsetSegmentString ( )
inline

Definition at line 87 of file OffsetSegmentString.h.

Referenced by isRedundant().

Here is the caller graph for this function:

geos::operation::buffer::OffsetSegmentString::~OffsetSegmentString ( )
inline

Definition at line 95 of file OffsetSegmentString.h.

References ptList.

Member Function Documentation

void geos::operation::buffer::OffsetSegmentString::addPt ( const geom::Coordinate pt)
inline

Definition at line 127 of file OffsetSegmentString.h.

References geos::geom::CoordinateArraySequence::add(), isRedundant(), and geos::geom::PrecisionModel::makePrecise().

Referenced by addPts().

Here is the call graph for this function:

Here is the caller graph for this function:

void geos::operation::buffer::OffsetSegmentString::addPts ( const geom::CoordinateSequence pts,
bool  isForward 
)
inline

Definition at line 144 of file OffsetSegmentString.h.

References addPt(), and geos::geom::CoordinateSequence::size().

Here is the call graph for this function:

void geos::operation::buffer::OffsetSegmentString::closeRing ( )
inline

Check that points are a ring

add the startpoint again if they are not

Definition at line 162 of file OffsetSegmentString.h.

References geos::geom::CoordinateArraySequence::add(), geos::geom::CoordinateSequence::back(), geos::geom::Coordinate::equals(), geos::geom::CoordinateSequence::front(), and geos::geom::CoordinateSequence::size().

Referenced by getCoordinates().

Here is the call graph for this function:

Here is the caller graph for this function:

geom::CoordinateSequence* geos::operation::buffer::OffsetSegmentString::getCoordinates ( void  )
inline

Get coordinates by taking ownership of them

After this call, the coordinates reference in this object are dropped. Calling twice will segfault...

FIXME: refactor memory management of this

Definition at line 185 of file OffsetSegmentString.h.

References closeRing(), and ptList.

Here is the call graph for this function:

bool geos::operation::buffer::OffsetSegmentString::isRedundant ( const geom::Coordinate pt) const
inlineprivate

Tests whether the given point is redundant relative to the previous point in the list (up to tolerance)

Parameters
pt
Returns
true if the point is redundant

Definition at line 67 of file OffsetSegmentString.h.

References geos::geom::CoordinateSequence::back(), geos::geom::Coordinate::distance(), OffsetSegmentString(), operator<<, operator=(), and geos::geom::CoordinateSequence::size().

Referenced by addPt().

Here is the call graph for this function:

Here is the caller graph for this function:

OffsetSegmentString& geos::operation::buffer::OffsetSegmentString::operator= ( const OffsetSegmentString )
privatedelete

Referenced by isRedundant().

Here is the caller graph for this function:

void geos::operation::buffer::OffsetSegmentString::reset ( )
inline

Definition at line 101 of file OffsetSegmentString.h.

References geos::geom::CoordinateArraySequence::clear().

Here is the call graph for this function:

void geos::operation::buffer::OffsetSegmentString::setMinimumVertexDistance ( double  nMinVertexDistance)
inline

Definition at line 121 of file OffsetSegmentString.h.

void geos::operation::buffer::OffsetSegmentString::setPrecisionModel ( const geom::PrecisionModel nPrecisionModel)
inline

Definition at line 115 of file OffsetSegmentString.h.

size_t geos::operation::buffer::OffsetSegmentString::size ( ) const
inline

Definition at line 194 of file OffsetSegmentString.h.

References geos::geom::CoordinateSequence::size().

Here is the call graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const OffsetSegmentString node 
)
friend

Definition at line 202 of file OffsetSegmentString.h.

Referenced by isRedundant().

Member Data Documentation

double geos::operation::buffer::OffsetSegmentString::minimumVertexDistance
private

The distance below which two adjacent points on the curve are considered to be coincident.

This is chosen to be a small fraction of the offset distance.

Definition at line 57 of file OffsetSegmentString.h.

const geom::PrecisionModel* geos::operation::buffer::OffsetSegmentString::precisionModel
private

Definition at line 49 of file OffsetSegmentString.h.

geom::CoordinateArraySequence* geos::operation::buffer::OffsetSegmentString::ptList
private

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