15#ifndef GEOS_GEOM_COORDINATEARRAYSEQUENCE_H
16#define GEOS_GEOM_COORDINATEARRAYSEQUENCE_H
18#include <geos/export.h>
21#include <geos/geom/CoordinateSequence.h>
23#include <geos/inline.h>
37class GEOS_DLL CoordinateArraySequence :
public CoordinateSequence {
40 CoordinateArraySequence(
const CoordinateArraySequence &cl);
42 CoordinateArraySequence(
const CoordinateSequence &cl);
44 CoordinateSequence *
clone()
const;
56 const std::vector<Coordinate>*
toVector()
const;
66 std::size_t dimension = 0);
71 ~CoordinateArraySequence();
75 bool empty()
const {
return vect->empty(); }
95 virtual void add(std::size_t i,
const Coordinate& coord,
bool allowRepeated);
105 double getOrdinate(std::size_t
index,
106 size_t ordinateIndex)
const;
122 std::vector<Coordinate> *vect;
123 mutable std::size_t dimension;
The default implementation of CoordinateSequence.
Definition CoordinateArraySequence.h:37
void toVector(std::vector< Coordinate > &) const
Pushes all Coordinates of this sequence onto the provided vector.
void setPoints(const std::vector< Coordinate > &v)
Substitute Coordinate list with a copy of the given vector.
virtual void getAt(std::size_t i, Coordinate &c) const
Copy Coordinate at position i to Coordinate c.
virtual void add(const Coordinate &c, bool allowRepeated)
Add a coordinate.
void setOrdinate(std::size_t index, std::size_t ordinateIndex, double value)
void clear()
Reset this CoordinateArraySequence to the empty state.
Definition CoordinateArraySequence.h:78
CoordinateArraySequence(std::vector< Coordinate > *coords, std::size_t dimension=0)
Construct sequence taking ownership of given Coordinate vector.
std::size_t getDimension() const
const std::vector< Coordinate > * toVector() const
Returns a read-only vector with the Coordinates in this collection.
CoordinateArraySequence(std::size_t n, std::size_t dimension=0)
Construct sequence allocating space for n coordinates.
void deleteAt(std::size_t pos)
Delete Coordinate at position pos (list will shrink).
CoordinateArraySequence()
Construct an empty sequence.
size_t getSize() const
Returns the number of Coordinates (actual or otherwise, as this implementation may not store its data...
void setAt(const Coordinate &c, std::size_t pos)
Get a reference to Coordinate at position pos.
virtual void add(std::size_t i, const Coordinate &coord, bool allowRepeated)
Inserts the specified coordinate at the specified position in this list.
bool isEmpty() const
Returns true it list contains no coordinates.
Definition CoordinateArraySequence.h:73
void add(const Coordinate &c)
Add a Coordinate to the list.
virtual CoordinateSequence & removeRepeatedPoints()
Remove consecutive equal Coordinates from the sequence.
void expandEnvelope(Envelope &env) const
std::string toString() const
Get a string rapresentation of CoordinateSequence.
CoordinateSequence * clone() const
Returns a deep copy of this collection.
const Coordinate & getAt(std::size_t pos) const
Returns a read-only reference to Coordinate at position i.
Definition CoordinateFilter.h:43
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:53
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
CoordinateArraySequence DefaultCoordinateSequence
This is for backward API compatibility.
Definition CoordinateArraySequence.h:127
Provides classes for various kinds of spatial indexes.
Definition IndexedNestedRingTester.h:31
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25