casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PassiveCachingDD.h
Go to the documentation of this file.
00001 //# PassiveCachingDD.h: passive implementation of a CachingDisplayData
00002 //# Copyright (C) 1999,2000,2001,2002,2003
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_PASSIVECACHINGDD_H
00029 #define TRIALDISPLAY_PASSIVECACHINGDD_H
00030 
00031 #include <casa/aips.h>
00032 #include <casa/Arrays/IPosition.h>
00033 #include <display/DisplayDatas/CachingDisplayData.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 // <summary>
00038 // Class providing passive behaviour for CachingDisplayDatas.
00039 // </summary>
00040 
00041 // <synopsis> 
00042 // A "passive" DisplayData is one which can only be used in
00043 // conjunction with another non-passive DisplayData.  As such, it will
00044 // not negotiate coordinates on a WorldCanvas, nor will it provide
00045 // coordinate conversion capabilities.
00046 // </synopsis>
00047 
00048 class PassiveCachingDD : public CachingDisplayData {
00049 
00050  public:
00051 
00052   // Constructor.
00053   PassiveCachingDD();
00054 
00055   // Destructor.
00056   virtual ~PassiveCachingDD();
00057 
00058     // Coordinate transformation handlers, called by WorldCanvasHolder.
00059   // These functions simply return False because this DisplayData is
00060   // passive.
00061   // <group>
00062   virtual Bool linToWorld(Vector<Double> &world, const Vector<Double> &lin);
00063   virtual Bool worldToLin(Vector<Double> &lin, const Vector<Double> &world);
00064   // </group>
00065 
00066   // Format a string containing coordinate or value information at the
00067   // given world coordinate.  They simply return empty Strings because
00068   // this DisplayData is passive.
00069   // <group>
00070   virtual String showPosition(const Vector<Double> &world, 
00071                               const Bool &displayAxesOnly = False);
00072   virtual String showValue(const Vector<Double> &world);
00073   // </group>
00074 
00075   
00076   // World axis information suppliers.
00077   // <group>
00078   virtual Vector<String> worldAxisNames() const;
00079   virtual Vector<String> worldAxisUnits() const;
00080   // </group>
00081   
00082   const Unit dataUnit() const { return Unit("_"); }
00083   const IPosition dataShape() const { return IPosition( ); }
00084   const uInt dataDim() const { return 0; }
00085   std::vector<int> displayAxes( ) const { return std::vector<int>( ); }
00086 
00087   // Return the number of display elements (ie. drawable images) in
00088   // this DisplayData.
00089   // <group>
00090   virtual const uInt nelements(const WorldCanvasHolder &wcHolder) const;
00091   virtual const uInt nelements() const;
00092   // </group>
00093 
00094   // Install the default options for this DisplayData.
00095   virtual void setDefaultOptions();
00096 
00097   // Apply options stored in <src>rec</src> to the DisplayData.  A
00098   // return value of <src>True</src> means a refresh is needed.
00099   // <src>recOut</src> contains any fields which were implicitly 
00100   // changed as a result of the call to this function.
00101   virtual Bool setOptions(Record &rec, Record &recOut);
00102 
00103   // Retrieve the current and default options and parameter types.
00104   virtual Record getOptions();
00105 
00106   // Negotiatiate WorldCanvas linear coordinate system when asked to
00107   // do so by the WorldCanvasHolder.  In this implementation, simply
00108   // return False to indicate that this DisplayData will not negotiate
00109   // coordinates: it is a passive DisplayData.
00110 
00111   virtual void refreshEH(const WCRefreshEvent &ev);
00112   virtual Bool sizeControl(WorldCanvasHolder &/*wcHolder*/,
00113                            AttributeBuffer &/*holderBuf*/)
00114     { return False; }
00115 
00116   // Tidy up the elements of this DisplayData.
00117   virtual void cleanup();  
00118 
00119  protected:
00120 
00121   // Return the current options of this DisplayData as an
00122   // AttributeBuffer.  The caller must delete the returned buffer.
00123   virtual AttributeBuffer optionsAsAttributes();
00124 
00125   // (Required) copy constructor.
00126   PassiveCachingDD(const PassiveCachingDD &other);
00127 
00128   // (Required) copy assignment.
00129   void operator=(const PassiveCachingDD &other);
00130 
00131 };
00132 
00133 
00134 } //# NAMESPACE CASA - END
00135 
00136 #endif