Class ncsa.horizon.coordinates.transforms.MultiCoordTransform
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.coordinates.transforms.MultiCoordTransform

java.lang.Object
   |
   +----java.util.Observable
           |
           +----ncsa.horizon.coordinates.CoordTransform
                   |
                   +----ncsa.horizon.coordinates.transforms.MultiCoordTransform

public class MultiCoordTransform
extends CoordTransform
implements Observer
a container for combining a chain of CoordTransform objects into a single CoordTransform. See the documentation for the super class, CoordTransform, for a general description of how a transform is used.

Several CoordTransforms may be strung together within this container via successive calls to addTransform(). Then one can attach this composite transform to a CoordinateSystem via the system's attachTransform() method. It is possible to add additional transforms even after it is attached to a system, causing the system to use the new transforms; however, this should be done with care.


Variable Index

 o transdirs
 o transforms
 o transmaps

Constructor Index

 o MultiCoordTransform()

Method Index

 o addTransform(CoordTransform)
add a forward coordinate transform to this composite assuming an axis index list of { 0, ..., t.getInAxes()-1 }.
 o addTransform(CoordTransform, boolean)
add a coordinate transform to this composite assuming an axis index list of { 0, ..., t.getInAxes()-1 }.
 o addTransform(CoordTransform, CoordTransformConstraints)
add a coordinate transform to this system with
 o determineConstraints(Metadata, boolean)
make an educated guess as to the proper way to apply this transform to a coordinate system with the specified Metadata.
 o forward(double[])
apply a forward tranform on an input position.
 o forward(double[], int[])
apply a forward transform on an input position.
 o getInNaxes()
return the minimum number of axes that the forward transform operates on.
 o getMetadata(Metadata, boolean, int[])
update the input Metadata object to reflect the changes that this tranform makes to a coordinate position.
 o getNTransforms()
return the number of transforms that make up this composite transform.
 o getOutNaxes()
return the minimum number of axes that results from the forward transform.
 o init(CoordinateSystem, boolean, int[])
initialize this transform according to the system it is to be applied to.
 o popAllTransforms()
remove and return all removable CoordTransform objects currently attached to this CoordinateSystem.
 o popTransform()
remove and return the last CoordTransform object added to this CoordinateSystem, or null if no transforms are currently in this container.
 o removeAllTransforms()
remove all removable CoordTransform object currently attached to this CoordinateSystem.
 o reverse(double[])
apply a reverse tranform on an input position.
 o reverse(double[], int[])
apply a reverse tranform on an input position
 o update(Observable, Object)
notify any observers of this object that one or more the component transforms has had an internal change of state.

Variables

 o transforms
  protected Stack transforms
 o transmaps
  protected Stack transmaps
 o transdirs
  protected Stack transdirs

Constructors

 o MultiCoordTransform
  public MultiCoordTransform()

Methods

 o forward
  public double[] forward(double position[],
                          int axisIndices[]) throws PositionBeyondDomainException, TransformUndefinedException
apply a forward transform on an input position.
Parameters:
position - an array giving the input position to transform
axisIndices - an array containing the indices of the position array that should be used in the tranformation. The order of the indices indicate how the position should be interpreted by the transform.
Overrides:
forward in class CoordTransform
 o forward
  public double[] forward(double position[]) throws PositionBeyondDomainException, TransformUndefinedException
apply a forward tranform on an input position. A list of axis indices is assumed (usually { 0, ... getInNAxes()-1 }).
Parameters:
position - an array giving the input position to transform
Overrides:
forward in class CoordTransform
 o reverse
  public double[] reverse(double position[],
                          int axisIndices[]) throws PositionBeyondDomainException, TransformUndefinedException
apply a reverse tranform on an input position
Parameters:
position - an array giving the input position to transform
axisIndices - an array containing the indices of the position array that should be used in the tranformation. The order of the indices indicate how the position should be interpreted by the transform.
Overrides:
reverse in class CoordTransform
 o reverse
  public double[] reverse(double position[]) throws PositionBeyondDomainException, TransformUndefinedException
