public class AffineTransform2D extends XAffineTransform implements MathTransform2D, LinearTransform, Formattable, Cloneable
AffineTransform
and implements MathTransform2D
, so it can be used as a bridge
between Java2D and the referencing module.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 and Description |
---|
AffineTransform2D(AffineTransform transform)
Constructs a new affine transform with the same coefficient than the specified transform.
|
AffineTransform2D(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Constructs a new
AffineTransform2D from 6 values representing the 6 specifiable
entries of the 3×3 transformation matrix. |
Modifier and Type | Method and Description |
---|---|
protected void |
checkPermission()
Throws an
UnsupportedOperationException when a mutable method is invoked, since
AffineTransform2D must be immutable. |
AffineTransform |
clone()
Returns a new affine transform which is a modifiable copy of this transform.
|
Shape |
createTransformedShape(Shape shape)
Transforms the specified shape.
|
Matrix |
derivative(DirectPosition point)
Gets the derivative of this transform at a point.
|
Matrix |
derivative(Point2D point)
Gets the derivative of this transform at a point.
|
boolean |
equals(Object obj) |
String |
formatWKT(Formatter formatter)
Format the inner part of a Well
Known Text (WKT) element.
|
Matrix |
getMatrix()
Returns this transform as an affine transform matrix.
|
ParameterValueGroup |
getParameterValues()
Returns the matrix elements as a group of parameters values.
|
int |
getSourceDimensions()
Gets the dimension of input points, which is fixed to 2.
|
int |
getTargetDimensions()
Gets the dimension of output points, which is fixed to 2.
|
MathTransform2D |
inverse()
Creates the inverse transform of this object.
|
String |
toString()
Returns the WKT representation of this transform.
|
String |
toWKT()
Returns the WKT for this transform.
|
DirectPosition |
transform(DirectPosition ptSrc,
DirectPosition ptDst)
Transforms the specified
ptSrc and stores the result in ptDst . |
concatenate, getFlip, getRotation, getScale, getScaleInstance, getScaleX0, getScaleY0, getSwapXY, inverseDeltaTransform, inverseTransform, isIdentity, isIdentity, preConcatenate, rotate, rotate, round, scale, setToIdentity, setToRotation, setToRotation, setToScale, setToShear, setToTranslation, setTransform, setTransform, shear, transform, transform, translate
createInverse, deltaTransform, deltaTransform, getDeterminant, getMatrix, getQuadrantRotateInstance, getQuadrantRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, invert, isIdentity, quadrantRotate, quadrantRotate, rotate, rotate, setToQuadrantRotation, setToQuadrantRotation, setToRotation, setToRotation, transform, transform, transform, transform, transform, transform
transform
isIdentity
isIdentity, transform, transform, transform, transform
public AffineTransform2D(AffineTransform transform)
public AffineTransform2D(double m00, double m10, double m01, double m11, double m02, double m12)
AffineTransform2D
from 6 values representing the 6 specifiable
entries of the 3×3 transformation matrix. Those values are given unchanged to the
super class
constructor
.protected final void checkPermission() throws UnsupportedOperationException
UnsupportedOperationException
when a mutable method is invoked, since
AffineTransform2D
must be immutable.checkPermission
in class XAffineTransform
UnsupportedOperationException
- if this affine transform is immutable.public ParameterValueGroup getParameterValues()
public final int getSourceDimensions()
getSourceDimensions
in interface MathTransform
public final int getTargetDimensions()
getTargetDimensions
in interface MathTransform
public DirectPosition transform(DirectPosition ptSrc, DirectPosition ptDst)
ptSrc
and stores the result in ptDst
.transform
in interface MathTransform
ptSrc
- the specified coordinate point to be transformed.ptDst
- the specified coordinate point that stores the result of transforming ptSrc
, or null
.ptSrc
and storing the result in
ptDst
, or a newly created point if ptDst
was null.public Shape createTransformedShape(Shape shape)
createTransformedShape
in interface MathTransform2D
createTransformedShape
in class AffineTransform
shape
- Shape to transform.shape
if this transform is the identity transform.public Matrix getMatrix()
getMatrix
in interface LinearTransform
public Matrix derivative(Point2D point)
derivative
in interface MathTransform2D
point
- The coordinate point where to evaluate the derivative. Null value is accepted
only if the derivative is the same everywhere. For example affine transform accept null
value since they produces identical derivative no matter the coordinate value. But most
map projection will requires a non-null value.public Matrix derivative(DirectPosition point)
derivative
in interface MathTransform
point
- The coordinate point where to evaluate the derivative. Null value is accepted
only if the derivative is the same everywhere. For example affine transform accept null
value since they produces identical derivative no matter the coordinate value. But most
map projection will requires a non-null value.null
). This method never returns
an internal object: changing the matrix will not change the state of this math transform.public MathTransform2D inverse() throws NoninvertibleTransformException
inverse
in interface MathTransform
inverse
in interface MathTransform2D
NoninvertibleTransformException
- if this transform can't be inverted.public AffineTransform clone()
AffineTransform2D
instance because the later
is unmodifiable, which make exact cloning useless.clone
in class AffineTransform
Object.clone()
public String formatWKT(Formatter formatter)
formatWKT
in interface Formattable
formatter
- The formatter to use.Formattable.formatWKT(Formatter)
public String toWKT()
toWKT
in interface MathTransform
public String toString()
toString
in class AffineTransform
public boolean equals(Object obj)
equals
in class AffineTransform
Copyright © 1996–2019 Geotools. All rights reserved.