deegree 2.1 (2007/11/08 09:57 build-328-official)

org.deegree.model.csct.ct
Class MatrixTransform

java.lang.Object
  extended by org.deegree.model.csct.ct.AbstractMathTransform
      extended by org.deegree.model.csct.ct.MatrixTransform
All Implemented Interfaces:
Serializable, MathTransform

final class MatrixTransform
extends AbstractMathTransform
implements Serializable

Transforms multi-dimensional coordinate points using a Matrix.

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

Nested Class Summary
(package private) static class MatrixTransform.Provider
          The provider for MatrixTransform.
 
Nested classes/interfaces inherited from class org.deegree.model.csct.ct.AbstractMathTransform
AbstractMathTransform.Inverse
 
Constructor Summary
protected MatrixTransform(javax.vecmath.GMatrix matrix)
          Construct a transform.
 
Method Summary
 Matrix derivative(CoordinatePoint point)
          Gets the derivative of this transform at a point.
 Matrix derivative(Point2D point)
          Gets the derivative of this transform at a point.
 boolean equals(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.
 Matrix getMatrix()
          Returns a copy of the matrix.
 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.
 String toString()
          Returns the WKT for this math transform.
(package private) static String toString(Matrix matrix)
          Returns the WKT for an affine transform using the specified matrix.
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms an array of floating point coordinates by this matrix.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms an array of floating point coordinates by this matrix.
 
Methods inherited from class org.deegree.model.csct.ct.AbstractMathTransform
addParameter, addParameter, createTransformedShape, createTransformedShape, getName, paramMT, transform, transform
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatrixTransform

protected MatrixTransform(javax.vecmath.GMatrix matrix)
Construct a transform.

Method Detail

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this matrix. Point coordinates must have a dimension equals to GMatrix.getNumCol()-1. For example, for square matrix of size 4×4, coordinate points are three-dimensional and stored in the arrays starting at the specified offset (srcOff) in the order [x0, y0, z0, x1, y1, z1..., xn, yn, zn]. The transformed points (x',y',z') are computed as below (note that this computation is similar to PerspectiveTransform):
  [ u ]     [ m<sub>00</sub>  m<sub>01</sub>  m<sub>02</sub>  m<sub>03</sub> ] [ x ]
  [ v ]  =  [ m<sub>10</sub>  m<sub>11</sub>  m<sub>12</sub>  m<sub>13</sub> ] [ y ]
  [ w ]     [ m<sub>20</sub>  m<sub>21</sub>  m<sub>22</sub>  m<sub>23</sub> ] [ z ]
  [ t ]     [ m<sub>30</sub>  m<sub>31</sub>  m<sub>32</sub>  m<sub>33</sub> ] [ 1 ]
 
    x' = u/t
    y' = v/t
    y' = w/t
 

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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.
dstOff - The offset to the location of the first transformed point that is stored in the destination array. The source and destination array sections can be overlaps.
numPts - The number of points to be transformed

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this matrix. Point coordinates must have a dimension equals to GMatrix.getNumCol()-1. For example, for square matrix of size 4×4, coordinate points are three-dimensional and stored in the arrays starting at the specified offset (srcOff) in the order [x0, y0, z0, x1, y1, z1..., xn, yn, zn]. The transformed points (x',y',z') are computed as below (note that this computation is similar to PerspectiveTransform):
  [ u ]     [ m<sub>00</sub>  m<sub>01</sub>  m<sub>02</sub>  m<sub>03</sub> ] [ x ]
  [ v ]  =  [ m<sub>10</sub>  m<sub>11</sub>  m<sub>12</sub>  m<sub>13</sub> ] [ y ]
  [ w ]     [ m<sub>20</sub>  m<sub>21</sub>  m<sub>22</sub>  m<sub>23</sub> ] [ z ]
  [ t ]     [ m<sub>30</sub>  m<sub>31</sub>  m<sub>32</sub>  m<sub>33</sub> ] [ 1 ]
 
    x' = u/t
    y' = v/t
    y' = w/t
 

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.
dstOff - The offset to the location of the first transformed point that is stored in the destination array. The source and destination array sections can be overlaps.
numPts - The number of points to be transformed

derivative

public Matrix derivative(Point2D point)
Gets the derivative of this transform at a point. For a matrix transform, the derivative is the same everywhere.

Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point as a 2x2 matrix.
See Also:
MathTransform2D.derivative(Point2D)

derivative

public Matrix derivative(CoordinatePoint point)
Gets the derivative of this transform at a point. For a matrix transform, the derivative is the same everywhere.

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

getMatrix

public Matrix getMatrix()
Returns a copy of the matrix.


getDimSource

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

Specified by:
getDimSource in interface MathTransform
Returns:
the dimension of input points.
See Also:
"org.opengis.ct.CT_MathTransform#getDimSource()"

getDimTarget

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

Specified by:
getDimTarget in interface MathTransform
Returns:
the dimension of output points.
See Also:
"org.opengis.ct.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.

inverse

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

Specified by:
inverse in interface MathTransform
Overrides:
inverse in class AbstractMathTransform
Returns:
The inverse transform.
Throws:
NoninvertibleTransformException - if the transform can't be inversed.

hashCode

public int hashCode()
Returns a hash value for this transform. This value need not remain consistent between different implementations of the same class.

Overrides:
hashCode in class AbstractMathTransform

equals

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

Overrides:
equals in class AbstractMathTransform

toString

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

Overrides:
toString in class AbstractMathTransform

toString

static String toString(Matrix matrix)
Returns the WKT for an affine transform using the specified matrix.


deegree 2.1 (2007/11/08 09:57 build-328-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net