    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.

##

transdirs
transforms
transmaps

##

MultiCoordTransform()

##

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

##

transforms

      protected Stack transforms

transmaps

      protected Stack transmaps

transdirs

      protected Stack transdirs

##

MultiCoordTransform

      public MultiCoordTransform()

##

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

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

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

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

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

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

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

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

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

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

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

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

getNTransforms

      public int getNTransforms()

  return the number of transforms that make up this composite transform.

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.

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.

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

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