DefaultWCCoordinateHandler.h

Classes

DefaultWCCoordinateHandler -- Class to provide default coordinate handling for WorldCanvases. (full description)

class DefaultWCCoordinateHandler : public WCCoordinateHandler

Interface

Public Members
DefaultWCCoordinateHandler()
virtual Bool linToWorld(Vector<Double> & world, const Vector<Double> & lin)
virtual Bool linToWorld(Matrix<Double> & world, Vector<Bool> & failures, const Matrix<Double> & lin)
virtual Bool worldToLin(Vector<Double> & lin, const Vector<Double> & world)
virtual Bool worldToLin(Matrix<Double> & lin, Vector<Bool> & failures, const Matrix<Double> & world)
virtual uInt nWorldAxes() const
virtual Vector<String> worldAxisNames()
virtual Vector<String> worldAxisUnits()
virtual ~DefaultWCCoordinateHandler()

Description

Prerequisite

Etymology

DefaultWCCoordinateHandler stands for Default WorldCanvas Coordinate Handler

Synopsis

Implements identity transformation function pairs between World Coordinates and linear coordinates. It assumes 2 axes only.

Motivation

Recognized that 95% of the time the WorldCanvas will be used in conjunction with a world coordinate system of some kind. So it makes more sense to assume that there is always a coordinate handler available and use it rather than to have to check to see if there is a handler registered with the WorldCanvas or not each time you have to do a transformation.

The WorldCanvas creates this default handler for its own purpose.

Member Description

DefaultWCCoordinateHandler()

Default Constructor Required

virtual Bool linToWorld(Vector<Double> & world, const Vector<Double> & lin)
virtual Bool linToWorld(Matrix<Double> & world, Vector<Bool> & failures, const Matrix<Double> & lin)
virtual Bool worldToLin(Vector<Double> & lin, const Vector<Double> & world)
virtual Bool worldToLin(Matrix<Double> & lin, Vector<Bool> & failures, const Matrix<Double> & world)

just copy lin to world and vice versa. The input vectors must be of length 2. The output vectors are resized as needed. The output matrices must be the correct shape on input.

virtual uInt nWorldAxes() const

return the number of world axes. Always 2.

virtual Vector<String> worldAxisNames()
virtual Vector<String> worldAxisUnits()

Routines that give the axes names and the units. Both return "Pixel".

virtual ~DefaultWCCoordinateHandler()

Destructor