public class ShapeNormalizer extends Object
CurveConverter
.Modifier and Type | Class and Description |
---|---|
static class |
ShapeNormalizer.ConnectedShape
This class wraps a Shape with a boolean indicating if the Shape is connected to the previous Shape.
|
Modifier and Type | Field and Description |
---|---|
static double |
ASSUME_ZERO
The maximum value to assume zero.
|
Constructor and Description |
---|
ShapeNormalizer()
Creates a new normalizer.
|
ShapeNormalizer(boolean allowCircles)
Creates a new normalizer.
|
Modifier and Type | Method and Description |
---|---|
void |
allowCircles(boolean allowCircles)
Set if circles are allowed in the result
|
List<ShapeNormalizer.ConnectedShape> |
convertConnectedPath(PathIterator pathiterator)
Convert any PathIterator in a Vector of elementary Arcs, Polygons, Polylines, or Lines.
|
List<ShapeNormalizer.ConnectedShape> |
convertConnectedPath(Shape shape)
Convert any Shape in a Vector of elementary Arcs, Polygons, or Lines.
|
List<ShapeNormalizer.ConnectedShape> |
convertConnectedPath(Shape shape,
AffineTransform affine)
Convert any Shape in a Vector of elementary Arcs, Polygons, Polylines, or Lines.
|
List<Shape> |
convertPath(PathIterator pathiterator)
Convert any PathIterator in a Vector of elementary Arcs, Polygons, Polylines, or Lines.
|
List<Shape> |
convertPath(Shape shape)
Convert any Shape in a Vector of elementary Arcs, Polygons, , Polylines, or Lines.
|
List<Shape> |
convertPath(Shape shape,
AffineTransform affine)
Convert any Shape in a Vector of elementary Arcs, Polygons, Polylines, or Lines.
|
List<Shape> |
convertPath(Shape shape,
AffineTransform affine,
boolean flatnessProp,
double flatness)
Convert any Shape in a Vector of elementary Arcs, Ellipse, Polygons, Polylines, or Lines.
|
boolean |
getSurfaceMode()
Return true if the surface filling mode of this normalizer is active.
|
boolean |
isAllowingCircles()
Return true if circles are allowed in the result.
|
void |
setSurfaceMode(boolean mode)
Set the surface filling mode of this normalizer.
|
public static final double ASSUME_ZERO
public ShapeNormalizer()
setSurfaceMode(boolean)
.public ShapeNormalizer(boolean allowCircles)
setSurfaceMode(boolean)
.allowCircles
- true if circles are allowed in the resultpublic void setSurfaceMode(boolean mode)
Polygon2D
to the shapes Vector for each encountered Path that has at least one CubicCurve2D
or QuadCurve2D
mode
- true if the surface filling mode is activepublic boolean getSurfaceMode()
setSurfaceMode(boolean)
public boolean isAllowingCircles()
public void allowCircles(boolean allowCircles)
allowCircles
- true if circles are allowed in the resultpublic List<ShapeNormalizer.ConnectedShape> convertConnectedPath(Shape shape)
shape
- the input Shapepublic List<ShapeNormalizer.ConnectedShape> convertConnectedPath(Shape shape, AffineTransform affine)
shape
- the input Shapeaffine
- the AffineTransformpublic List<Shape> convertPath(Shape shape)
convertConnectedPath(java.awt.Shape)
method.shape
- the input Shapepublic List<Shape> convertPath(Shape shape, AffineTransform affine)
convertConnectedPath(java.awt.Shape, java.awt.geom.AffineTransform)
method.shape
- the input Shapeaffine
- the AffineTransformpublic List<Shape> convertPath(Shape shape, AffineTransform affine, boolean flatnessProp, double flatness)
shape
- the input Shapeaffine
- the AffineTransformflatnessProp
- true if Shapes will be flattenedflatness
- the flatness valuepublic List<Shape> convertPath(PathIterator pathiterator)
convertConnectedPath(java.awt.geom.PathIterator)
method.pathiterator
- the PathIteratorpublic List<ShapeNormalizer.ConnectedShape> convertConnectedPath(PathIterator pathiterator)
pathiterator
- the PathIterator