00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_GEOM_COORDINATEARRAYSEQUENCE_H
00017 #define GEOS_GEOM_COORDINATEARRAYSEQUENCE_H
00018
00019 #include <geos/export.h>
00020 #include <vector>
00021
00022 #include <geos/geom/CoordinateSequence.h>
00023
00024 #include <geos/inline.h>
00025
00026
00027 namespace geos {
00028 namespace geom {
00029 class Coordinate;
00030 }
00031 }
00032
00033
00034 namespace geos {
00035 namespace geom {
00036
00038 class GEOS_DLL CoordinateArraySequence : public CoordinateSequence {
00039 public:
00040
00041 CoordinateArraySequence(const CoordinateArraySequence &cl);
00042
00043 CoordinateSequence *clone() const;
00044
00045
00046 const Coordinate& getAt(std::size_t pos) const;
00047
00049 virtual void getAt(std::size_t i, Coordinate& c) const;
00050
00051
00052 size_t getSize() const;
00053
00054
00055 const std::vector<Coordinate>* toVector() const;
00056
00057
00058 void toVector(std::vector<Coordinate>&) const;
00059
00061 CoordinateArraySequence();
00062
00064 CoordinateArraySequence(std::vector<Coordinate> *coords,
00065 std::size_t dimension = 0);
00066
00068 CoordinateArraySequence(std::size_t n, std::size_t dimension = 0);
00069
00070 ~CoordinateArraySequence();
00071
00072 bool isEmpty() const { return empty(); }
00073
00074 bool empty() const { return vect->empty(); }
00075
00077 void clear() { vect->clear(); }
00078
00079 void add(const Coordinate& c);
00080
00081 virtual void add(const Coordinate& c, bool allowRepeated);
00082
00094 virtual void add(std::size_t i, const Coordinate& coord, bool allowRepeated);
00095
00096 void setAt(const Coordinate& c, std::size_t pos);
00097
00098 void deleteAt(std::size_t pos);
00099
00100 std::string toString() const;
00101
00102 void setPoints(const std::vector<Coordinate> &v);
00103
00104 double getOrdinate(std::size_t index,
00105 size_t ordinateIndex) const;
00106
00107 void setOrdinate(std::size_t index, std::size_t ordinateIndex,
00108 double value);
00109
00110 void expandEnvelope(Envelope &env) const;
00111
00112 std::size_t getDimension() const;
00113
00114 void apply_rw(const CoordinateFilter *filter);
00115
00116 void apply_ro(CoordinateFilter *filter) const;
00117
00118 virtual CoordinateSequence& removeRepeatedPoints();
00119
00120 private:
00121 std::vector<Coordinate> *vect;
00122 mutable std::size_t dimension;
00123 };
00124
00126 typedef CoordinateArraySequence DefaultCoordinateSequence;
00127
00128 }
00129 }
00130
00131
00132
00133
00134
00135 #endif // ndef GEOS_GEOM_COORDINATEARRAYSEQUENCE_H
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151