00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
00017 #define GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
00018
00019 #include <vector>
00020
00021
00022 namespace geos {
00023 namespace geom {
00024 class Geometry;
00025 class CoordinateSequence;
00026 class GeometryCollection;
00027 class Point;
00028 class LineString;
00029 class Polygon;
00030 }
00031 namespace geomgraph {
00032 class Label;
00033 }
00034 namespace noding {
00035 class SegmentString;
00036 }
00037 namespace operation {
00038 namespace buffer {
00039 class OffsetCurveBuilder;
00040 }
00041 }
00042 }
00043
00044 namespace geos {
00045 namespace operation {
00046 namespace buffer {
00047
00060 class OffsetCurveSetBuilder {
00061
00062 private:
00063
00064
00065
00066 std::vector<geomgraph::Label*> newLabels;
00067
00068 const geom::Geometry& inputGeom;
00069
00070 double distance;
00071
00072 OffsetCurveBuilder& curveBuilder;
00073
00077 std::vector<noding::SegmentString*> curveList;
00078
00089 void addCurve(geom::CoordinateSequence *coord, int leftLoc,
00090 int rightLoc);
00091
00092 void add(const geom::Geometry& g);
00093
00094 void addCollection(const geom::GeometryCollection *gc);
00095
00099 void addPoint(const geom::Point *p);
00100
00101 void addLineString(const geom::LineString *line);
00102
00103 void addPolygon(const geom::Polygon *p);
00104
00123 void addPolygonRing(const geom::CoordinateSequence *coord,
00124 double offsetDistance, int side, int cwLeftLoc,
00125 int cwRightLoc);
00126
00136 bool isErodedCompletely(geom::CoordinateSequence *ringCoord,
00137 double bufferDistance);
00138
00157 bool isTriangleErodedCompletely(geom::CoordinateSequence *triangleCoord,
00158 double bufferDistance);
00159
00160 public:
00161
00163 OffsetCurveSetBuilder(const geom::Geometry& newInputGeom,
00164 double newDistance, OffsetCurveBuilder& newCurveBuilder);
00165
00167 ~OffsetCurveSetBuilder();
00168
00178 std::vector<noding::SegmentString*>& getCurves();
00179
00181 void addCurves(const std::vector<geom::CoordinateSequence*>& lineList,
00182 int leftLoc, int rightLoc);
00183
00184 };
00185
00186
00187
00188 }
00189 }
00190 }
00191
00192 #endif // ndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203