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 {
00083                         return Unit("_");
00084                 }
00085                 const IPosition dataShape() const {
00086                         return IPosition( );
00087                 }
00088                 uInt dataDim() const {
00089                         return 0;
00090                 }
00091                 std::vector<int> displayAxes( ) const {
00092                         return std::vector<int>( );
00093                 }
00094 
00095                 // Return the number of display elements (ie. drawable images) in
00096                 // this DisplayData.
00097                 // <group>
00098                 virtual uInt nelements(const WorldCanvasHolder &wcHolder) const;
00099                 virtual uInt nelements() const;
00100                 // </group>
00101 
00102                 // Install the default options for this DisplayData.
00103                 virtual void setDefaultOptions();
00104 
00105                 // Apply options stored in <src>rec</src> to the DisplayData.  A
00106                 // return value of <src>True</src> means a refresh is needed.
00107                 // <src>recOut</src> contains any fields which were implicitly
00108                 // changed as a result of the call to this function.
00109                 virtual Bool setOptions(Record &rec, Record &recOut);
00110 
00111                 // Retrieve the current and default options and parameter types.
00112                 virtual Record getOptions( bool scrub=false ) const;
00113 
00114                 // Negotiatiate WorldCanvas linear coordinate system when asked to
00115                 // do so by the WorldCanvasHolder.  In this implementation, simply
00116                 // return False to indicate that this DisplayData will not negotiate
00117                 // coordinates: it is a passive DisplayData.
00118 
00119                 virtual void refreshEH(const WCRefreshEvent &ev);
00120                 virtual Bool sizeControl(WorldCanvasHolder &/*wcHolder*/,
00121                                          AttributeBuffer &/*holderBuf*/) {
00122                         return False;
00123                 }
00124 
00125                 // Tidy up the elements of this DisplayData.
00126                 virtual void cleanup();
00127 
00128         protected:
00129 
00130                 // Return the current options of this DisplayData as an
00131                 // AttributeBuffer.  The caller must delete the returned buffer.
00132                 virtual AttributeBuffer optionsAsAttributes();
00133 
00134                 // (Required) copy constructor.
00135                 PassiveCachingDD(const PassiveCachingDD &other);
00136 
00137                 // (Required) copy assignment.
00138                 void operator=(const PassiveCachingDD &other);
00139 
00140         };
00141 
00142 
00143 } //# NAMESPACE CASA - END
00144 
00145 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1