jview
Interface CoordinateTransforming

All Known Subinterfaces:
DeltaFormattedTransforming, DeltaTransforming, FormattedTransforming, InvertableTransforming
All Known Implementing Classes:
AbstractFormattingTransform, BasicTransform, CylindricalEqualAreaProjection, CylindricalEquidistantProjection, CylindricalProjection, DssTransformation, JFitsCanvas.PixelCoordinate, MercatorProjection, OrthographicTransformation, SelectTransform, Transform2D, Wcs.GnomicProjection

public interface CoordinateTransforming

An interface defining the capabilities to convert from user-space coordinates to normalized 2-d coordinates. This interface is used whenever the user provides multi-dimensional data that should be plotted onto a component. Thus, two methods are provided, toNormalizedSpace(vec_math.VectorG) and toUserSpace(java.awt.geom.Point2D). Note that not all coordination transformation must be invertable, thus transformations that do not support toUserSpace(java.awt.geom.Point2D) should throw an illegal argument exception.


Method Summary
 Point2D toNormalizedSpace(VectorG user)
          Converts a multi-dimensional input vector defined in a user-space coordinate system into the normalized screen coordinate system.
 VectorG toUserSpace(Point2D norm)
          Converts a pixel in normalized space back to user space.
 

Method Detail

toNormalizedSpace

Point2D toNormalizedSpace(VectorG user)
Converts a multi-dimensional input vector defined in a user-space coordinate system into the normalized screen coordinate system. Scaling and viewport selection is then imposed on the point returned here.

Parameters:
user - A vector of user coordinates.
Returns:
A point in normalized screen coordinate, with 0≤x,y≤1

toUserSpace

VectorG toUserSpace(Point2D norm)
Converts a pixel in normalized space back to user space. This inversion may be ambiguous, e.g. if the user space has more than two coordinates. It is within the implementation to decide, if the inversion can be performed. If not, an illegal argument exception should be thrown rather then returning null.

Parameters:
norm - A pixel in normalized coordinates.
Returns:
A vector in user space, never null
Throws:
IllegalArgumentException - If the user space vector cannot be found.