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