GEOS 3.9.1
BufferParameters.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2009 Sandro Santilli <strk@kbt.io>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: operation/buffer/BufferParameters.java r378 (JTS-1.12)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
20#define GEOS_OP_BUFFER_BUFFERPARAMETERS_H
21
22#include <geos/export.h>
23
24//#include <vector>
25
26//#include <geos/algorithm/LineIntersector.h> // for composition
27//#include <geos/geom/Coordinate.h> // for composition
28//#include <geos/geom/LineSegment.h> // for composition
29
30#ifdef _MSC_VER
31#pragma warning(push)
32#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
33#endif
34
35// Forward declarations
36namespace geos {
37namespace geom {
38class CoordinateSequence;
39class PrecisionModel;
40}
41namespace operation {
42namespace buffer {
43class OffsetCurveVertexList;
44}
45}
46}
47
48namespace geos {
49namespace operation { // geos.operation
50namespace buffer { // geos.operation.buffer
51
57class GEOS_DLL BufferParameters {
58
59public:
60
63
65 CAP_ROUND = 1,
66
68 CAP_FLAT = 2,
69
71 CAP_SQUARE = 3
72 };
73
75 enum JoinStyle {
76
78 JOIN_ROUND = 1,
79
81 JOIN_MITRE = 2,
82
84 JOIN_BEVEL = 3
85 };
86
95 static const int DEFAULT_QUADRANT_SEGMENTS = 8;
96
101 static const double DEFAULT_MITRE_LIMIT; // 5.0 (in .cpp file)
102
105
110 BufferParameters(int quadrantSegments);
111
119 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle);
120
130 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle,
131 JoinStyle joinStyle, double mitreLimit);
132
137 int
139 {
140 return quadrantSegments;
141 }
142
170 void setQuadrantSegments(int quadSegs);
171
180 static double bufferDistanceError(int quadSegs);
181
188 {
189 return endCapStyle;
190 }
191
201 void
203 {
204 endCapStyle = style;
205 }
206
211 JoinStyle
213 {
214 return joinStyle;
215 }
216
226 void
228 {
229 joinStyle = style;
230 }
231
236 double
238 {
239 return mitreLimit;
240 }
241
255 void
256 setMitreLimit(double limit)
257 {
258 mitreLimit = limit;
259 }
260
278 void
279 setSingleSided(bool p_isSingleSided)
280 {
281 _isSingleSided = p_isSingleSided;
282 }
283
289 bool
291 {
292 return _isSingleSided;
293 }
294
295
296private:
297
299 int quadrantSegments;
300
302 EndCapStyle endCapStyle;
303
305 JoinStyle joinStyle;
306
308 double mitreLimit;
309
310 bool _isSingleSided;
311};
312
313} // namespace geos::operation::buffer
314} // namespace geos::operation
315} // namespace geos
316
317#ifdef _MSC_VER
318#pragma warning(pop)
319#endif
320
321#endif // ndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
322
Contains the parameters which describe how a buffer should be constructed.
Definition BufferParameters.h:57
double getMitreLimit() const
Definition BufferParameters.h:237
void setEndCapStyle(EndCapStyle style)
Definition BufferParameters.h:202
void setMitreLimit(double limit)
Definition BufferParameters.h:256
JoinStyle getJoinStyle() const
Definition BufferParameters.h:212
EndCapStyle getEndCapStyle() const
Definition BufferParameters.h:187
EndCapStyle
End cap styles.
Definition BufferParameters.h:62
static const double DEFAULT_MITRE_LIMIT
Definition BufferParameters.h:101
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit)
Creates a set of parameters with the given parameter values.
void setJoinStyle(JoinStyle style)
Sets the join style for outside (reflex) corners between line segments.
Definition BufferParameters.h:227
static double bufferDistanceError(int quadSegs)
Computes the maximum distance error due to a given level of approximation to a true arc.
bool isSingleSided() const
Definition BufferParameters.h:290
BufferParameters()
Creates a default set of parameters.
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle)
Creates a set of parameters with the given quadrantSegments and endCapStyle values.
int getQuadrantSegments() const
Definition BufferParameters.h:138
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet.
void setSingleSided(bool p_isSingleSided)
Definition BufferParameters.h:279
JoinStyle
Join styles.
Definition BufferParameters.h:75
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26