GEOS 3.6.2
BufferParameters.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2009 Sandro Santilli <strk@keybit.net>
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 {
37 namespace geom {
39 class PrecisionModel;
40 }
41 namespace operation {
42 namespace buffer {
43 class OffsetCurveVertexList;
44 }
45 }
46}
47
48namespace geos {
49namespace operation { // geos.operation
50namespace buffer { // geos.operation.buffer
51
57class GEOS_DLL BufferParameters
58{
59
60public:
61
64
67
70
73 };
74
76 enum JoinStyle {
77
80
83
86 };
87
91 //
96 static const int DEFAULT_QUADRANT_SEGMENTS = 8;
97
99 //
102 static const double DEFAULT_MITRE_LIMIT; // 5.0 (in .cpp file)
103
106
108 //
111 BufferParameters(int quadrantSegments);
112
116 //
120 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle);
121
125 //
131 BufferParameters(int quadrantSegments, EndCapStyle endCapStyle,
132 JoinStyle joinStyle, double mitreLimit);
133
135 //
138 int getQuadrantSegments() const { return quadrantSegments; }
139
143 //
169 void setQuadrantSegments(int quadSegs);
170
174 //
179 static double bufferDistanceError(int quadSegs);
180
182 //
185 EndCapStyle getEndCapStyle() const { return endCapStyle; }
186
188 //
197 {
198 endCapStyle = style;
199 }
200
202 //
205 JoinStyle getJoinStyle() const { return joinStyle; }
206
210 //
213 //
217 {
218 joinStyle = style;
219 }
220
222 //
225 double getMitreLimit() const { return mitreLimit; }
226
228 //
240 void setMitreLimit(double limit)
241 {
242 mitreLimit = limit;
243 }
244
263 {
264 _isSingleSided = isSingleSided;
265 }
266
272 bool isSingleSided() const {
273 return _isSingleSided;
274 }
275
276
277private:
278
280 int quadrantSegments;
281
283 EndCapStyle endCapStyle;
284
286 JoinStyle joinStyle;
287
289 double mitreLimit;
290
291 bool _isSingleSided;
292};
293
294} // namespace geos::operation::buffer
295} // namespace geos::operation
296} // namespace geos
297
298#ifdef _MSC_VER
299#pragma warning(pop)
300#endif
301
302#endif // ndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
303
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
double getMitreLimit() const
Gets the mitre ratio limit.
Definition BufferParameters.h:225
void setEndCapStyle(EndCapStyle style)
Specifies the end cap style of the generated buffer.
Definition BufferParameters.h:196
void setMitreLimit(double limit)
Sets the limit on the mitre ratio used for very sharp corners.
Definition BufferParameters.h:240
JoinStyle getJoinStyle() const
Gets the join style.
Definition BufferParameters.h:205
BufferParameters(int quadrantSegments)
Creates a set of parameters with the given quadrantSegments value.
EndCapStyle getEndCapStyle() const
Gets the end cap style.
Definition BufferParameters.h:185
EndCapStyle
End cap styles.
Definition BufferParameters.h:63
@ CAP_SQUARE
Specifies a square line buffer end cap style.
Definition BufferParameters.h:72
@ CAP_ROUND
Specifies a round line buffer end cap style.
Definition BufferParameters.h:66
@ CAP_FLAT
Specifies a flat line buffer end cap style.
Definition BufferParameters.h:69
static const double DEFAULT_MITRE_LIMIT
The default mitre limit.
Definition BufferParameters.h:102
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:216
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:96
bool isSingleSided() const
Definition BufferParameters.h:272
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
Gets the number of quadrant segments which will be used.
Definition BufferParameters.h:138
void setSingleSided(bool isSingleSided)
Definition BufferParameters.h:262
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet.
JoinStyle
Join styles.
Definition BufferParameters.h:76
@ JOIN_MITRE
Specifies a mitre join style.
Definition BufferParameters.h:82
@ JOIN_ROUND
Specifies a round join style.
Definition BufferParameters.h:79
@ JOIN_BEVEL
Specifies a bevel join style.
Definition BufferParameters.h:85
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Provides classes for computing buffers of geometries.
Definition opBuffer.h:23
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25