00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
00021 #define GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
00022
00023 #include <geos/geom/Coordinate.h>
00024 #include <geos/geom/CoordinateList.h>
00025 #include <geos/geom/Geometry.h>
00026 #include <geos/geom/GeometryFactory.h>
00027 #include <geos/linearref/LinearLocation.h>
00028
00029 #include <vector>
00030
00031 namespace geos
00032 {
00033 namespace linearref
00034 {
00035
00042 class LinearGeometryBuilder
00043 {
00044 private:
00045 const geom::GeometryFactory* geomFact;
00046
00047 typedef std::vector<geom::Geometry *> GeomPtrVect;
00048
00049
00050 GeomPtrVect lines;
00051
00052 bool ignoreInvalidLines;
00053 bool fixInvalidLines;
00054 geom::CoordinateSequence* coordList;
00055
00056 geom::Coordinate lastPt;
00057
00058 public:
00059 LinearGeometryBuilder(const geom::GeometryFactory* geomFact);
00060
00061 ~LinearGeometryBuilder();
00062
00070 void setIgnoreInvalidLines(bool ignoreInvalidLines);
00071
00079 void setFixInvalidLines(bool fixInvalidLines);
00080
00086 void add(const geom::Coordinate& pt);
00087
00093 void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
00094
00096 geom::Coordinate getLastCoordinate() const;
00097
00099 void endLine();
00100
00101 geom::Geometry *getGeometry();
00102 };
00103
00104 }
00105 }
00106
00107 #endif