org.geotools.referencing.operation.transform
Class AffineTransform2D

java.lang.Object
  extended by java.awt.geom.AffineTransform
      extended by org.geotools.referencing.operation.matrix.XAffineTransform
          extended by org.geotools.referencing.operation.transform.AffineTransform2D
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, LinearTransform, Formattable, org.opengis.referencing.operation.MathTransform, org.opengis.referencing.operation.MathTransform2D

public class AffineTransform2D
extends XAffineTransform
implements org.opengis.referencing.operation.MathTransform2D, LinearTransform, Formattable, org.opengis.util.Cloneable

Transforms two-dimensional coordinate points using an affine transform. This class both extends AffineTransform and implements MathTransform2D, so it can be used as a bridge between Java2D and the referencing module.

Since:
2.5
Version:
$Id: AffineTransform2D.java 34082 2009-10-06 11:00:21Z aaime $
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.geom.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
AffineTransform2D(java.awt.geom.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.
 
Method Summary
protected  void checkPermission()
          Throws an UnsupportedOperationException when a mutable method is invoked, since AffineTransform2D must be immutable.
 java.awt.geom.AffineTransform clone()
          Returns a new affine transform which is a modifiable copy of this transform.
 java.awt.Shape createTransformedShape(java.awt.Shape shape)
          Transforms the specified shape.
 org.opengis.referencing.operation.Matrix derivative(org.opengis.geometry.DirectPosition point)
          Gets the derivative of this transform at a point.
 org.opengis.referencing.operation.Matrix derivative(java.awt.geom.Point2D point)
          Gets the derivative of this transform at a point.
 boolean equals(java.lang.Object obj)
           
 java.lang.String formatWKT(Formatter formatter)
          Format the inner part of a Well Known Text (WKT) element.
 org.opengis.referencing.operation.Matrix getMatrix()
          Returns this transform as an affine transform matrix.
 org.opengis.parameter.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.
 org.opengis.referencing.operation.MathTransform2D inverse()
          Creates the inverse transform of this object.
 java.lang.String toString()
          Returns the WKT representation of this transform.
 java.lang.String toWKT()
          Returns the WKT for this transform.
 org.opengis.geometry.DirectPosition transform(org.opengis.geometry.DirectPosition ptSrc, org.opengis.geometry.DirectPosition ptDst)
          Transforms the specified ptSrc and stores the result in ptDst.
 
Methods inherited from class org.geotools.referencing.operation.matrix.XAffineTransform
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
 
Methods inherited from class java.awt.geom.AffineTransform
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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.referencing.operation.MathTransform2D
transform
 
Methods inherited from interface org.geotools.referencing.operation.LinearTransform
isIdentity
 
Methods inherited from interface org.opengis.referencing.operation.MathTransform
isIdentity, transform, transform, transform, transform
 

Constructor Detail

AffineTransform2D

public AffineTransform2D(java.awt.geom.AffineTransform transform)
Constructs a new affine transform with the same coefficient than the specified transform.


AffineTransform2D

public 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. Those values are given unchanged to the super class constructor.

Since:
2.5
Method Detail

checkPermission

protected final void checkPermission()
                              throws java.lang.UnsupportedOperationException
Throws an UnsupportedOperationException when a mutable method is invoked, since AffineTransform2D must be immutable.

Overrides:
checkPermission in class XAffineTransform
Throws:
java.lang.UnsupportedOperationException - if this affine transform is immutable.

getParameterValues

public org.opengis.parameter.ParameterValueGroup getParameterValues()
Returns the matrix elements as a group of parameters values. The number of parameters depends on the matrix size. Only matrix elements different from their default value will be included in this group.

Returns:
A copy of the parameter values for this math transform.

getSourceDimensions

public final int getSourceDimensions()
Gets the dimension of input points, which is fixed to 2.

Specified by:
getSourceDimensions in interface org.opengis.referencing.operation.MathTransform

getTargetDimensions

public final int getTargetDimensions()
Gets the dimension of output points, which is fixed to 2.

Specified by:
getTargetDimensions in interface org.opengis.referencing.operation.MathTransform

transform

public org.opengis.geometry.DirectPosition transform(org.opengis.geometry.DirectPosition ptSrc,
                                                     org.opengis.geometry.DirectPosition ptDst)
Transforms the specified ptSrc and stores the result in ptDst.

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform

createTransformedShape

public java.awt.Shape createTransformedShape(java.awt.Shape shape)
Transforms the specified shape.

Specified by:
createTransformedShape in interface org.opengis.referencing.operation.MathTransform2D
Overrides:
createTransformedShape in class java.awt.geom.AffineTransform
Parameters:
shape - Shape to transform.
Returns:
Transformed shape, or shape if this transform is the identity transform.

getMatrix

public org.opengis.referencing.operation.Matrix getMatrix()
Returns this transform as an affine transform matrix.

Specified by:
getMatrix in interface LinearTransform
Returns:
A copy of the underlying matrix.

derivative

public org.opengis.referencing.operation.Matrix derivative(java.awt.geom.Point2D point)
Gets the derivative of this transform at a point. For an affine transform, the derivative is the same everywhere.

Specified by:
derivative in interface org.opengis.referencing.operation.MathTransform2D

derivative

public org.opengis.referencing.operation.Matrix derivative(org.opengis.geometry.DirectPosition point)
Gets the derivative of this transform at a point. For an affine transform, the derivative is the same everywhere.

Specified by:
derivative in interface org.opengis.referencing.operation.MathTransform

inverse

public org.opengis.referencing.operation.MathTransform2D inverse()
                                                          throws org.opengis.referencing.operation.NoninvertibleTransformException
Creates the inverse transform of this object.

Specified by:
inverse in interface org.opengis.referencing.operation.MathTransform
Specified by:
inverse in interface org.opengis.referencing.operation.MathTransform2D
Throws:
org.opengis.referencing.operation.NoninvertibleTransformException - if this transform can't be inverted.

clone

public java.awt.geom.AffineTransform clone()
Returns a new affine transform which is a modifiable copy of this transform. We override this method because it is defined in the super-class. However this implementation do not returns a new AffineTransform2D instance because the later is unmodifiable, which make exact cloning useless.

Overrides:
clone in class java.awt.geom.AffineTransform

formatWKT

public java.lang.String formatWKT(Formatter formatter)
Format the inner part of a Well Known Text (WKT) element.

Specified by:
formatWKT in interface Formattable
Parameters:
formatter - The formatter to use.
Returns:
The WKT element name.
See Also:
Formattable.formatWKT(Formatter)

toWKT

public java.lang.String toWKT()
Returns the WKT for this transform.

Specified by:
toWKT in interface org.opengis.referencing.operation.MathTransform

toString

public java.lang.String toString()
Returns the WKT representation of this transform.

Overrides:
toString in class java.awt.geom.AffineTransform

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.awt.geom.AffineTransform


Copyright © 1996-2010 Geotools. All Rights Reserved.