apply a reverse tranform on an input position. A list of axis indices is assumed (usually { 0, ... getOutNAxes()-1 }).
Parameters:
position - an array giving the input position to transform
Overrides:
reverse in class CoordTransform
 o getInNaxes
  public synchronized int getInNaxes()
return the minimum number of axes that the forward transform operates on. This value is equal to the minimum number of axes that results from the reverse transform. This value is often equal to the that returned by getOutNaxes(), but is not required to.
Overrides:
getInNaxes in class CoordTransform
 o getOutNaxes
  public synchronized int getOutNaxes()
return the minimum number of axes that results from the forward transform. This value is equal to the minimum number of axes that the reverse transform operates on. This value is often equal to the that returned by getInNaxes(), but is not required to.
Overrides:
getOutNaxes in class CoordTransform
 o init
  public synchronized void init(CoordinateSystem csys,
                                boolean forward,
                                int axisIndices[])
initialize this transform according to the system it is to be applied to. This method is usually called by a CoordinateSystem object when the transform is attached to it. By default, this method does nothing; however, sub-classers have the option of overriding this method.
Overrides:
init in class CoordTransform
 o getMetadata
  public Metadata getMetadata(Metadata in,
                              boolean forward,
                              int axisIndices[])
update the input Metadata object to reflect the changes that this tranform makes to a coordinate position. This method will actually edit the contents of the input Metadata.
Parameters:
in - the Metadata list to update
forward - if true, assume the transform is being applied in the forward direction; otherwise, assume reverse
axisIndices - the index list that describes which axes this transform will operate on; should not be null.
Overrides:
getMetadata in class CoordTransform
 o determineConstraints
  public synchronized CoordTransformConstraints determineConstraints(Metadata in,
                                                                     boolean forwards)
make an educated guess as to the proper way to apply this transform to a coordinate system with the specified Metadata.
Parameters:
in - the Metadata describing the system to be transformed
forwards - if false, the constraints determined should be for attaching the reverse of the transform
Returns:
CoordTransformConstraints the resulting guess, null if the transform cannot be logically applied
Overrides:
determineConstraints in class CoordTransform
 o addTransform
  public synchronized void addTransform(CoordTransform t,
                                        CoordTransformConstraints c) throws IllegalArgumentException, NullPointerException
add a coordinate transform to this system with
Parameters:
t - the transform to be atached
c - the constraints by which to add the transform
 o addTransform
  public synchronized void addTransform(CoordTransform t,
                                        boolean addForwards) throws NullPointerException
add a coordinate transform to this composite assuming an axis index list of { 0, ..., t.getInAxes()-1 }.
Parameters:
t - the transform to be atached
addForwards - if true, the reverse transform should be added
 o addTransform
  public void addTransform(CoordTransform t) throws NullPointerException
add a forward coordinate transform to this composite assuming an axis index list of { 0, ..., t.getInAxes()-1 }.
Parameters:
t - the transform to be atached
Throws: IllegalTransformException
if transform cannot be implicitly added in the forward direction
 o getNTransforms
  public int getNTransforms()
return the number of transforms that make up this composite transform.
 o popTransform
  public synchronized CoordTransform popTransform()
remove and return the last CoordTransform object added to this CoordinateSystem, or null if no transforms are currently in this container.
 o popAllTransforms
  public synchronized Stack popAllTransforms()
remove and return all removable CoordTransform objects currently attached to this CoordinateSystem.
Returns:
Stack a list of the CoordTransform object, beginning with the first one that was attached and ending with the last one.
 o removeAllTransforms
  public synchronized void removeAllTransforms()
remove all removable CoordTransform object currently attached to this CoordinateSystem. (If no other objects have references to the transform objects, the Garbage collector will recover their memory.)
 o update
  public void update(Observable o,
                     Object arg)
notify any observers of this object that one or more the component transforms has had an internal change of state.

All Packages  Class Hierarchy  This Package  Previous  Next  Index