casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WCCoordinateHandler.h
Go to the documentation of this file.
1 //# WCCoordinateHandler.h: interface for coordinate handling on WorldCanvas
2 //# Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_WCCOORDINATEHANDLER_H
29 #define TRIALDISPLAY_WCCOORDINATEHANDLER_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
33 
34 namespace casacore{
35 
36  template <class T> class Matrix;
37 }
38 
39 namespace casa { //# NAMESPACE CASA - BEGIN
40 
41 
42 // <summary>
43 // Base class defining a set of transformations for WorldCanvas coordinates.
44 // </summary>
45 //
46 // <prerequisite>
47 // <li> Understanding of non-linear World casacore::Coordinate Systems
48 // </prerequisite>
49 //
50 // <etymology>
51 // WCCoordinateHandler : WorldCanvas casacore::Coordinate Handler
52 // </etymology>
53 //
54 // <synopsis>
55 // The WCCoordinateHandler class implements the concept of a coordinate
56 // transformation pair that can be plugged in to the
57 // <linkto class="WorldCanvas">WorldCanvas</linkto>. It is designed for
58 // derivation by the programmer and can thereby be arbitrarily implemented.
59 //
60 // This class defines an interface between the WorldCanvas, which uses
61 // coordinate transformations for various reasons, and the derived class
62 // that implements these coordinate transformations.
63 //
64 // The designer of the derived class must write the casacore::Vector&ltDouble&gt versions
65 // of linToWorld and worldToLin as described in detail below. It is also
66 // recommended that the casacore::Matrix&ltDouble&gt versions of linToWorld and worldToLin
67 // be written to maximize efficiency.
68 // </synopsis>
69 //
70 // <motivation>
71 // <ul>
72 // <li>Needed to plug in a user-programmable coordinate transformation functions into
73 // the world canvas in a convenient way.
74 // <li> Wanted to bundle these transformations
75 // into a class to follow OO methods.
76 // </motivation>
77 //
78 // <example>
79 // <linkto class="DefaultWCCoordinateHandler">DefaultWCCoordinateHandler</linkto>
80 // </example>
81 //
82 
84 
85  public:
86 
87  // Default Constructor Required
89 
90  // transform the lin point (2-dimensional) into a world coordinate
91  // (N-dimensional), returning false if the coordinate could not be
92  // transformed. Derived classes should override.
94  const casacore::Vector<casacore::Double> & lin) = 0;
95 
96  // Batch transformation where each row of lin is a coordinate that
97  // is transformed into each row of world. On input, if the i'th
98  // position in the failures vector is true, the i'th transformation
99  // is not attempted. If the j'th transformation fails, the j'th
100  // position in the failures vector will be set. The return value is
101  // true only when the failures vector has no position set to true;
102  // This function is implemented in this base class by making
103  // repeated calls to the casacore::Vector<casacore::Double> version of linToWorld.
107 
108  // transform the world point (N-dimensional) into a lin coordinate
109  // (2-dimensional), returning false if the coordinate could not be
110  // transformed. Derived classes should override.
112  const casacore::Vector<casacore::Double> & world) = 0;
113 
114  // Batch transformation where each row of world is a coordinate that
115  // is transformed into each row of lin. On input, if the i'th
116  // position in the failures vector is true, the i'th transformation
117  // is not attempted. If the j'th transformation fails, the j'th
118  // position in the failures vector will be set. The return value is
119  // true only when the failures vector has no position set to true;
120  // This function is implemented in this base class by making
121  // repeated calls to the casacore::Vector<casacore::Double> version of worldToLin.
124  const casacore::Matrix<casacore::Double> & world);
125 
126  virtual std::string errorMessage( ) const = 0;
127 
128  // Return the number of axes in the world coordinates
129  virtual casacore::uInt nWorldAxes() const = 0;
130 
131  // Routines that give the axes names and the unit.
132  // <group>
133  /* virtual casacore::Vector<casacore::String> worldAxisNames() = 0; */
134  /* virtual casacore::Vector<casacore::String> worldAxisUnits() = 0; */
135  // </group>
136 
137  // Destructor
138  virtual ~WCCoordinateHandler();
139 
140  };
141 
142 
143 } //# NAMESPACE CASA - END
144 
145 #endif
virtual casacore::Bool worldToLin(casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world)=0
transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning false if t...
Base class defining a set of transformations for WorldCanvas coordinates.
virtual ~WCCoordinateHandler()
Routines that give the axes names and the unit.
virtual casacore::Bool linToWorld(casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin)=0
transform the lin point (2-dimensional) into a world coordinate (N-dimensional), returning false if t...
virtual casacore::uInt nWorldAxes() const =0
Return the number of axes in the world coordinates.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
WCCoordinateHandler()
Default Constructor Required.
unsigned int uInt
Definition: aipstype.h:51
virtual std::string errorMessage() const =0
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42