casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WorldAxesDD.h
Go to the documentation of this file.
00001 //# WorldAxesDD.h: world axis labelling DisplayData
00002 //# Copyright (C) 2000,2001,2003,2004
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_WORLDAXESDD_H
00029 #define TRIALDISPLAY_WORLDAXESDD_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/DisplayDatas/AxesDisplayData.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 class DParameterChoice;
00037 
00038 // <summary> 
00039 // A DisplayData to setup a World coordinate plot
00040 // </summary>
00041 //
00042 // <use visibility=export>
00043 // 
00044 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00045 // </reviewed>
00046 // 
00047 // <prerequisite>
00048 //   <li> DisplayData
00049 //   <li> AxesDisplayData
00050 // </prerequisite>
00051 //
00052 // <etymology>
00053 // </etymology>
00054 // <synopsis> 
00055 // 
00056 // </synopsis> 
00057 
00058 class WorldAxesDD : public AxesDisplayData {
00059 
00060 public:
00061   
00062   // Constructor.
00063   WorldAxesDD();
00064 
00065   // Destructor.
00066   virtual ~WorldAxesDD();
00067 
00068     // Install the default options for this DisplayData.
00069   virtual void setDefaultOptions();
00070 
00071   // Apply options stored in <src>rec</src> to the DisplayData.  A
00072   // return value of <src>True</src> means a refresh is needed.
00073   // <src>recOut</src> contains any fields which were implicitly 
00074   // changed as a result of the call to this function.
00075   virtual Bool setOptions(Record& rec, Record& recOut);
00076 
00077   // Retrieve the current and default options and parameter types.
00078   virtual Record getOptions();
00079 
00080   // Create a new AxesDisplayMethod for drawing on the given
00081   // WorldCanvas when the AttributeBuffers are suitably matched to the
00082   // current state of this DisplayData and of the WorldCanvas/Holder.
00083   // The tag is a unique number used to identify the age of the newly
00084   // constructed CachingDisplayMethod.
00085   virtual CachingDisplayMethod* newDisplayMethod(WorldCanvas* worldCanvas,
00086                                  AttributeBuffer* wchAttributes,
00087                                  AttributeBuffer* ddAttributes,
00088                                  CachingDisplayData* dd);
00089  
00090   // Return the current options of this DisplayData as an
00091   // AttributeBuffer.
00092   virtual AttributeBuffer optionsAsAttributes();
00093 
00094   virtual String spectralUnit() const
00095     { return itsParamSpectralUnit->value(); }
00096   
00097   virtual String velocityType() const
00098     { return itsParamVelocityType->value(); } 
00099 
00100   virtual String axisText(const WorldCanvas* wc, const uInt axisNo) const;
00101   virtual String xAxisText(const WorldCanvas* wc=0) const;
00102   virtual String yAxisText(const WorldCanvas* wc=0) const;
00103       
00104   // Pure virtual function from DisplayData...
00105   String dataType() const { return "label"; }
00106 
00107 protected:
00108 
00109   // (Required) copy constructor.
00110   WorldAxesDD(const WorldAxesDD& other);
00111 
00112   // (Required) copy assignment.
00113   void operator=(const WorldAxesDD& other);
00114 
00115 private:
00116 
00117   // Install the default options for this DisplayData.
00118   void installDefaultOptions();
00119 
00120   // Set Spectral preference (options)
00121   DParameterChoice* itsParamSpectralUnit;
00122   DParameterChoice* itsParamVelocityType;
00123 
00124 };
00125 
00126 
00127 } //# NAMESPACE CASA - END
00128 
00129 #endif