00001 //# LELLattCoord.h: The base letter class for lattice coordinates in LEL 00002 //# Copyright (C) 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 LATTICES_LELLATTCOORD_H 00029 #define LATTICES_LELLATTCOORD_H 00030 00031 00032 //# Includes 00033 #include <casacore/casa/aips.h> 00034 #include <casacore/lattices/LEL/LELLattCoordBase.h> 00035 #include <casacore/casa/BasicSL/String.h> 00036 00037 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00038 00039 //# Forward Declarations 00040 class LatticeExprNode; 00041 class LattRegionHolder; 00042 class IPosition; 00043 00044 00045 // <summary> 00046 // The base letter class for lattice coordinates in LEL. 00047 // </summary> 00048 00049 // <use visibility=local> 00050 00051 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00052 // </reviewed> 00053 00054 // <prerequisite> 00055 // <li> <linkto class="Lattice"> Lattice</linkto> 00056 // <li> <linkto class="LELLattCoordBase"> LELLattCoordBase</linkto> 00057 // </prerequisite> 00058 00059 // <synopsis> 00060 // This class is a letter class for the envelope class 00061 // <linkto class=LELCoordinates>LELCoordinates</linkto>. 00062 // It acts as the coordinates class for Lattice objects without 00063 // coordinates (like PagedArray). 00064 // 00065 // It does not do anything, but makes it possible that other classes 00066 // (like <linkto class=LELImageCoord>LELImageCoord</linkto>) 00067 // implement their own behaviour. 00068 // </synopsis> 00069 00070 // <motivation> 00071 // It must be possible to handle image coordinates in a lattice 00072 // expression. 00073 // </motivation> 00074 00075 //# <todo asof="1998/01/31"> 00076 //# <li> 00077 //# </todo> 00078 00079 00080 class LELLattCoord : public LELLattCoordBase 00081 { 00082 public: 00083 LELLattCoord(); 00084 00085 // A virtual destructor is needed so that it will use the actual 00086 // destructor in the derived class. 00087 virtual ~LELLattCoord(); 00088 00089 // The class does not have true coordinates. 00090 virtual Bool hasCoordinates() const; 00091 00092 // Create a SubLattice for an expression node. 00093 virtual LatticeExprNode makeSubLattice 00094 (const LatticeExprNode& expr, 00095 const LattRegionHolder& region) const; 00096 00097 // Create an extension for an expression node. 00098 virtual LatticeExprNode makeExtendLattice 00099 (const LatticeExprNode& expr, 00100 const IPosition& newShape, 00101 const LELLattCoordBase& newCoord) const; 00102 00103 // Create a rebinning for an expression node. 00104 virtual LatticeExprNode makeRebinLattice 00105 (const LatticeExprNode& expr, 00106 const IPosition& binning) const; 00107 00108 // Get the coordinates of the spectral axis for the given shape. 00109 // This function throws an exception as a Lattice has no coordinates. 00110 virtual uInt getSpectralInfo (Vector<Double>& worldCoordinates, 00111 const IPosition& shape) const; 00112 00113 // The name of the class. 00114 virtual String classname() const; 00115 00116 // Check how the coordinates of this and that compare. 00117 virtual Int compare (const LELLattCoordBase& other) const; 00118 00119 // Check how the coordinates of this and that image compare. 00120 // This function is used by <src>conform</src> to make a 00121 // double virtual dispatch possible. 00122 virtual Int doCompare (const LELImageCoord& other) const; 00123 }; 00124 00125 00126 00127 } //# NAMESPACE CASACORE - END 00128 00129 #endif 00130