org.deegree.cs.transformations.coordinate
Class ConcatenatedTransform

java.lang.Object
  extended by org.deegree.cs.CRSIdentifiable
      extended by org.deegree.cs.transformations.Transformation
          extended by org.deegree.cs.transformations.coordinate.ConcatenatedTransform
All Implemented Interfaces:
Object, TypedObjectNode, CRSResource

public class ConcatenatedTransform
extends Transformation

The ConcatenatedTransform class allows the connection of two transformations.

Calling inverse on this transformation will invert the whole underlying transformation chain. For example, if A * (B *C)=D and D is this transformation calling D.inverse() will result in (C.inverse * B.inverse) * A.inverse.

Version:
$Revision: 31960 $, $Date: 2011-09-21 08:00:30 +0200 (Wed, 21 Sep 2011) $
Author:
Rutger Bezema, last edited by: $Author: lbuesching $

Constructor Summary
ConcatenatedTransform(Transformation first, Transformation second)
          Creates a transform by concatenating two existing transforms.
ConcatenatedTransform(Transformation first, Transformation second, CRSResource id)
          Creates a transform by concatenating two existing transforms.
 
Method Summary
static Transformation concatenate(Transformation step1, Transformation step2)
          Concatenate two transformations.
static Transformation concatenate(Transformation step1, Transformation step2, boolean keepIdentity)
          Concatenate two transformations.
static Transformation concatenate(Transformation step1, Transformation step2, Transformation step3)
          Concatenate three transformations into one.
static Transformation concatenate(Transformation step1, Transformation step2, Transformation step3, boolean keepIdentity)
          Concatenate three transformations into one.
 boolean contains(ICRS crs)
          Returns true if this Transformation transforms over the given crs.
 List<javax.vecmath.Point3d> doTransform(List<javax.vecmath.Point3d> srcPts)
          Do a transformation, e.g. the incoming data will be transformed into other coordinates.
 Transformation getFirstTransform()
           
 String getImplementationName()
           
 Transformation getSecondTransform()
           
 void inverse()
          This method flags the transformation about it's state.
 boolean isIdentity()
           
 
Methods inherited from class org.deegree.cs.transformations.Transformation
areInverse, canTransform, copyTransformation, createFromTo, doTransform, doTransform, equalOnCRS, equals, getSourceCRS, getSourceDimension, getTargetCRS, getTargetDimension, getTransformationName, getTransformationPath, isInverseTransform, setSourceCRS
 
Methods inherited from class org.deegree.cs.CRSIdentifiable
addAreaOfUse, addName, checkForNullObject, checkForNullObject, checkForNullObject, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getId, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hashCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConcatenatedTransform

public ConcatenatedTransform(Transformation first,
                             Transformation second,
                             CRSResource id)
Creates a transform by concatenating two existing transforms. A concatenated transform applies two transforms, one after the other. The dimension of the output space of the first transform must match the dimension of the input space in the second transform.

Parameters:
first - The first transformation to apply to given points.
second - The second transformation to apply to given points.
id - an identifiable instance containing information about this transformation

ConcatenatedTransform

public ConcatenatedTransform(Transformation first,
                             Transformation second)
Creates a transform by concatenating two existing transforms. A concatenated transform applies two transforms, one after the other. The dimension of the output space of the first transform must match the dimension of the input space in the second transform. Creates an CRSIdentifiable using the Transformation.createFromTo(String, String) method.

Parameters:
first - The first transformation to apply to given points.
second - The second transformation to apply to given points.
Method Detail

doTransform

public List<javax.vecmath.Point3d> doTransform(List<javax.vecmath.Point3d> srcPts)
                                        throws TransformationException
Description copied from class: Transformation
Do a transformation, e.g. the incoming data will be transformed into other coordinates.

Specified by:
doTransform in class Transformation
Parameters:
srcPts - the points which must be transformed, expected are following values either, long_1, lat_1, height_1, long_2, lat_2, height_2. or long_1, lat_1, long_2, lat_2
Returns:
the transformed points
Throws:
TransformationException - if a transform could not be calculated.

inverse

public void inverse()
Description copied from class: Transformation
This method flags the transformation about it's state. If this transformation was inverse calling this method will result in a forward transformation and vice versa.

Overrides:
inverse in class Transformation

isIdentity

public boolean isIdentity()
Specified by:
isIdentity in class Transformation
Returns:
true if this transformation doesn't transform the incoming points. (e.g. is the id. matrix)

getFirstTransform

public final Transformation getFirstTransform()
Returns:
the firstTransform, which is the second transformation if this transform is inverse.

getSecondTransform

public final Transformation getSecondTransform()
Returns:
the secondTransform, which is the first transformation if this transform is inverse.

getImplementationName

public String getImplementationName()
Specified by:
getImplementationName in class Transformation
Returns:
the name of the transformation.

contains

public boolean contains(ICRS crs)
Description copied from class: Transformation
Returns true if this Transformation transforms over the given crs.

Overrides:
contains in class Transformation
Parameters:
crs - to check for
Returns:
true if the given crs is used in this transformation.

concatenate

public static Transformation concatenate(Transformation step1,
                                         Transformation step2,
                                         boolean keepIdentity)
Concatenate two transformations.

Parameters:
step1 - The first step, or null for the identity transform.
step2 - The second step, or null for the identity transform.
keepIdentity - true if identity Transformations should be kept in the resulting ConcatenatedTransform . Default value is false.
Returns:
A concatenated transform, or null if all arguments was nul.

concatenate

public static Transformation concatenate(Transformation step1,
                                         Transformation step2)
Concatenate two transformations.

Parameters:
step1 - The first step, or null for the identity transform.
step2 - The second step, or null for the identity transform.
Returns:
A concatenated transform, or null if all arguments was nul.

concatenate

public static Transformation concatenate(Transformation step1,
                                         Transformation step2,
                                         Transformation step3,
                                         boolean keepIdentity)
Concatenate three transformations into one.

Parameters:
step1 - The first step, or null for the identity transform.
step2 - The second step, or null for the identity transform.
step3 - The third step, or null for the identity transform.
keepIdentity - true if identity Transformations should be kept in the resulting ConcatenatedTransform . Default value is false.
Returns:
A concatenated transform, or null if all arguments were null.

concatenate

public static Transformation concatenate(Transformation step1,
                                         Transformation step2,
                                         Transformation step3)
Concatenate three transformations into one.

Parameters:
step1 - The first step, or null for the identity transform.
step2 - The second step, or null for the identity transform.
step3 - The third step, or null for the identity transform.
Returns:
A concatenated transform, or null if all arguments were null.


Copyright © 2011. All Rights Reserved.