• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

CoordinateArraySequence.h

00001 /**********************************************************************
00002  * $Id: CoordinateArraySequence.h 2678 2009-10-17 12:28:41Z 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 <geos/export.h>
00020 #include <vector>
00021 
00022 //#include <geos/platform.h>
00023 #include <geos/geom/CoordinateSequence.h>
00024 
00025 #include <geos/inline.h>
00026 
00027 // Forward declarations
00028 namespace geos {
00029         namespace geom { 
00030                 class Coordinate;
00031         }
00032 }
00033 
00034 
00035 namespace geos {
00036 namespace geom { // geos.geom
00037 
00039 class GEOS_DLL CoordinateArraySequence : public CoordinateSequence {
00040 public:
00041 
00042         CoordinateArraySequence(const CoordinateArraySequence &cl);
00043 
00044         CoordinateSequence *clone() const;
00045 
00046         //const Coordinate& getCoordinate(int pos) const;
00047         const Coordinate& getAt(size_t pos) const;
00048 
00050         virtual void getAt(size_t i, Coordinate& c) const;
00051 
00052         //int size() const;
00053         size_t getSize() const;
00054 
00055         // @deprecated
00056         const std::vector<Coordinate>* toVector() const;
00057 
00058         // See dox in CoordinateSequence.h
00059         void toVector(std::vector<Coordinate>&) const;
00060 
00062         CoordinateArraySequence();
00063 
00065         CoordinateArraySequence(std::vector<Coordinate> *coords);
00066 
00068         CoordinateArraySequence(size_t n);
00069 
00070         ~CoordinateArraySequence();
00071 
00072         bool isEmpty() const;
00073 
00074         void add(const Coordinate& c);
00075 
00076         virtual void add(const Coordinate& c, bool allowRepeated);
00077 
00089         virtual void add(size_t i, const Coordinate& coord, bool allowRepeated);
00090 
00091         void setAt(const Coordinate& c, size_t pos);
00092 
00093         void deleteAt(size_t pos);
00094 
00095         std::string toString() const;
00096 
00097         void setPoints(const std::vector<Coordinate> &v);
00098 
00099         double getOrdinate(size_t index,
00100                         size_t ordinateIndex) const;
00101 
00102         void setOrdinate(size_t index, size_t ordinateIndex,
00103                         double value);
00104 
00105         void expandEnvelope(Envelope &env) const;
00106 
00107         size_t getDimension() const { return 3; }
00108 
00109         void apply_rw(const CoordinateFilter *filter); 
00110 
00111         void apply_ro(CoordinateFilter *filter) const; 
00112 
00113         virtual CoordinateSequence& removeRepeatedPoints();
00114 
00115 private:
00116         std::vector<Coordinate> *vect;
00117 };
00118 
00120 typedef CoordinateArraySequence DefaultCoordinateSequence;
00121 
00122 } // namespace geos.geom
00123 } // namespace geos
00124 
00125 //#ifdef GEOS_INLINE
00126 //# include "geos/geom/CoordinateArraySequence.inl"
00127 //#endif
00128 
00129 #endif // ndef GEOS_GEOM_COORDINATEARRAYSEQUENCE_H
00130 
00131 /**********************************************************************
00132  * $Log$
00133  * Revision 1.4  2006/06/12 10:10:39  strk
00134  * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t.
00135  *
00136  * Revision 1.3  2006/05/03 08:58:34  strk
00137  * added new non-static CoordinateSequence::removeRepeatedPoints() mutator.
00138  *
00139  * Revision 1.2  2006/03/24 09:52:41  strk
00140  * USE_INLINE => GEOS_INLINE
00141  *
00142  * Revision 1.1  2006/03/09 16:46:49  strk
00143  * geos::geom namespace definition, first pass at headers split
00144  *
00145  **********************************************************************/

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1