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 #include <geos/export.h>
00024
00025
00026
00027
00028
00029
00030
00031 #ifdef _MSC_VER
00032 #pragma warning(push)
00033 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00034 #endif
00035
00036
00037 namespace geos {
00038 namespace geom {
00039 class CoordinateSequence;
00040 class PrecisionModel;
00041 }
00042 namespace operation {
00043 namespace buffer {
00044 class OffsetCurveVertexList;
00045 }
00046 }
00047 }
00048
00049 namespace geos {
00050 namespace operation {
00051 namespace buffer {
00052
00058 class GEOS_DLL BufferParameters
00059 {
00060
00061 public:
00062
00064 enum EndCapStyle {
00065
00067 CAP_ROUND=1,
00068
00070 CAP_FLAT=2,
00071
00073 CAP_SQUARE=3
00074 };
00075
00077 enum JoinStyle {
00078
00080 JOIN_ROUND=1,
00081
00083 JOIN_MITRE=2,
00084
00086 JOIN_BEVEL=3
00087 };
00088
00092
00097 static const int DEFAULT_QUADRANT_SEGMENTS = 8;
00098
00100
00103 static const double DEFAULT_MITRE_LIMIT;
00104
00106 BufferParameters();
00107
00109
00112 BufferParameters(int quadrantSegments);
00113
00117
00121 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle);
00122
00126
00132 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle,
00133 JoinStyle joinStyle, double mitreLimit);
00134
00136
00139 int getQuadrantSegments() const { return quadrantSegments; }
00140
00144
00170 void setQuadrantSegments(int quadSegs);
00171
00175
00180 static double bufferDistanceError(int quadSegs);
00181
00183
00186 EndCapStyle getEndCapStyle() const { return endCapStyle; }
00187
00189
00197 void setEndCapStyle(EndCapStyle style)
00198 {
00199 endCapStyle = style;
00200 }
00201
00203
00206 JoinStyle getJoinStyle() const { return joinStyle; }
00207
00211
00214
00217 void setJoinStyle(JoinStyle style)
00218 {
00219 joinStyle = style;
00220 }
00221
00223
00226 double getMitreLimit() const { return mitreLimit; }
00227
00229
00241 void setMitreLimit(double limit)
00242 {
00243 mitreLimit = limit;
00244 }
00245
00263 void setSingleSided(bool isSingleSided)
00264 {
00265 _isSingleSided = isSingleSided;
00266 }
00267
00273 bool isSingleSided() const {
00274 return _isSingleSided;
00275 }
00276
00277
00278 private:
00279
00281 int quadrantSegments;
00282
00284 EndCapStyle endCapStyle;
00285
00287 JoinStyle joinStyle;
00288
00290 double mitreLimit;
00291
00292 bool _isSingleSided;
00293 };
00294
00295 }
00296 }
00297 }
00298
00299 #ifdef _MSC_VER
00300 #pragma warning(pop)
00301 #endif
00302
00303 #endif // ndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
00304