casa
$Rev:20696$
|
00001 //# DefaultWCCoordinateHandler.h: default coordinate handling for WorldCanvas 00002 //# Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef TRIALDISPLAY_DEFAULTWCCOORDINATEHANDLER_H 00029 #define TRIALDISPLAY_DEFAULTWCCOORDINATEHANDLER_H 00030 00031 #include <casa/aips.h> 00032 #include <display/DisplayCanvas/WCCoordinateHandler.h> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 // <summary> 00037 // Class to provide default coordinate handling for WorldCanvases. 00038 // </summary> 00039 // 00040 // <prerequisite> 00041 // <li> <linkto class="WCCoordinateHandler">WCCoordinateHandler</linkto> 00042 // <li> <linkto class="CoordinateSystem">CoordinateSystem</linkto> 00043 // </prerequisite> 00044 // 00045 // <etymology> 00046 // DefaultWCCoordinateHandler stands for Default WorldCanvas Coordinate Handler 00047 // </etymology> 00048 // 00049 // <synopsis> 00050 // Implements identity transformation function pairs between World Coordinates 00051 // and linear coordinates. It assumes 2 axes only. 00052 // </synopsis> 00053 // 00054 // <motivation> 00055 // Recognized that 95% of the time the WorldCanvas will be used in 00056 // conjunction with a world coordinate system of some kind. So it makes 00057 // more sense to assume that there is always a coordinate handler available 00058 // and use it rather than to have to check to see if there is a handler 00059 // registered with the WorldCanvas or not each time you have to do a 00060 // transformation. 00061 // 00062 // The WorldCanvas creates this default handler for its own purpose. 00063 // </motivation> 00064 // 00065 00066 class DefaultWCCoordinateHandler : public WCCoordinateHandler { 00067 00068 public: 00069 00070 // Default Constructor Required 00071 DefaultWCCoordinateHandler(); 00072 00073 // just copy lin to world and vice versa. The input vectors must be of 00074 // length 2. The output vectors are resized as needed. The output matrices 00075 // must be the correct shape on input. 00076 // <group> 00077 virtual Bool linToWorld(Vector<Double> & world, const Vector<Double> & lin); 00078 virtual Bool linToWorld(Matrix<Double> & world, 00079 Vector<Bool> & failures, 00080 const Matrix<Double> & lin); 00081 virtual Bool worldToLin(Vector<Double> & lin, const Vector<Double> & world); 00082 virtual Bool worldToLin(Matrix<Double> & lin, 00083 Vector<Bool> & failures, 00084 const Matrix<Double> & world); 00085 // </group> 00086 00087 // return the number of world axes. Always 2. 00088 virtual uInt nWorldAxes() const { return 2; } 00089 00090 // Routines that give the axes names and the units. Both return "Pixel". 00091 // <group> 00092 virtual Vector<String> worldAxisNames() const; 00093 virtual Vector<String> worldAxisUnits() const; 00094 // </group> 00095 00096 // Destructor 00097 virtual ~DefaultWCCoordinateHandler(); 00098 00099 }; 00100 00101 00102 } //# NAMESPACE CASA - END 00103 00104 #endif 00105 00106