org.deegree_impl.model.ct
Class MathTransformAdapter

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

class MathTransformAdapter
extends AbstractMathTransform
implements java.io.Serializable

Wrap an CT_MathTransform into a MathTransform. This class is provided for compatibility with OpenGIS. It is serializable if the underlying CT_MathTransform is serializable too.

Version:
1.0
Author:
Martin Desruisseaux

Nested Class Summary
 
Nested classes inherited from class org.deegree_impl.model.ct.AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
private  int dimSource
          Dimension of output points.
private  int dimTarget
          Dimension of input points.
protected  MathTransformAdapter inverse
          The inverse transform.
private  boolean isIdentity
          true if this transform does not move any points.
private static long serialVersionUID
          Serial number for interoperability with different versions.
protected  CT_MathTransform transform
          The OpenGIS math transform.
 
Constructor Summary
MathTransformAdapter(CT_MathTransform transform)
          Construct an adapter.
 
Method Summary
 Matrix derivative(CoordinatePoint 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.
 
Methods inherited from class org.deegree_impl.model.ct.AbstractMathTransform
addParameter, addParameter, createTransformedShape, createTransformedShape, derivative, getName, hashCode, paramMT, toString, transform, transform
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.


dimSource

private final int dimSource
Dimension of output points.


dimTarget

private final int dimTarget
Dimension of input points.


isIdentity

private final boolean isIdentity
true if this transform does not move any points.


inverse

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

Constructor Detail

MathTransformAdapter

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

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

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