org.geotoolkit.referencing.operation.transform
Class AbstractMathTransform2D

Object
  extended by FormattableObject
      extended by AbstractMathTransform
          extended by AbstractMathTransform2D
All Implemented Interfaces:
Formattable, Parameterized, LenientComparable, MathTransform, MathTransform2D
Direct Known Subclasses:
UnitaryProjection

@ThreadSafe
public abstract class AbstractMathTransform2D
extends AbstractMathTransform
implements MathTransform2D

Base class for math transforms that are known to be two-dimensional in all cases. Two-dimensional math transforms are not required to extend this class, however doing so may simplify their implementation.

Since:
2.0
Version:
3.00
Author:
Martin Desruisseaux (Geomatys)
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
protected  class AbstractMathTransform2D.Inverse
          Default implementation for inverse math transform.
protected static class AbstractMathTransform2D.Parameters
          The parameters of the enclosing transform as a tuple of (normalizenon-linear kerneldenormalize) transforms.
 
Field Summary
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Constructor Summary
protected AbstractMathTransform2D()
          Constructs a default math transform.
 
Method Summary
 ParameterDescriptorGroup getParameterDescriptors()
          Returns the parameter descriptors for this math transform, or null if unknown.
 int getSourceDimensions()
          Returns the dimension of input points, which is always 2.
 int getTargetDimensions()
          Returns the dimension of output points, which is always 2.
protected  AbstractMathTransform2D.Parameters getUnmarshalledParameters()
          Returns the parameters of this transform as a tuple of (normalizenon-linear kerneldenormalize) transforms.
 MathTransform2D inverse()
          Returns the inverse transform of this object.
 Point2D transform(Point2D ptSrc, Point2D ptDst)
          Transforms the specified ptSrc and stores the result in ptDst.
 
Methods inherited from class AbstractMathTransform
computeHashCode, createTransformedShape, derivative, derivative, ensureNonNull, equals, equals, formatWKT, getName, getParameterValues, hashCode, isIdentity, rollLongitude, transform, transform, transform, transform, transform, transform
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface MathTransform2D
createTransformedShape, derivative
 
Methods inherited from interface MathTransform
derivative, isIdentity, toWKT, transform, transform, transform, transform, transform
 

Constructor Detail

AbstractMathTransform2D

protected AbstractMathTransform2D()
Constructs a default math transform.

Method Detail

getSourceDimensions

public final int getSourceDimensions()
Returns the dimension of input points, which is always 2.

Specified by:
getSourceDimensions in interface MathTransform
Specified by:
getSourceDimensions in class AbstractMathTransform

getTargetDimensions

public final int getTargetDimensions()
Returns the dimension of output points, which is always 2.

Specified by:
getTargetDimensions in interface MathTransform
Specified by:
getTargetDimensions in class AbstractMathTransform

transform

public Point2D transform(Point2D ptSrc,
                         Point2D ptDst)
                  throws TransformException
Transforms the specified ptSrc and stores the result in ptDst. The default implementation invokes AbstractMathTransform.transform(double[],int,double[],int) using a temporary array of doubles.

Specified by:
transform in interface MathTransform2D
Overrides:
transform in class AbstractMathTransform
Parameters:
ptSrc - The coordinate point to be transformed.
ptDst - The coordinate point that stores the result of transforming ptSrc, or null if a new point should be created.
Returns:
The coordinate point after transforming ptSrc and storing the result in ptDst, or in a new point if ptDst was null.
Throws:
TransformException - If the point can't be transformed.
See Also:
MathTransform2D.transform(Point2D,Point2D)

inverse

public MathTransform2D inverse()
                        throws NoninvertibleTransformException
Returns the inverse transform of this object. The default implementation returns this if this transform is an identity transform, and throws a NoninvertibleTransformException otherwise. Subclasses should override this method.

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

getParameterDescriptors

public ParameterDescriptorGroup getParameterDescriptors()
Returns the parameter descriptors for this math transform, or null if unknown. The default implementation returns the descriptor associated to the object returned by getUnmarshalledParameters() if there is one, or null otherwise.

Specified by:
getParameterDescriptors in interface Parameterized
Overrides:
getParameterDescriptors in class AbstractMathTransform
Returns:
The parameter descriptors for this math transform, or null.
See Also:
OperationMethod.getParameters()

getUnmarshalledParameters

protected AbstractMathTransform2D.Parameters getUnmarshalledParameters()
Returns the parameters of this transform as a tuple of (normalizenon-linear kerneldenormalize) transforms. The default implementation returns null in all case, which means that there is no such tuple.

This method is used mostly for Geotk implementation of map projections. Most users should consider this method as internal to Geotk mechanic.

Returns:
The tuple of (normalizenon-linear kerneldenormalize) transforms, or null if none.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.