casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WCCSNLAxisLabeller.h
Go to the documentation of this file.
00001 //# WCCSNLAxisLabeller.h: non-linear axis labelling using a CS on a WC
00002 //# Copyright (C) 1999,2000,2001,2002
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_WCCSNLAXISLABELLER_H
00029 #define TRIALDISPLAY_WCCSNLAXISLABELLER_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/Display/AttributeBuffer.h>
00033 #include <display/DisplayCanvas/WCCSAxisLabeller.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 // <summary>
00038 // Class which provides non-linear axis labelling using a CoordinateSystem.
00039 // </summary>
00040 //
00041 // <synopsis>
00042 // This class implements the interface defined in WCCSAxisLabeller to
00043 // provide arbitrary non-linear axis labelling, using coordinate 
00044 // transformations provided by a supplied CoordinateSystem.
00045 //
00046 // </synopsis>
00047 
00048 class WCCSNLAxisLabeller : public WCCSAxisLabeller {
00049   
00050  public:
00051 
00052   // Constructor
00053   WCCSNLAxisLabeller();
00054 
00055   // Destructor 
00056   virtual ~WCCSNLAxisLabeller();
00057 
00058   // Draw axis labels for the provided WorldCanvas refresh event.
00059   // Note: it is the responsibility of the caller to assure that this
00060   // object is invalidated (or destroyed) _before_ the WorldCanvas
00061   // corresponding to ev gets destroyed, so that any cached axis drawing
00062   // which the WC is holding for us can be deleted properly.
00063   virtual Bool draw(const WCRefreshEvent &ev);
00064 
00065   // Invalidate/return any cached drawing list
00066   virtual void invalidate();
00067 
00068   // Install the CoordinateSystem to use
00069   virtual void setCoordinateSystem(const CoordinateSystem &coordsys);
00070 
00071   // Set the world min and max ranges (and their associated units)
00072   // to be used by the CoordinateSystem::toMix computations.  
00073   // If not specified with this function,
00074   // -180->180, -90->90 for DirectionCoordinates used (rest
00075   // don't matter).  Specifying this correctly can make the
00076   // toMix computations much faster (it uses an iterative
00077   // solution) and avoid solution ambiguities.  
00078   void setWorldRanges (const Vector<Double>& worldMin,
00079                        const Vector<Double>& worldMax,
00080                        const Vector<String>& units);
00081 
00082   // install the default options for this DisplayData
00083   virtual void setDefaultOptions();
00084 
00085   // apply options stored in rec to the DisplayData; return value
00086   // True means a refresh is needed.  Any fields added to the
00087   // updatedOptions argument are options which have changed in
00088   // some way due to the setting of other options - ie. they 
00089   // are context sensitive.
00090   virtual Bool setOptions(const Record &rec, Record &updatedOptions);
00091 
00092   // retrieve the current and default options and parameter types.
00093   virtual Record getOptions() const;
00094 
00095  private:
00096 
00097   // Is the drawlist state below valid?
00098   Bool itsValid;
00099 
00100   // our drawlist number
00101   uInt itsDrawListNumber;
00102 
00103   // attribute buffer that suits the drawlist we have made
00104   AttributeBuffer itsDrawStateBuffer;
00105 
00106   // last WorldCanvas drawn upon
00107   WorldCanvas *itsLastWorldCanvas;
00108 };
00109 
00110 
00111 } //# NAMESPACE CASA - END
00112 
00113 #endif