GEOS 3.2.1
|
00001 /********************************************************************** 00002 * $Id: OffsetCurveSetBuilder.h 2779 2009-12-03 19:45:53Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 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 rev. 1.11 (JTS-1.10) 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 // Forward declarations 00028 namespace geos { 00029 namespace geom { 00030 class Geometry; 00031 class CoordinateSequence; 00032 class GeometryCollection; 00033 class Point; 00034 class LineString; 00035 class Polygon; 00036 } 00037 namespace geomgraph { 00038 class Label; 00039 } 00040 namespace noding { 00041 class SegmentString; 00042 } 00043 namespace operation { 00044 namespace buffer { 00045 class OffsetCurveBuilder; 00046 } 00047 } 00048 } 00049 00050 namespace geos { 00051 namespace operation { // geos.operation 00052 namespace buffer { // geos.operation.buffer 00053 00064 class GEOS_DLL OffsetCurveSetBuilder { 00065 00066 private: 00067 00068 // To keep track of newly-created Labels. 00069 // Labels will be relesed by object dtor 00070 std::vector<geomgraph::Label*> newLabels; 00071 00072 const geom::Geometry& inputGeom; 00073 00074 double distance; 00075 00076 OffsetCurveBuilder& curveBuilder; 00077 00081 std::vector<noding::SegmentString*> curveList; 00082 00095 void addCurve(geom::CoordinateSequence *coord, int leftLoc, 00096 int rightLoc); 00097 00098 void add(const geom::Geometry& g); 00099 00100 void addCollection(const geom::GeometryCollection *gc); 00101 00105 void addPoint(const geom::Point *p); 00106 00107 void addLineString(const geom::LineString *line); 00108 00109 void addPolygon(const geom::Polygon *p); 00110 00129 void addPolygonRing(const geom::CoordinateSequence *coord, 00130 double offsetDistance, int side, int cwLeftLoc, 00131 int cwRightLoc); 00132 00142 bool isErodedCompletely(geom::CoordinateSequence *ringCoord, 00143 double bufferDistance); 00144 00163 bool isTriangleErodedCompletely(geom::CoordinateSequence *triangleCoord, 00164 double bufferDistance); 00165 00166 // Declare type as noncopyable 00167 OffsetCurveSetBuilder(const OffsetCurveSetBuilder& other); 00168 OffsetCurveSetBuilder& operator=(const OffsetCurveSetBuilder& rhs); 00169 00170 public: 00171 00173 OffsetCurveSetBuilder(const geom::Geometry& newInputGeom, 00174 double newDistance, OffsetCurveBuilder& newCurveBuilder); 00175 00177 ~OffsetCurveSetBuilder(); 00178 00188 std::vector<noding::SegmentString*>& getCurves(); 00189 00191 // 00195 void addCurves(const std::vector<geom::CoordinateSequence*>& lineList, 00196 int leftLoc, int rightLoc); 00197 00198 }; 00199 00200 00201 00202 } // namespace geos::operation::buffer 00203 } // namespace geos::operation 00204 } // namespace geos 00205 00206 #endif // ndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H 00207 00208 /********************************************************************** 00209 * $Log$ 00210 * Revision 1.2 2006/05/04 10:15:20 strk 00211 * Doxygen comments 00212 * 00213 * Revision 1.1 2006/03/14 00:19:40 strk 00214 * opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/ 00215 * 00216 **********************************************************************/ 00217