#include <BufferParameters.h>
Public Types | |
enum | EndCapStyle { CAP_ROUND = 1, CAP_FLAT = 2, CAP_SQUARE = 3 } |
End cap styles. More... | |
enum | JoinStyle { JOIN_ROUND = 1, JOIN_MITRE = 2, JOIN_BEVEL = 3 } |
Join styles. More... | |
Public Member Functions | |
BufferParameters () | |
Creates a default set of parameters. | |
BufferParameters (int quadrantSegments) | |
Creates a set of parameters with the given quadrantSegments value. | |
BufferParameters (int quadrantSegments, EndCapStyle endCapStyle) | |
Creates a set of parameters with the given quadrantSegments and endCapStyle values. | |
BufferParameters (int quadrantSegments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit) | |
Creates a set of parameters with the given parameter values. | |
int | getQuadrantSegments () const |
Gets the number of quadrant segments which will be used. | |
void | setQuadrantSegments (int quadSegs) |
Sets the number of line segments used to approximate an angle fillet. | |
EndCapStyle | getEndCapStyle () const |
Gets the end cap style. | |
void | setEndCapStyle (EndCapStyle style) |
Specifies the end cap style of the generated buffer. | |
JoinStyle | getJoinStyle () const |
Gets the join style. | |
void | setJoinStyle (JoinStyle style) |
Sets the join style for outside (reflex) corners between line segments. | |
double | getMitreLimit () const |
Gets the mitre ratio limit. | |
void | setMitreLimit (double limit) |
Sets the limit on the mitre ratio used for very sharp corners. | |
void | setSingleSided (bool isSingleSided) |
bool | isSingleSided () const |
Static Public Member Functions | |
double | bufferDistanceError (int quadSegs) |
Computes the maximum distance error due to a given level of approximation to a true arc. | |
Static Public Attributes | |
const int | DEFAULT_QUADRANT_SEGMENTS = 8 |
The default number of facets into which to divide a fillet of 90 degrees. | |
const double | DEFAULT_MITRE_LIMIT |
The default mitre limit. |
|
End cap styles.
|
|
Join styles.
|
|
Creates a set of parameters with the given quadrantSegments value.
|
|
Creates a set of parameters with the given quadrantSegments and endCapStyle values.
|
|
Creates a set of parameters with the given parameter values.
|
|
Computes the maximum distance error due to a given level of approximation to a true arc.
|
|
Gets the end cap style.
|
|
Gets the join style.
|
|
Gets the mitre ratio limit.
|
|
Gets the number of quadrant segments which will be used.
|
|
Tests whether the buffer is to be generated on a single side only.
|
|
Specifies the end cap style of the generated buffer. The styles supported are CAP_ROUND, CAP_BUTT, and CAP_SQUARE. The default is CAP_ROUND.
|
|
Sets the join style for outside (reflex) corners between line segments.
|
|
Sets the limit on the mitre ratio used for very sharp corners. The mitre ratio is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend far beyond the original geometry. (and in the extreme case will be infinitely far.) To prevent unreasonable geometry, the mitre limit allows controlling the maximum length of the join corner. Corners with a ratio which exceed the limit will be beveled.
|
|
Sets the number of line segments used to approximate an angle fillet.
For round joins, The default value of 8 gives less than 2% max error in the buffer distance. For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18. The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve).
|
|
Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line. The side used is determined by the sign of the buffer distance:
The single-sided buffer of point geometries is the same as the regular buffer.
The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of
|
|
The default mitre limit. Allows fairly pointy mitres. |
|
The default number of facets into which to divide a fillet of 90 degrees. A value of 8 gives less than 2% max error in the buffer distance. For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18. |