Class Transform2D
java.lang.Object
org.gvsig.fmap.geom.jts.transform.Transform2D
- All Implemented Interfaces:
org.gvsig.fmap.geom.transform.Transform
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AffineTransform2D, initialized with Identity.Transform2D(double[] coefs) Creates a new Affine Transform by directly specifying the coefficients, in the order m00, m01, m02, m10, m11, m12 (different order of java.awt.geom.AffineTransform).Transform2D(double xx, double yx, double tx, double xy, double yy, double ty) Transform2D(AffineTransform transform) Creates a new transform from a java AWT transform. -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]Returns the 3x3 square matrix representing the transform.Returns this transform as an instance of java AWT AffineTransform.org.gvsig.fmap.geom.transform.Transformchain(org.gvsig.fmap.geom.transform.Transform other) Returns the affine transform created by applying first this affine transform, then the affine transform given bythat.clone()double[]Returns coefficients of the transform in a linear array of 6 double.org.gvsig.fmap.geom.transform.Transformconcatenate(org.gvsig.fmap.geom.transform.Transform other) Returns the affine transform created by applying first the affine transform given byother, then this affine transform.booleanorg.gvsig.fmap.geom.transform.Transforminverse()Returns the inverse transform.booleanisDirect()Tests if this affine transform is direct, i.e. the sign of the determinant of the associated matrix is positive.booleanTests is this affine transform is equal to the identity transform.booleanTests if this affine transform is an isometry, i.e. is equivalent to a compound of translations, rotations and reflections.booleanisMotion()Tests if this affine transform is a motion, i.e. is composed only of rotations and translations.booleanTests if this affine transform is a similarity.org.gvsig.fmap.geom.transform.TransformpreConcatenate(org.gvsig.fmap.geom.transform.Transform other) Return the affine transform created by applying first this affine transform, then the affine transform given bythat.toString()Displays the coefficients of the transform, row by row.org.gvsig.fmap.geom.primitive.Pointtransform(org.gvsig.fmap.geom.primitive.Point p) Computes the coordinates of the transformed point.org.gvsig.fmap.geom.primitive.Point[]transform(org.gvsig.fmap.geom.primitive.Point[] src, org.gvsig.fmap.geom.primitive.Point[] dst)
-
Field Details
-
ACCURACY
public static final double ACCURACYThe constant used for testing results.- See Also:
-
m00
protected double m00 -
m01
protected double m01 -
m02
protected double m02 -
m10
protected double m10 -
m11
protected double m11 -
m12
protected double m12
-
-
Constructor Details
-
Transform2D
public Transform2D()Creates a new AffineTransform2D, initialized with Identity. -
Transform2D
Creates a new transform from a java AWT transform.- Parameters:
transform-
-
Transform2D
public Transform2D(double[] coefs) Creates a new Affine Transform by directly specifying the coefficients, in the order m00, m01, m02, m10, m11, m12 (different order of java.awt.geom.AffineTransform).- Parameters:
coefs-
-
Transform2D
public Transform2D(double xx, double yx, double tx, double xy, double yy, double ty)
-
-
Method Details
-
coefficients
public double[] coefficients()Returns coefficients of the transform in a linear array of 6 double.- Returns:
-
affineMatrix
public double[][] affineMatrix()Returns the 3x3 square matrix representing the transform.- Returns:
- the 3x3 affine transform representing the matrix
-
asAwtTransform
Returns this transform as an instance of java AWT AffineTransform.- Returns:
-
concatenate
public org.gvsig.fmap.geom.transform.Transform concatenate(org.gvsig.fmap.geom.transform.Transform other) Returns the affine transform created by applying first the affine transform given byother, then this affine transform. This is the equivalent method of the 'concatenate' method in java.awt.geom.AffineTransform.- Specified by:
concatenatein interfaceorg.gvsig.fmap.geom.transform.Transform- Parameters:
other- the transform to apply first- Returns:
- the composition this * that
-
chain
public org.gvsig.fmap.geom.transform.Transform chain(org.gvsig.fmap.geom.transform.Transform other) Returns the affine transform created by applying first this affine transform, then the affine transform given bythat. This the equivalent method of the 'preConcatenate' method in java.awt.geom.AffineTransform.is equivalent to the sequence:shape = shape.transform(T1.chain(T2).chain(T3));
shape = shape.transform(T1); shape = shape.transform(T2); shape = shape.transform(T3);
- Parameters:
other- the transform to apply in a second step- Returns:
- the composition that * this
-
preConcatenate
public org.gvsig.fmap.geom.transform.Transform preConcatenate(org.gvsig.fmap.geom.transform.Transform other) Return the affine transform created by applying first this affine transform, then the affine transform given bythat. This the equivalent method of the 'preConcatenate' method in java.awt.geom.AffineTransform.- Specified by:
preConcatenatein interfaceorg.gvsig.fmap.geom.transform.Transform- Parameters:
other- the transform to apply in a second step- Returns:
- the composition that * this
-
isSimilarity
public boolean isSimilarity()Tests if this affine transform is a similarity.- Returns:
-
isMotion
public boolean isMotion()Tests if this affine transform is a motion, i.e. is composed only of rotations and translations.- Returns:
-
isIsometry
public boolean isIsometry()Tests if this affine transform is an isometry, i.e. is equivalent to a compound of translations, rotations and reflections. Isometry keeps area of shapes unchanged, but can change orientation (direct or indirect).- Returns:
- true in case of isometry.
-
isDirect
public boolean isDirect()Tests if this affine transform is direct, i.e. the sign of the determinant of the associated matrix is positive. Direct transforms preserve the orientation of transformed shapes.- Returns:
-
isIdentity
public boolean isIdentity()Tests is this affine transform is equal to the identity transform.- Specified by:
isIdentityin interfaceorg.gvsig.fmap.geom.transform.Transform- Returns:
- true if this transform is the identity transform
-
inverse
public org.gvsig.fmap.geom.transform.Transform inverse()Returns the inverse transform. If the transform is not invertible, throws a new NonInvertibleTransformException.- Specified by:
inversein interfaceorg.gvsig.fmap.geom.transform.Transform- Returns:
-
transform
public org.gvsig.fmap.geom.primitive.Point transform(org.gvsig.fmap.geom.primitive.Point p) Computes the coordinates of the transformed point.- Specified by:
transformin interfaceorg.gvsig.fmap.geom.transform.Transform- Parameters:
p-- Returns:
-
transform
public org.gvsig.fmap.geom.primitive.Point[] transform(org.gvsig.fmap.geom.primitive.Point[] src, org.gvsig.fmap.geom.primitive.Point[] dst) - Specified by:
transformin interfaceorg.gvsig.fmap.geom.transform.Transform
-
toString
Displays the coefficients of the transform, row by row. -
equals
-
clone
-