GEOS
3.2.3
|
00001 /********************************************************************** 00002 * $Id: BufferParameters.h 2809 2009-12-06 01:05:24Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2009 Sandro Santilli <strk@keybit.net> 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/BufferParameters.java rev 1.5 (JTS-1.10) 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H 00021 #define GEOS_OP_BUFFER_BUFFERPARAMETERS_H 00022 00023 //#include <vector> 00024 00025 //#include <geos/algorithm/LineIntersector.h> // for composition 00026 //#include <geos/geom/Coordinate.h> // for composition 00027 //#include <geos/geom/LineSegment.h> // for composition 00028 00029 // Forward declarations 00030 namespace geos { 00031 namespace geom { 00032 class CoordinateSequence; 00033 class PrecisionModel; 00034 } 00035 namespace operation { 00036 namespace buffer { 00037 class OffsetCurveVertexList; 00038 } 00039 } 00040 } 00041 00042 namespace geos { 00043 namespace operation { // geos.operation 00044 namespace buffer { // geos.operation.buffer 00045 00051 class BufferParameters 00052 { 00053 00054 public: 00055 00057 enum EndCapStyle { 00058 00060 CAP_ROUND=1, 00061 00063 CAP_FLAT=2, 00064 00066 CAP_SQUARE=3 00067 }; 00068 00070 enum JoinStyle { 00071 00073 JOIN_ROUND=1, 00074 00076 JOIN_MITRE=2, 00077 00079 JOIN_BEVEL=3 00080 }; 00081 00085 // 00090 static const int DEFAULT_QUADRANT_SEGMENTS = 8; 00091 00093 // 00096 static const double DEFAULT_MITRE_LIMIT; // 5.0 (in .cpp file) 00097 00099 BufferParameters() 00100 : 00101 quadrantSegments(DEFAULT_QUADRANT_SEGMENTS), 00102 endCapStyle(CAP_ROUND), 00103 joinStyle(JOIN_ROUND), 00104 mitreLimit(DEFAULT_MITRE_LIMIT) 00105 {} 00106 00108 // 00111 BufferParameters(int quadrantSegments); 00112 00116 // 00120 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle); 00121 00125 // 00131 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle, 00132 JoinStyle joinStyle, double mitreLimit); 00133 00135 // 00138 int getQuadrantSegments() const { return quadrantSegments; } 00139 00143 // 00169 void setQuadrantSegments(int quadSegs); 00170 00174 // 00179 static double bufferDistanceError(int quadSegs); 00180 00182 // 00185 EndCapStyle getEndCapStyle() const { return endCapStyle; } 00186 00188 // 00196 void setEndCapStyle(EndCapStyle style) 00197 { 00198 endCapStyle = style; 00199 } 00200 00202 // 00205 JoinStyle getJoinStyle() const { return joinStyle; } 00206 00210 // 00213 // 00216 void setJoinStyle(JoinStyle style) 00217 { 00218 joinStyle = style; 00219 } 00220 00222 // 00225 double getMitreLimit() const { return mitreLimit; } 00226 00228 // 00240 void setMitreLimit(double limit) 00241 { 00242 mitreLimit = limit; 00243 } 00244 00245 00246 private: 00247 00249 int quadrantSegments; 00250 00252 EndCapStyle endCapStyle; 00253 00254 // Defaults to JOIN_ROUND; 00255 JoinStyle joinStyle; 00256 00257 // Defaults to DEFAULT_MITRE_LIMIT; 00258 double mitreLimit; 00259 }; 00260 00261 00262 00263 } // namespace geos::operation::buffer 00264 } // namespace geos::operation 00265 } // namespace geos 00266 00267 #endif // ndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H 00268