casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::DefaultWCCoordinateHandler Class Reference

Class to provide default coordinate handling for WorldCanvases. More...

#include <DefaultWCCoordinateHandler.h>

Inheritance diagram for casa::DefaultWCCoordinateHandler:
casa::WCCoordinateHandler

List of all members.

Public Member Functions

 DefaultWCCoordinateHandler ()
 Default Constructor Required.
virtual Bool linToWorld (Vector< Double > &world, const Vector< Double > &lin)
 just copy lin to world and vice versa.
virtual Bool linToWorld (Matrix< Double > &world, Vector< Bool > &failures, const Matrix< Double > &lin)
 Batch transformation where each row of lin is a coordinate that is transformed into each row of world.
virtual Bool worldToLin (Vector< Double > &lin, const Vector< Double > &world)
 transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning False if the coordinate could not be transformed.
virtual Bool worldToLin (Matrix< Double > &lin, Vector< Bool > &failures, const Matrix< Double > &world)
 Batch transformation where each row of world is a coordinate that is transformed into each row of lin.
virtual uInt nWorldAxes () const
 return the number of world axes.
virtual Vector< StringworldAxisNames () const
 Routines that give the axes names and the units.
virtual Vector< StringworldAxisUnits () const
virtual ~DefaultWCCoordinateHandler ()
 Destructor.

Detailed Description

Class to provide default coordinate handling for WorldCanvases.

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.

Definition at line 66 of file DefaultWCCoordinateHandler.h.


Constructor & Destructor Documentation

Default Constructor Required.

Destructor.


Member Function Documentation

virtual Bool casa::DefaultWCCoordinateHandler::linToWorld ( Vector< Double > &  world,
const Vector< Double > &  lin 
) [virtual]

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.

Implements casa::WCCoordinateHandler.

virtual Bool casa::DefaultWCCoordinateHandler::linToWorld ( Matrix< Double > &  world,
Vector< Bool > &  failures,
const Matrix< Double > &  lin 
) [virtual]

Batch transformation where each row of lin is a coordinate that is transformed into each row of world.

On input, if the i'th position in the failures vector is true, the i'th transformation is not attempted. If the j'th transformation fails, the j'th position in the failures vector will be set. The return value is True only when the failures vector has no position set to True; This function is implemented in this base class by making repeated calls to the Vector<Double> version of linToWorld.

Reimplemented from casa::WCCoordinateHandler.

virtual uInt casa::DefaultWCCoordinateHandler::nWorldAxes ( ) const [inline, virtual]

return the number of world axes.

Always 2.

Implements casa::WCCoordinateHandler.

Definition at line 88 of file DefaultWCCoordinateHandler.h.

Routines that give the axes names and the units.

Both return "Pixel".

virtual Bool casa::DefaultWCCoordinateHandler::worldToLin ( Vector< Double > &  lin,
const Vector< Double > &  world 
) [virtual]

transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning False if the coordinate could not be transformed.

Derived classes should override.

Implements casa::WCCoordinateHandler.

virtual Bool casa::DefaultWCCoordinateHandler::worldToLin ( Matrix< Double > &  lin,
Vector< Bool > &  failures,
const Matrix< Double > &  world 
) [virtual]

Batch transformation where each row of world is a coordinate that is transformed into each row of lin.

On input, if the i'th position in the failures vector is true, the i'th transformation is not attempted. If the j'th transformation fails, the j'th position in the failures vector will be set. The return value is True only when the failures vector has no position set to True; This function is implemented in this base class by making repeated calls to the Vector<Double> version of worldToLin.

Reimplemented from casa::WCCoordinateHandler.


The documentation for this class was generated from the following file: