GEOS 3.13.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#pragma once
20
21#include <geos/export.h>
22
23//#include <vector>
24
25//#include <geos/algorithm/LineIntersector.h> // for composition
26//#include <geos/geom/Coordinate.h> // for composition
27//#include <geos/geom/LineSegment.h> // for composition
28
29#ifdef _MSC_VER
30#pragma warning(push)
31#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
32#endif
33
34// Forward declarations
35namespace geos {
36namespace geom {
38class PrecisionModel;
39}
40namespace operation {
41namespace buffer {
42class OffsetCurveVertexList;
43}
44}
45}
46
47namespace geos {
48namespace operation { // geos.operation
49namespace buffer { // geos.operation.buffer
50
56class GEOS_DLL BufferParameters {
57
58public:
59
62
65
68
71 };
72
74 enum JoinStyle {
75
78
81
84 };
85
94 static const int DEFAULT_QUADRANT_SEGMENTS = 8;
95
100 static const double DEFAULT_MITRE_LIMIT; // 5.0 (in .cpp file)
101
104
109 BufferParameters(int quadrantSegments);
110
118 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle);
119
129 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle,
130 JoinStyle joinStyle, double mitreLimit);
131
136 int
138 {
139 return quadrantSegments;
140 }
141
169 void setQuadrantSegments(int quadSegs);
170
179 static double bufferDistanceError(int quadSegs);
180
187 {
188 return endCapStyle;
189 }
190
200 void
202 {
203 endCapStyle = style;
204 }
205
210 JoinStyle
212 {
213 return joinStyle;
214 }
215
225 void
227 {
228 joinStyle = style;
229 }
230
235 double
237 {
238 return mitreLimit;
239 }
240
254 void
255 setMitreLimit(double limit)
256 {
257 mitreLimit = limit;
258 }
259
277 void
278 setSingleSided(bool p_isSingleSided)
279 {
280 _isSingleSided = p_isSingleSided;
281 }
282
288 bool
290 {
291 return _isSingleSided;
292 }
293
294
295private:
296
298 int quadrantSegments;
299
301 EndCapStyle endCapStyle;
302
304 JoinStyle joinStyle;
305
307 double mitreLimit;
308
309 bool _isSingleSided;
310};
311
312} // namespace geos::operation::buffer
313} // namespace geos::operation
314} // namespace geos
315
316#ifdef _MSC_VER
317#pragma warning(pop)
318#endif
319
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:88
double getMitreLimit() const
Definition BufferParameters.h:236
void setEndCapStyle(EndCapStyle style)
Definition BufferParameters.h:201
void setMitreLimit(double limit)
Definition BufferParameters.h:255
JoinStyle getJoinStyle() const
Definition BufferParameters.h:211
EndCapStyle getEndCapStyle() const
Definition BufferParameters.h:186
EndCapStyle
End cap styles.
Definition BufferParameters.h:61
@ CAP_SQUARE
Specifies a square line buffer end cap style.
Definition BufferParameters.h:70
@ CAP_ROUND
Specifies a round line buffer end cap style.
Definition BufferParameters.h:64
@ CAP_FLAT
Specifies a flat line buffer end cap style.
Definition BufferParameters.h:67
static const double DEFAULT_MITRE_LIMIT
Definition BufferParameters.h:100
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:226
static double bufferDistanceError(int quadSegs)
Computes the maximum distance error due to a given level of approximation to a true arc.
static const int DEFAULT_QUADRANT_SEGMENTS
The default number of facets into which to divide a fillet of 90 degrees.
Definition BufferParameters.h:94
bool isSingleSided() const
Definition BufferParameters.h:289
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:137
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet.
void setSingleSided(bool p_isSingleSided)
Definition BufferParameters.h:278
JoinStyle
Join styles.
Definition BufferParameters.h:74
@ JOIN_MITRE
Specifies a mitre join style.
Definition BufferParameters.h:80
@ JOIN_ROUND
Specifies a round join style.
Definition BufferParameters.h:77
@ JOIN_BEVEL
Specifies a bevel join style.
Definition BufferParameters.h:83
Definition Angle.h:26
Provides classes for computing buffers of geometries.
Definition namespaces.h:182
Provides classes for implementing operations on geometries.
Definition namespaces.h:179
Basic namespace for all GEOS functionalities.
Definition geos.h:39