org.deegree_impl.model.ct
Class MathTransformAdapter2D

java.lang.Object
  extended byorg.deegree_impl.model.ct.AbstractMathTransform
      extended byorg.deegree_impl.model.ct.MathTransformAdapter
          extended byorg.deegree_impl.model.ct.MathTransformAdapter2D
All Implemented Interfaces:
MathTransform, MathTransform2D, java.io.Serializable

final class MathTransformAdapter2D
extends MathTransformAdapter
implements MathTransform2D

Wrap an CT_MathTransform into a MathTransform2D.

Version:
1.0
Author:
Martin Desruisseaux

Nested Class Summary
 
Nested classes inherited from class org.deegree_impl.model.ct.AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
protected  MathTransformAdapter inverse
          The inverse transform.
private static long serialVersionUID
          Serial number for interoperability with different versions.
protected  CT_MathTransform transform
          The OpenGIS math transform.
 
Constructor Summary
MathTransformAdapter2D(CT_MathTransform transform)
          Construct an adapter.
 
Method Summary
 Matrix derivative(CoordinatePoint point)
          Gets the derivative of this transform at a point.
 Matrix derivative(java.awt.geom.Point2D point)
          Gets the derivative of this transform at a point.
 boolean equals(java.lang.Object object)
          Compares the specified object with this math transform for equality.
 int getDimSource()
          Gets the dimension of input points.
 int getDimTarget()
          Gets the dimension of output points.
 MathTransform inverse()
          Creates the inverse transform of this object.
 boolean isIdentity()
          Tests whether this transform does not move any points.
(package private)  java.lang.Object toOpenGIS(java.lang.Object adapters)
          Returns the underlying OpenGIS interface.
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc, java.awt.geom.Point2D ptDst)
          Transforms the specified ptSrc and stores the result in ptDst.
 
Methods inherited from class org.deegree_impl.model.ct.AbstractMathTransform
addParameter, addParameter, createTransformedShape, createTransformedShape, getName, hashCode, paramMT, toString, transform
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree_impl.model.ct.MathTransform2D
createTransformedShape
 
Methods inherited from interface org.deegree_impl.model.ct.MathTransform
derivative, getDimSource, getDimTarget, inverse, isIdentity, transform, transform, transform
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial number for interoperability with different versions.

See Also:
Constant Field Values

transform

protected final CT_MathTransform transform
The OpenGIS math transform.


inverse

protected transient MathTransformAdapter inverse
The inverse transform. This field will be computed only when needed.

Constructor Detail

MathTransformAdapter2D

public MathTransformAdapter2D(CT_MathTransform transform)
                       throws java.rmi.RemoteException
Construct an adapter.

Throws:
java.rmi.RemoteException - if a remote call failed.
Method Detail

transform

public java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc,
                                       java.awt.geom.Point2D ptDst)
                                throws TransformException
Transforms the specified ptSrc and stores the result in ptDst.

Specified by:
transform in interface MathTransform2D
Overrides:
transform in class AbstractMathTransform
Parameters:
ptSrc - the specified coordinate point to be transformed.
ptDst - the specified coordinate point that stores the result of transforming ptSrc, or null.
Returns:
the coordinate point after transforming ptSrc and stroring the result in ptDst.
Throws:
TransformException - if the point can't be transformed.
See Also:
MathTransform2D.transform(Point2D,Point2D)

derivative

public Matrix derivative(java.awt.geom.Point2D point)
                  throws TransformException
Gets the derivative of this transform at a point.

Specified by:
derivative in interface MathTransform2D
Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point (never null).
Throws:
TransformException - if the derivative can't be evaluated at the specified point.
See Also:
MathTransform2D.derivative(Point2D)

transform

public final void transform(double[] srcPts,
                            int srcOff,
                            double[] dstPts,
                            int dstOff,
                            int numPts)
                     throws TransformException
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Parameters:
srcPts - the array containing the source point coordinates.
srcOff - the offset to the first point to be transformed in the source array.
dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
dstOff - the offset to the location of the first transformed point that is stored in the destination array.
numPts - the number of point objects to be transformed.
Throws:
TransformException - if the points can't be transformed, or if a remote call failed.

transform

public final void transform(float[] srcPts,
                            int srcOff,
                            float[] dstPts,
                            int dstOff,
                            int numPts)
                     throws TransformException
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Throws:
TransformException - if the points can't be transformed, or if a remote call failed.

derivative

public Matrix derivative(CoordinatePoint point)
                  throws TransformException
Gets the derivative of this transform at a point.

Specified by:
derivative in interface MathTransform
Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point (never null).
Throws:
TransformException - if the derivative can't be evaluated at the specified point.

inverse

public MathTransform inverse()
                      throws NoninvertibleTransformException
Creates the inverse transform of this object.

Specified by:
inverse in interface MathTransform
Overrides:
inverse in class AbstractMathTransform
Throws:
NoninvertibleTransformException - if the inverse transform can't be created, or if a remote call failed.

getDimSource

public final int getDimSource()
Gets the dimension of input points.

Specified by:
getDimSource in interface MathTransform
See Also:
CT_MathTransform.getDimSource()

getDimTarget

public final int getDimTarget()
Gets the dimension of output points.

Specified by:
getDimTarget in interface MathTransform
See Also:
CT_MathTransform.getDimTarget()

isIdentity

public final boolean isIdentity()
Tests whether this transform does not move any points.

Specified by:
isIdentity in interface MathTransform
Returns:
true if this MathTransform is an identity transform; false otherwise.

toOpenGIS

final java.lang.Object toOpenGIS(java.lang.Object adapters)
Returns the underlying OpenGIS interface.

Overrides:
toOpenGIS in class AbstractMathTransform

equals

public final boolean equals(java.lang.Object object)
Compares the specified object with this math transform for equality.

Overrides:
equals in class AbstractMathTransform