GEOS  3.9.1dev
BufferParameters.h
Go to the documentation of this file.
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
36 namespace geos {
37 namespace geom {
38 class CoordinateSequence;
39 class PrecisionModel;
40 }
41 namespace operation {
42 namespace buffer {
43 class OffsetCurveVertexList;
44 }
45 }
46 }
47 
48 namespace geos {
49 namespace operation { // geos.operation
50 namespace buffer { // geos.operation.buffer
51 
58 
59 public:
60 
62  enum EndCapStyle {
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
212  getJoinStyle() const
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 
296 private:
297 
300 
303 
306 
308  double mitreLimit;
309 
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 
#define GEOS_DLL
Definition: export.h:28
void setSingleSided(bool p_isSingleSided)
double mitreLimit
Defaults to DEFAULT_MITRE_LIMIT;.
void setJoinStyle(JoinStyle style)
Sets the join style for outside (reflex) corners between line segments.
EndCapStyle endCapStyle
Defaults to CAP_ROUND;.
Basic namespace for all GEOS functionalities.
Contains the parameters which describe how a buffer should be constructed.
JoinStyle joinStyle
Defaults to JOIN_ROUND;.
int quadrantSegments
Defaults to DEFAULT_QUADRANT_SEGMENTS;.