GEOS
3.4.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net> 00007 * Copyright (C) 2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 ********************************************************************** 00015 * 00016 * Last port: operation/buffer/OffsetCurveSetBuilder.java r378 (JTS-1.12) 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H 00021 #define GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H 00022 00023 #include <geos/export.h> 00024 00025 #include <vector> 00026 00027 #ifdef _MSC_VER 00028 #pragma warning(push) 00029 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00030 #endif 00031 00032 // Forward declarations 00033 namespace geos { 00034 namespace geom { 00035 class Geometry; 00036 class CoordinateSequence; 00037 class GeometryCollection; 00038 class Point; 00039 class LineString; 00040 class LinearRing; 00041 class Polygon; 00042 } 00043 namespace geomgraph { 00044 class Label; 00045 } 00046 namespace noding { 00047 class SegmentString; 00048 } 00049 namespace operation { 00050 namespace buffer { 00051 class OffsetCurveBuilder; 00052 } 00053 } 00054 } 00055 00056 namespace geos { 00057 namespace operation { // geos.operation 00058 namespace buffer { // geos.operation.buffer 00059 00070 class GEOS_DLL OffsetCurveSetBuilder { 00071 00072 private: 00073 00074 // To keep track of newly-created Labels. 00075 // Labels will be relesed by object dtor 00076 std::vector<geomgraph::Label*> newLabels; 00077 00078 const geom::Geometry& inputGeom; 00079 00080 double distance; 00081 00082 OffsetCurveBuilder& curveBuilder; 00083 00087 std::vector<noding::SegmentString*> curveList; 00088 00101 void addCurve(geom::CoordinateSequence *coord, int leftLoc, 00102 int rightLoc); 00103 00104 void add(const geom::Geometry& g); 00105 00106 void addCollection(const geom::GeometryCollection *gc); 00107 00111 void addPoint(const geom::Point *p); 00112 00113 void addLineString(const geom::LineString *line); 00114 00115 void addPolygon(const geom::Polygon *p); 00116 00135 void addPolygonRing(const geom::CoordinateSequence *coord, 00136 double offsetDistance, int side, int cwLeftLoc, 00137 int cwRightLoc); 00138 00148 bool isErodedCompletely(const geom::LinearRing* ringCoord, 00149 double bufferDistance); 00150 00169 bool isTriangleErodedCompletely(const geom::CoordinateSequence *triCoords, 00170 double bufferDistance); 00171 00172 // Declare type as noncopyable 00173 OffsetCurveSetBuilder(const OffsetCurveSetBuilder& other); 00174 OffsetCurveSetBuilder& operator=(const OffsetCurveSetBuilder& rhs); 00175 00176 public: 00177 00179 OffsetCurveSetBuilder(const geom::Geometry& newInputGeom, 00180 double newDistance, OffsetCurveBuilder& newCurveBuilder); 00181 00183 ~OffsetCurveSetBuilder(); 00184 00194 std::vector<noding::SegmentString*>& getCurves(); 00195 00197 // 00201 void addCurves(const std::vector<geom::CoordinateSequence*>& lineList, 00202 int leftLoc, int rightLoc); 00203 00204 }; 00205 00206 } // namespace geos::operation::buffer 00207 } // namespace geos::operation 00208 } // namespace geos 00209 00210 #ifdef _MSC_VER 00211 #pragma warning(pop) 00212 #endif 00213 00214 #endif // ndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H 00215