00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _GEOS_SIMPLIFY_TAGGEDLINESTRING_H_
00027 #define _GEOS_SIMPLIFY_TAGGEDLINESTRING_H_
00028
00029 #include <vector>
00030 #include <memory>
00031
00032
00033 namespace geos {
00034 namespace geom {
00035 class Coordinate;
00036 class CoordinateSequence;
00037 class Geometry;
00038 class LineString;
00039 class LinearRing;
00040 }
00041 namespace simplify {
00042 class TaggedLineSegment;
00043 }
00044 }
00045
00046 namespace geos {
00047 namespace simplify {
00048
00049
00055 class TaggedLineString {
00056
00057 public:
00058
00059 typedef std::vector<geom::Coordinate> CoordVect;
00060
00061 typedef std::auto_ptr<CoordVect> CoordVectPtr;
00062
00063 typedef geom::CoordinateSequence CoordSeq;
00064
00065 typedef std::auto_ptr<geom::CoordinateSequence> CoordSeqPtr;
00066
00067 TaggedLineString(const geom::LineString* nParentLine,
00068 size_t minimumSize=2);
00069
00070 ~TaggedLineString();
00071
00072 size_t getMinimumSize() const;
00073
00074 const geom::LineString* getParent() const;
00075
00076 const CoordSeq* getParentCoordinates() const;
00077
00078 CoordSeqPtr getResultCoordinates() const;
00079
00080 size_t getResultSize() const;
00081
00082 TaggedLineSegment* getSegment(size_t);
00083
00084 const TaggedLineSegment* getSegment(size_t) const;
00085
00086 std::vector<TaggedLineSegment*>& getSegments();
00087
00088 const std::vector<TaggedLineSegment*>& getSegments() const;
00089
00090 void addToResult(std::auto_ptr<TaggedLineSegment> seg);
00091
00092 std::auto_ptr<geom::Geometry> asLineString() const;
00093
00094 std::auto_ptr<geom::Geometry> asLinearRing() const;
00095
00096 private:
00097
00098 const geom::LineString* parentLine;
00099
00100
00101 std::vector<TaggedLineSegment*> segs;
00102
00103
00104 std::vector<TaggedLineSegment*> resultSegs;
00105
00106 size_t minimumSize;
00107
00108 void init();
00109
00110 static CoordVectPtr extractCoordinates(
00111 const std::vector<TaggedLineSegment*>& segs);
00112
00113
00114 TaggedLineString(const TaggedLineString&);
00115 TaggedLineString& operator= (const TaggedLineString&);
00116
00117 };
00118
00119 }
00120 }
00121
00122 #endif // _GEOS_SIMPLIFY_TAGGEDLINESTRING_H_
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150