00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
00021 #define GEOS_OP_BUFFER_BUFFERPARAMETERS_H
00022
00023
00024
00025
00026
00027
00028
00029
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 {
00044 namespace 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;
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
00255 JoinStyle joinStyle;
00256
00257
00258 double mitreLimit;
00259 };
00260
00261
00262
00263 }
00264 }
00265 }
00266
00267 #endif // ndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
00268