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

A list of Coordinates, which may be set to prevent repeated coordinates from occuring in the list. More...

#include <CoordinateList.h>

Public Types

typedef std::list< Coordinate >::iterator iterator
 
typedef std::list< Coordinate >::const_iterator const_iterator
 

Public Member Functions

 CoordinateList (const std::vector< Coordinate > &v)
 Constructs a new list from an array of Coordinates, allowing repeated points. More...
 
 CoordinateList ()
 
size_t size () const
 
bool empty () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
iterator insert (iterator pos, const Coordinate &c, bool allowRepeated)
 Inserts the specified coordinate at the specified position in this list. More...
 
iterator insert (iterator pos, const Coordinate &c)
 
iterator erase (iterator pos)
 
iterator erase (iterator first, iterator last)
 
std::unique_ptr< Coordinate::VecttoCoordinateArray () const
 
void closeRing ()
 

Private Attributes

std::list< Coordinatecoords
 

Friends

std::ostream & operator<< (std::ostream &os, const CoordinateList &cl)
 

Detailed Description

A list of Coordinates, which may be set to prevent repeated coordinates from occuring in the list.

Use this class when fast insertions and removal at arbitrary position is needed. The class keeps ownership of the Coordinates.

Definition at line 55 of file CoordinateList.h.

Member Typedef Documentation

Definition at line 60 of file CoordinateList.h.

Definition at line 59 of file CoordinateList.h.

Constructor & Destructor Documentation

geos::geom::CoordinateList::CoordinateList ( const std::vector< Coordinate > &  v)
inline

Constructs a new list from an array of Coordinates, allowing repeated points.

(I.e. this constructor produces a CoordinateList with exactly the same set of points as the input array.)

Parameters
vthe initial coordinates

Definition at line 74 of file CoordinateList.h.

geos::geom::CoordinateList::CoordinateList ( )
inline

Definition at line 80 of file CoordinateList.h.

Member Function Documentation

iterator geos::geom::CoordinateList::begin ( )
inline

Definition at line 99 of file CoordinateList.h.

Referenced by geos::geom::operator<<().

Here is the caller graph for this function:

const_iterator geos::geom::CoordinateList::begin ( ) const
inline

Definition at line 111 of file CoordinateList.h.

void geos::geom::CoordinateList::closeRing ( )
inline

Definition at line 174 of file CoordinateList.h.

bool geos::geom::CoordinateList::empty ( ) const
inline

Definition at line 93 of file CoordinateList.h.

iterator geos::geom::CoordinateList::end ( )
inline

Definition at line 105 of file CoordinateList.h.

Referenced by geos::geom::operator<<().

Here is the caller graph for this function:

const_iterator geos::geom::CoordinateList::end ( ) const
inline

Definition at line 117 of file CoordinateList.h.

iterator geos::geom::CoordinateList::erase ( iterator  pos)
inline

Definition at line 155 of file CoordinateList.h.

iterator geos::geom::CoordinateList::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 161 of file CoordinateList.h.

iterator geos::geom::CoordinateList::insert ( iterator  pos,
const Coordinate c,
bool  allowRepeated 
)
inline

Inserts the specified coordinate at the specified position in this list.

Parameters
posthe position at which to insert
cthe coordinate to insert
allowRepeatedif set to false, repeated coordinates are collapsed
Returns
an iterator to the newly installed coordinate (or previous, if equal and repeated are not allowed)

NOTE: when allowRepeated is false next point is not checked this matches JTS behavior

Definition at line 136 of file CoordinateList.h.

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

Here is the call graph for this function:

iterator geos::geom::CoordinateList::insert ( iterator  pos,
const Coordinate c 
)
inline

Definition at line 149 of file CoordinateList.h.

size_t geos::geom::CoordinateList::size ( ) const
inline

Definition at line 87 of file CoordinateList.h.

std::unique_ptr<Coordinate::Vect> geos::geom::CoordinateList::toCoordinateArray ( ) const
inline

Definition at line 167 of file CoordinateList.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CoordinateList cl 
)
friend

Definition at line 190 of file CoordinateList.h.

Member Data Documentation

std::list<Coordinate> geos::geom::CoordinateList::coords
private

Definition at line 185 of file CoordinateList.h.


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