00001 /********************************************************************** 00002 * $Id: CoordinateArraySequence.h 1958 2007-01-09 15:08:22Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 **********************************************************************/ 00015 00016 #ifndef GEOS_GEOM_COORDINATEARRAYSEQUENCE_H 00017 #define GEOS_GEOM_COORDINATEARRAYSEQUENCE_H 00018 00019 #include <vector> 00020 00021 //#include <geos/platform.h> 00022 #include <geos/geom/CoordinateSequence.h> 00023 00024 #include <geos/inline.h> 00025 00026 // Forward declarations 00027 namespace geos { 00028 namespace geom { 00029 class Coordinate; 00030 } 00031 } 00032 00033 00034 namespace geos { 00035 namespace geom { // geos.geom 00036 00038 class CoordinateArraySequence : public CoordinateSequence { 00039 public: 00040 00041 CoordinateArraySequence(const CoordinateArraySequence &cl); 00042 00043 CoordinateSequence *clone() const; 00044 00045 //const Coordinate& getCoordinate(int pos) const; 00046 const Coordinate& getAt(size_t pos) const; 00047 00049 virtual void getAt(size_t i, Coordinate& c) const; 00050 00051 //int size() const; 00052 size_t getSize() const; 00053 const std::vector<Coordinate>* toVector() const; 00054 00056 CoordinateArraySequence(); 00057 00059 CoordinateArraySequence(std::vector<Coordinate> *coords); 00060 00062 CoordinateArraySequence(size_t n); 00063 00064 ~CoordinateArraySequence(); 00065 00066 bool isEmpty() const; 00067 00068 void add(const Coordinate& c); 00069 00070 virtual void add(const Coordinate& c, bool allowRepeated); 00071 00072 void setAt(const Coordinate& c, size_t pos); 00073 00074 void deleteAt(size_t pos); 00075 00076 std::string toString() const; 00077 00078 void setPoints(const std::vector<Coordinate> &v); 00079 00080 double getOrdinate(size_t index, 00081 size_t ordinateIndex) const; 00082 00083 void setOrdinate(size_t index, size_t ordinateIndex, 00084 double value); 00085 00086 void expandEnvelope(Envelope &env) const; 00087 00088 size_t getDimension() const { return 3; } 00089 00090 void apply_rw(const CoordinateFilter *filter); 00091 00092 void apply_ro(CoordinateFilter *filter) const; 00093 00094 virtual CoordinateSequence& removeRepeatedPoints(); 00095 00096 private: 00097 std::vector<Coordinate> *vect; 00098 }; 00099 00101 typedef CoordinateArraySequence DefaultCoordinateSequence; 00102 00103 } // namespace geos.geom 00104 } // namespace geos 00105 00106 //#ifdef GEOS_INLINE 00107 //# include "geos/geom/CoordinateArraySequence.inl" 00108 //#endif 00109 00110 #endif // ndef GEOS_GEOM_COORDINATEARRAYSEQUENCE_H 00111 00112 /********************************************************************** 00113 * $Log$ 00114 * Revision 1.4 2006/06/12 10:10:39 strk 00115 * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t. 00116 * 00117 * Revision 1.3 2006/05/03 08:58:34 strk 00118 * added new non-static CoordinateSequence::removeRepeatedPoints() mutator. 00119 * 00120 * Revision 1.2 2006/03/24 09:52:41 strk 00121 * USE_INLINE => GEOS_INLINE 00122 * 00123 * Revision 1.1 2006/03/09 16:46:49 strk 00124 * geos::geom namespace definition, first pass at headers split 00125 * 00126 **********************************************************************/