org.deegree_impl.model.ct
Class ConcatenedTransformDirect2D

java.lang.Object
  extended byorg.deegree_impl.model.ct.AbstractMathTransform
      extended byorg.deegree_impl.model.ct.ConcatenedTransform
          extended byorg.deegree_impl.model.ct.ConcatenedTransformDirect
              extended byorg.deegree_impl.model.ct.ConcatenedTransformDirect2D
All Implemented Interfaces:
MathTransform, MathTransform2D, java.io.Serializable

final class ConcatenedTransformDirect2D
extends ConcatenedTransformDirect
implements MathTransform2D

Concatened transform where both transforms are two-dimensional.

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 static long serialVersionUID
          Serial number for interoperability with different versions.
private  MathTransform2D transform1
          The first math transform.
private  MathTransform2D transform2
          The second math transform.
 
Constructor Summary
ConcatenedTransformDirect2D(MathTransformFactory provider, MathTransform2D transform1, MathTransform2D transform2)
          Construct a concatenated transform.
 
Method Summary
 java.awt.Shape createTransformedShape(java.awt.Shape shape)
          Transform the specified shape.
 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.
 int hashCode()
          Returns a hash value for this transform.
 MathTransform inverse()
          Creates the inverse transform of this object.
 boolean isIdentity()
          Tests whether this transform does not move any points.
protected  boolean isValid()
          Check if transforms are compatibles with this implementation.
 java.lang.String toString()
          Returns the WKT for this math transform.
 CoordinatePoint transform(CoordinatePoint ptSrc, CoordinatePoint ptDst)
          Transforms the specified ptSrc and stores the result in ptDst.
 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, getName, paramMT, toOpenGIS
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
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

transform1

private final MathTransform2D transform1
The first math transform. This field is identical to ConcatenedTransform.transform1. Only the type is different.


transform2

private final MathTransform2D transform2
The second math transform. This field is identical to ConcatenedTransform.transform1. Only the type is different.

Constructor Detail

ConcatenedTransformDirect2D

public ConcatenedTransformDirect2D(MathTransformFactory provider,
                                   MathTransform2D transform1,
                                   MathTransform2D transform2)
Construct a concatenated transform.

Method Detail

isValid

protected boolean isValid()
Check if transforms are compatibles with this implementation.

Overrides:
isValid in class ConcatenedTransformDirect

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)

createTransformedShape

public java.awt.Shape createTransformedShape(java.awt.Shape shape)
                                      throws TransformException
Transform the specified shape.

Specified by:
createTransformedShape in interface MathTransform2D
Overrides:
createTransformedShape in class AbstractMathTransform
Parameters:
shape - Shape to transform.
Returns:
Transformed shape, or shape if this transform is the identity transform.
Throws:
TransformException - if a transform failed.
See Also:
MathTransform2D.createTransformedShape(Shape)

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 CoordinatePoint transform(CoordinatePoint ptSrc,
                                 CoordinatePoint ptDst)
                          throws TransformException
Transforms the specified ptSrc and stores the result in ptDst.

Specified by:
transform in interface MathTransform
Overrides:
transform in class ConcatenedTransform
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
Overrides:
transform in class ConcatenedTransform
Throws:
TransformException

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 ConcatenedTransform
Throws:
TransformException

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()

inverse

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

Specified by:
inverse in interface MathTransform
Overrides:
inverse in class AbstractMathTransform
Throws:
NoninvertibleTransformException

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.

isIdentity

public final boolean isIdentity()
Tests whether this transform does not move any points. Default implementation check if the two transforms are identity. This a way too conservative aproach, but it it doesn't hurt since ConcatenedTransform should not have been created if it were to result in an identity transform (this case should have been detected earlier).

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

hashCode

public final int hashCode()
Returns a hash value for this transform.

Overrides:
hashCode 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

toString

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

Overrides:
toString in class AbstractMathTransform