Package org.geotools.geometry.jts
Class TransformedShape
Object
AffineTransform
TransformedShape
- All Implemented Interfaces:
Shape
,Serializable
,Cloneable
Apply an arbitrary
AffineTransform
on a Shape
. This class is used internally by
RenderedMarks
. It is designed for reuse with many different affine transforms and shapes. This class is
not thread-safe.- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Field Summary
FieldsFields inherited from class AffineTransform
TYPE_FLIP, TYPE_GENERAL_ROTATION, TYPE_GENERAL_SCALE, TYPE_GENERAL_TRANSFORM, TYPE_IDENTITY, TYPE_MASK_ROTATION, TYPE_MASK_SCALE, TYPE_QUADRANT_ROTATION, TYPE_TRANSLATION, TYPE_UNIFORM_SCALE
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a transformed shape initialized to the identity transform.TransformedShape
(Shape shape, AffineTransform at) Construct a transformed shape -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double x, double y) Tests if the specified coordinates are inside the boundary of theShape
.boolean
contains
(double x, double y, double width, double height) Tests if the interior of theShape
entirely contains the specified rectangular area.boolean
Tests if a specifiedPoint2D
is inside the boundary of theShape
.boolean
Tests if the interior of theShape
entirely contains the specifiedRectangle2D
.Returns an integerRectangle
that completely encloses theShape
.Returns a high precision and more accurate bounding box of theShape
than thegetBounds
method.void
getMatrix
(float[] matrix, int offset) Returns the 6 coefficients values.Returns an iterator object that iterates along theShape
boundary and provides access to the geometry of theShape
outline.getPathIterator
(AffineTransform at, double flatness) Returns an iterator object that iterates along theShape
boundary and provides access to a flattened view of theShape
outline geometry.boolean
intersects
(double x, double y, double width, double height) Tests if the interior of theShape
intersects the interior of a specified rectangular area.boolean
Tests if the interior of theShape
intersects the interior of a specifiedRectangle2D
.void
scale
(double s) Apply a uniform scale.void
setTransform
(double[] matrix) Set the transform from a flat matrix.void
setTransform
(float[] matrix, int offset) Set the transform from a flat matrix.Methods inherited from class AffineTransform
clone, concatenate, createInverse, createTransformedShape, deltaTransform, deltaTransform, equals, getDeterminant, getMatrix, getQuadrantRotateInstance, getQuadrantRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, invert, isIdentity, preConcatenate, quadrantRotate, quadrantRotate, rotate, rotate, rotate, rotate, scale, setToIdentity, setToQuadrantRotation, setToQuadrantRotation, setToRotation, setToRotation, setToRotation, setToRotation, setToScale, setToShear, setToTranslation, setTransform, setTransform, shear, toString, transform, transform, transform, transform, transform, transform, translate
-
Field Details
-
shape
The wrapped shape.
-
-
Constructor Details
-
TransformedShape
public TransformedShape()Construct a transformed shape initialized to the identity transform. -
TransformedShape
Construct a transformed shape
-
-
Method Details
-
getMatrix
public void getMatrix(float[] matrix, int offset) Returns the 6 coefficients values. -
setTransform
public void setTransform(float[] matrix, int offset) Set the transform from a flat matrix.- Parameters:
matrix
- The flat matrix.offset
- The index of the first element to use inmatrix
.
-
setTransform
public void setTransform(double[] matrix) Set the transform from a flat matrix.- Parameters:
matrix
- The flat matrix.
-
scale
public void scale(double s) Apply a uniform scale. -
contains
public boolean contains(double x, double y) Tests if the specified coordinates are inside the boundary of theShape
. -
contains
Tests if a specifiedPoint2D
is inside the boundary of theShape
. -
contains
public boolean contains(double x, double y, double width, double height) Tests if the interior of theShape
entirely contains the specified rectangular area. -
contains
Tests if the interior of theShape
entirely contains the specifiedRectangle2D
. This method might conservatively returnfalse
. -
intersects
public boolean intersects(double x, double y, double width, double height) Tests if the interior of theShape
intersects the interior of a specified rectangular area.- Specified by:
intersects
in interfaceShape
-
intersects
Tests if the interior of theShape
intersects the interior of a specifiedRectangle2D
. This method might conservatively returntrue
.- Specified by:
intersects
in interfaceShape
-
getBounds
Returns an integerRectangle
that completely encloses theShape
. -
getBounds2D
Returns a high precision and more accurate bounding box of theShape
than thegetBounds
method.- Specified by:
getBounds2D
in interfaceShape
-
getPathIterator
Returns an iterator object that iterates along theShape
boundary and provides access to the geometry of theShape
outline.- Specified by:
getPathIterator
in interfaceShape
-
getPathIterator
Returns an iterator object that iterates along theShape
boundary and provides access to a flattened view of theShape
outline geometry.- Specified by:
getPathIterator
in interfaceShape
-