Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

CoordinateArraySequence.h

00001 /**********************************************************************
00002  * $Id: CoordinateArraySequence.h 2556 2009-06-06 22:22:28Z 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         const std::vector<Coordinate>* toVector() const;
00055 
00057         CoordinateArraySequence();
00058 
00060         CoordinateArraySequence(std::vector<Coordinate> *coords);
00061 
00063         CoordinateArraySequence(size_t n);
00064 
00065         ~CoordinateArraySequence();
00066 
00067         bool isEmpty() const;
00068 
00069         void add(const Coordinate& c);
00070 
00071         virtual void add(const Coordinate& c, bool allowRepeated);
00072 
00084         virtual void add(size_t i, const Coordinate& coord, bool allowRepeated);
00085 
00086         void setAt(const Coordinate& c, size_t pos);
00087 
00088         void deleteAt(size_t pos);
00089 
00090         std::string toString() const;
00091 
00092         void setPoints(const std::vector<Coordinate> &v);
00093 
00094         double getOrdinate(size_t index,
00095                         size_t ordinateIndex) const;
00096 
00097         void setOrdinate(size_t index, size_t ordinateIndex,
00098                         double value);
00099 
00100         void expandEnvelope(Envelope &env) const;
00101 
00102         size_t getDimension() const { return 3; }
00103 
00104         void apply_rw(const CoordinateFilter *filter); 
00105 
00106         void apply_ro(CoordinateFilter *filter) const; 
00107 
00108         virtual CoordinateSequence& removeRepeatedPoints();
00109 
00110 private:
00111         std::vector<Coordinate> *vect;
00112 };
00113 
00115 typedef CoordinateArraySequence DefaultCoordinateSequence;
00116 
00117 } // namespace geos.geom
00118 } // namespace geos
00119 
00120 //#ifdef GEOS_INLINE
00121 //# include "geos/geom/CoordinateArraySequence.inl"
00122 //#endif
00123 
00124 #endif // ndef GEOS_GEOM_COORDINATEARRAYSEQUENCE_H
00125 
00126 /**********************************************************************
00127  * $Log$
00128  * Revision 1.4  2006/06/12 10:10:39  strk
00129  * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t.
00130  *
00131  * Revision 1.3  2006/05/03 08:58:34  strk
00132  * added new non-static CoordinateSequence::removeRepeatedPoints() mutator.
00133  *
00134  * Revision 1.2  2006/03/24 09:52:41  strk
00135  * USE_INLINE => GEOS_INLINE
00136  *
00137  * Revision 1.1  2006/03/09 16:46:49  strk
00138  * geos::geom namespace definition, first pass at headers split
00139  *
00140  **********************************************************************/

Generated on Thu Jun 11 06:17:00 2009 for GEOS by  doxygen 1.4.4