public class BufferParameters
extends java.lang.Object
The parameters allow control over:
Modifier and Type | Field | Description |
---|---|---|
static int |
CAP_FLAT |
Specifies a flat line buffer end cap style.
|
static int |
CAP_ROUND |
Specifies a round line buffer end cap style.
|
static int |
CAP_SQUARE |
Specifies a square line buffer end cap style.
|
static double |
DEFAULT_MITRE_LIMIT |
The default mitre limit
Allows fairly pointy mitres.
|
static int |
DEFAULT_QUADRANT_SEGMENTS |
The default number of facets into which to divide a fillet of 90 degrees.
|
static double |
DEFAULT_SIMPLIFY_FACTOR |
The default simplify factor
Provides an accuracy of about 1%, which matches the accuracy of the default Quadrant Segments parameter.
|
static int |
JOIN_BEVEL |
Specifies a bevel join style.
|
static int |
JOIN_MITRE |
Specifies a mitre join style.
|
static int |
JOIN_ROUND |
Specifies a round join style.
|
Constructor | Description |
---|---|
BufferParameters() |
Creates a default set of parameters
|
BufferParameters(int quadrantSegments) |
Creates a set of parameters with the
given quadrantSegments value.
|
BufferParameters(int quadrantSegments,
int endCapStyle) |
Creates a set of parameters with the
given quadrantSegments and endCapStyle values.
|
BufferParameters(int quadrantSegments,
int endCapStyle,
int joinStyle,
double mitreLimit) |
Creates a set of parameters with the
given parameter values.
|
Modifier and Type | Method | Description |
---|---|---|
static double |
bufferDistanceError(int quadSegs) |
Computes the maximum distance error due to a given level
of approximation to a true arc.
|
int |
getEndCapStyle() |
Gets the end cap style.
|
int |
getJoinStyle() |
Gets the join style
|
double |
getMitreLimit() |
Gets the mitre ratio limit.
|
int |
getQuadrantSegments() |
Gets the number of quadrant segments which will be used
|
double |
getSimplifyFactor() |
Gets the simplify factor.
|
boolean |
isSingleSided() |
Tests whether the buffer is to be generated on a single side only.
|
void |
setEndCapStyle(int endCapStyle) |
Specifies the end cap style of the generated buffer.
|
void |
setJoinStyle(int joinStyle) |
Sets the join style for outside (reflex) corners between line segments.
|
void |
setMitreLimit(double mitreLimit) |
Sets the limit on the mitre ratio used for very sharp corners.
|
void |
setQuadrantSegments(int quadSegs) |
Sets the number of line segments used to approximate an angle fillet.
|
void |
setSimplifyFactor(double simplifyFactor) |
Sets the factor used to determine the simplify distance tolerance
for input simplification.
|
void |
setSingleSided(boolean isSingleSided) |
Sets whether the computed buffer should be single-sided.
|
public static final int CAP_ROUND
public static final int CAP_FLAT
public static final int CAP_SQUARE
public static final int JOIN_ROUND
public static final int JOIN_MITRE
public static final int JOIN_BEVEL
public static final int DEFAULT_QUADRANT_SEGMENTS
public static final double DEFAULT_MITRE_LIMIT
public static final double DEFAULT_SIMPLIFY_FACTOR
public BufferParameters()
public BufferParameters(int quadrantSegments)
quadrantSegments
- the number of quadrant segments to usepublic BufferParameters(int quadrantSegments, int endCapStyle)
quadrantSegments
- the number of quadrant segments to useendCapStyle
- the end cap style to usepublic BufferParameters(int quadrantSegments, int endCapStyle, int joinStyle, double mitreLimit)
quadrantSegments
- the number of quadrant segments to useendCapStyle
- the end cap style to usejoinStyle
- the join style to usemitreLimit
- the mitre limit to usepublic int getQuadrantSegments()
public void setQuadrantSegments(int quadSegs)
mitreLimit = |quadSegs|
quadSegs
- the number of segments in a fillet for a quadrantpublic static double bufferDistanceError(int quadSegs)
quadSegs
- the number of segments used to approximate a quarter-circlepublic int getEndCapStyle()
public void setEndCapStyle(int endCapStyle)
CAP_ROUND
, CAP_FLAT
, and CAP_SQUARE
.
The default is CAP_ROUND.endCapStyle
- the end cap style to specifypublic int getJoinStyle()
public void setJoinStyle(int joinStyle)
JOIN_ROUND
(which is the default),
JOIN_MITRE
and {link JOIN_BEVEL}.joinStyle
- the code for the join stylepublic double getMitreLimit()
public void setMitreLimit(double mitreLimit)
mitreLimit
- the mitre ratio limitpublic void setSingleSided(boolean isSingleSided)
The side used is determined by the sign of the buffer distance:
The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of CAP_FLAT.
isSingleSided
- true if a single-sided buffer should be constructedpublic boolean isSingleSided()
public double getSimplifyFactor()
public void setSimplifyFactor(double simplifyFactor)
simplifyFactor
- a value greater than or equal to zero.Copyright © 2018. All rights reserved.