geos::operation::buffer::BufferParameters Class Reference

Contains the parameters which describe how a buffer should be constructed. More...

#include <BufferParameters.h>

List of all members.

Public Types

 CAP_ROUND = 1
 Specifies a round line buffer end cap style.
 CAP_FLAT = 2
 Specifies a flat line buffer end cap style.
 CAP_SQUARE = 3
 Specifies a square line buffer end cap style.
 JOIN_ROUND = 1
 Specifies a round join style.
 JOIN_MITRE = 2
 Specifies a mitre join style.
 JOIN_BEVEL = 3
 Specifies a bevel join style.
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

static double bufferDistanceError (int quadSegs)
 Computes the maximum distance error due to a given level of approximation to a true arc.

Static Public Attributes

static const int DEFAULT_QUADRANT_SEGMENTS = 8
 The default number of facets into which to divide a fillet of 90 degrees.
static const double DEFAULT_MITRE_LIMIT
 The default mitre limit.


Detailed Description

Contains the parameters which describe how a buffer should be constructed.


Member Enumeration Documentation

enum geos::operation::buffer::BufferParameters::EndCapStyle

End cap styles.

Enumerator:
CAP_ROUND  Specifies a round line buffer end cap style.
CAP_FLAT  Specifies a flat line buffer end cap style.
CAP_SQUARE  Specifies a square line buffer end cap style.

enum geos::operation::buffer::BufferParameters::JoinStyle

Join styles.

Enumerator:
JOIN_ROUND  Specifies a round join style.
JOIN_MITRE  Specifies a mitre join style.
JOIN_BEVEL  Specifies a bevel join style.


Constructor & Destructor Documentation

geos::operation::buffer::BufferParameters::BufferParameters ( int  quadrantSegments  ) 

Creates a set of parameters with the given quadrantSegments value.

Parameters:
quadrantSegments the number of quadrant segments to use

geos::operation::buffer::BufferParameters::BufferParameters ( int  quadrantSegments,
EndCapStyle  endCapStyle 
)

Creates a set of parameters with the given quadrantSegments and endCapStyle values.

Parameters:
quadrantSegments the number of quadrant segments to use
endCapStyle the end cap style to use

geos::operation::buffer::BufferParameters::BufferParameters ( int  quadrantSegments,
EndCapStyle  endCapStyle,
JoinStyle  joinStyle,
double  mitreLimit 
)

Creates a set of parameters with the given parameter values.

Parameters:
quadrantSegments the number of quadrant segments to use
endCapStyle the end cap style to use
joinStyle the join style to use
mitreLimit the mitre limit to use


Member Function Documentation

static double geos::operation::buffer::BufferParameters::bufferDistanceError ( int  quadSegs  )  [static]

Computes the maximum distance error due to a given level of approximation to a true arc.

Parameters:
quadSegs the number of segments used to approximate a quarter-circle
Returns:
the error of approximation

EndCapStyle geos::operation::buffer::BufferParameters::getEndCapStyle (  )  const [inline]

Gets the end cap style.

Returns:
the end cap style

JoinStyle geos::operation::buffer::BufferParameters::getJoinStyle (  )  const [inline]

Gets the join style.

Returns:
the join style

double geos::operation::buffer::BufferParameters::getMitreLimit (  )  const [inline]

Gets the mitre ratio limit.

Returns:
the limit value

int geos::operation::buffer::BufferParameters::getQuadrantSegments (  )  const [inline]

Gets the number of quadrant segments which will be used.

Returns:
the number of quadrant segments

bool geos::operation::buffer::BufferParameters::isSingleSided (  )  const [inline]

Tests whether the buffer is to be generated on a single side only.

Returns:
true if the generated buffer is to be single-sided

void geos::operation::buffer::BufferParameters::setEndCapStyle ( EndCapStyle  style  )  [inline]

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.

Parameters:
style the end cap style to specify

void geos::operation::buffer::BufferParameters::setJoinStyle ( JoinStyle  style  )  [inline]

Sets the join style for outside (reflex) corners between line segments.

Parameters:
style the code for the join style

void geos::operation::buffer::BufferParameters::setMitreLimit ( double  limit  )  [inline]

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.

Parameters:
limit the mitre ratio limit

void geos::operation::buffer::BufferParameters::setQuadrantSegments ( int  quadSegs  ) 

Sets the number of line segments used to approximate an angle fillet.

For round joins, quadSegs determines the maximum error in the approximation to the true buffer curve.

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).

Parameters:
quadrantSegments the number of segments in a fillet for a quadrant

void geos::operation::buffer::BufferParameters::setSingleSided ( bool  isSingleSided  )  [inline]

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 CAP_FLAT.

Parameters:
isSingleSided true if a single-sided buffer should be constructed


Member Data Documentation

const double geos::operation::buffer::BufferParameters::DEFAULT_MITRE_LIMIT [static]

The default mitre limit.

Allows fairly pointy mitres.

const int geos::operation::buffer::BufferParameters::DEFAULT_QUADRANT_SEGMENTS = 8 [static]

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.


The documentation for this class was generated from the following file:
Generated on 14 Mar 2013 for GEOS by  doxygen 1.4.7