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 <geos/export.h>
00030 #include <vector>
00031 #include <memory>
00032
00033 #ifdef _MSC_VER
00034 #pragma warning(push)
00035 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00036 #endif
00037
00038
00039 namespace geos {
00040 namespace geom {
00041 class Coordinate;
00042 class CoordinateSequence;
00043 class Geometry;
00044 class LineString;
00045 class LinearRing;
00046 }
00047 namespace simplify {
00048 class TaggedLineSegment;
00049 }
00050 }
00051
00052 namespace geos {
00053 namespace simplify {
00054
00055
00061 class GEOS_DLL TaggedLineString {
00062
00063 public:
00064
00065 typedef std::vector<geom::Coordinate> CoordVect;
00066
00067 typedef std::auto_ptr<CoordVect> CoordVectPtr;
00068
00069 typedef geom::CoordinateSequence CoordSeq;
00070
00071 typedef std::auto_ptr<geom::CoordinateSequence> CoordSeqPtr;
00072
00073 TaggedLineString(const geom::LineString* nParentLine,
00074 std::size_t minimumSize=2);
00075
00076 ~TaggedLineString();
00077
00078 std::size_t getMinimumSize() const;
00079
00080 const geom::LineString* getParent() const;
00081
00082 const CoordSeq* getParentCoordinates() const;
00083
00084 CoordSeqPtr getResultCoordinates() const;
00085
00086 std::size_t getResultSize() const;
00087
00088 TaggedLineSegment* getSegment(std::size_t i);
00089
00090 const TaggedLineSegment* getSegment(std::size_t i) const;
00091
00092 std::vector<TaggedLineSegment*>& getSegments();
00093
00094 const std::vector<TaggedLineSegment*>& getSegments() const;
00095
00096 void addToResult(std::auto_ptr<TaggedLineSegment> seg);
00097
00098 std::auto_ptr<geom::Geometry> asLineString() const;
00099
00100 std::auto_ptr<geom::Geometry> asLinearRing() const;
00101
00102 private:
00103
00104 const geom::LineString* parentLine;
00105
00106
00107 std::vector<TaggedLineSegment*> segs;
00108
00109
00110 std::vector<TaggedLineSegment*> resultSegs;
00111
00112 std::size_t minimumSize;
00113
00114 void init();
00115
00116 static CoordVectPtr extractCoordinates(
00117 const std::vector<TaggedLineSegment*>& segs);
00118
00119
00120 TaggedLineString(const TaggedLineString&);
00121 TaggedLineString& operator= (const TaggedLineString&);
00122
00123 };
00124
00125 }
00126 }
00127
00128 #ifdef _MSC_VER
00129 #pragma warning(pop)
00130 #endif
00131
00132 #endif // GEOS_SIMPLIFY_TAGGEDLINESTRING_H
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160