org.grinvin.gred.transformations

Class AbstractTransformation

Implemented Interfaces:
Transformation
Known Direct Subclasses:
AffineTransformation, OrthogonalProjection

public abstract class AbstractTransformation
extends TransformationSupport
implements Transformation

Common super class of most implementations of Transformation.

Method Summary

abstract int
getDimension()
Return the dimension of the source space.
void
inverseTransform(double x, double y, double[] result)
This implementation always raises an exception.
boolean
isInvertible()
This default implementation always returns false.
abstract double[]
transform(double[] src, double[] dest)
Transform the given set of coordinates from source space to destination space.

Methods inherited from class org.grinvin.gred.transformations.TransformationSupport

addTransformationListener, fireTransformationChanged, removeTransformationListener

Method Details

getDimension

public abstract int getDimension()
Return the dimension of the source space.
Specified by:
getDimension in interface Transformation

inverseTransform

public void inverseTransform(double x,
                             double y,
                             double[] result)
            throws IllegalStateException
This implementation always raises an exception.
Specified by:
inverseTransform in interface Transformation

isInvertible

public boolean isInvertible()
This default implementation always returns false.
Specified by:
isInvertible in interface Transformation

transform

public abstract double[] transform(double[] src,
                                   double[] dest)
Transform the given set of coordinates from source space to destination space.
Specified by:
transform in interface Transformation
Parameters:
src - Coordinates in the n-dimensin
dest - Array into which the resulting coordinates shall be stored
Returns:
a reference to dest.