org.deegree_impl.model.ct
Class PassThroughTransform

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

final class PassThroughTransform
extends AbstractMathTransform
implements java.io.Serializable

Transform which passes through a subset of ordinates to another transform. This allows transforms to operate on a subset of ordinates. For example, if you have (latitude,longitude,height) coordinates, then you may wish to convert the height values from feet to meters without affecting the latitude and longitude values.

Version:
1.00
Author:
OpenGIS (www.opengis.org), Martin Desruisseaux

Nested Class Summary
 
Nested classes inherited from class org.deegree_impl.model.ct.AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
protected  int firstAffectedOrdinate
          Index of the first affected ordinate.
private  PassThroughTransform inverse
          The inverse transform.
protected  int numTrailingOrdinates
          Number of unaffected ordinates after the affected ones.
private static long serialVersionUID
          Serial number for interoperability with different versions.
protected  MathTransform transform
          The sub transform.
 
Constructor Summary
PassThroughTransform(int firstAffectedOrdinate, MathTransform transform, int numTrailingOrdinates)
          Create a pass through transform.
 
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.
 java.lang.String toString()
          Returns the WKT for this math transform.
 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, toOpenGIS, 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

firstAffectedOrdinate

protected final int firstAffectedOrdinate
Index of the first affected ordinate.


numTrailingOrdinates

protected final int numTrailingOrdinates
Number of unaffected ordinates after the affected ones. Always 0 when used through the strict OpenGIS API.


transform

protected final MathTransform transform
The sub transform.


inverse

private transient PassThroughTransform inverse
The inverse transform. This field will be computed only when needed.

Constructor Detail

PassThroughTransform

public PassThroughTransform(int firstAffectedOrdinate,
                            MathTransform transform,
                            int numTrailingOrdinates)
Create a pass through transform.

Parameters:
firstAffectedOrdinate - Index of the first affected ordinate.
transform - The sub transform.
numTrailingOrdinates - Number of trailing ordinates to pass through. Affected ordinates will range from firstAffectedOrdinate inclusive to dimTarget-numTrailingOrdinates exclusive.
Method Detail

getDimSource

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

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

getDimTarget

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

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

isIdentity

public 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.

transform

public 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

transform

public 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 a point can't be transformed.

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

equals

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

Overrides:
equals in class AbstractMathTransform

toString

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

Overrides:
toString in class AbstractMathTransform