casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SlicePanelDisplay.h
Go to the documentation of this file.
00001 //# PanelDisplay.h: A 3d Slice Application
00002 //# Copyright (C) 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 
00027 #ifndef TRIALDISPLAY_SLICEPANELDISPLAY_H
00028 #define TRIALDISPLAY_SLICEPANELDISPLAY_H
00029 
00030 #include <casa/aips.h>
00031 #include <casa/Containers/List.h>
00032 #include <casa/Containers/RecordInterface.h>
00033 #include <casa/Containers/SimOrdMap.h>
00034 #include <display/DisplayEvents/DTVisible.h>
00035 #include <display/Display/DisplayEnums.h>
00036 #include <display/DisplayEvents/WCPositionEH.h>
00037 #include <display/DisplayEvents/WCMotionEH.h>
00038 #include <display/DisplayEvents/MWCAnimator.h>
00039 
00040 namespace casa { //# NAMESPACE CASA - BEGIN
00041 
00042 class PixelCanvas;
00043 class MultiWCHolder;
00044 class PanelDisplay;
00045 
00046 // <summary> 
00047 // An event handler to negotiate between three different PanelDisplays
00048 // </summary>
00049 //
00050 // <use visibility=export>
00051 // 
00052 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00053 // </reviewed>
00054 // 
00055 // <prerequisite>
00056 //   <li> EventHandlers
00057 //   <li> SlicePanelDisplay
00058 // </prerequisite>
00059 //
00060 // <etymology>
00061 // </etymology>
00062 //
00063 // <synopsis>
00064 //
00065 // </synopsis>
00066 //
00067 
00068 class SliceEH : public WCMotionEH,public WCPositionEH, public DTVisible {
00069 public:
00070   SliceEH(PanelDisplay* mwch, uInt axis=0, uInt daxis=0);
00071   virtual ~SliceEH();
00072   virtual void draw(const WCMotionEvent &ev);
00073   virtual void operator()(const WCMotionEvent &ev);
00074   virtual void operator()(const WCPositionEvent &ev);
00075   virtual void matchKey(Display::KeySym key);
00076 private:
00077   PanelDisplay* itsPD;
00078   MWCAnimator itsAni;
00079   uInt itsAxis;
00080   uInt itsDrawAxis;
00081   Display::KeySym itsPositionKey;
00082   Display::KeyModifier itsMotionKey;
00083 };
00084 // <summary> An application provide displays of three axis
00085 // combinations of data in a cube 
00086 // </summary>
00087 //
00088 // <use visibility=export>
00089 // 
00090 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00091 // </reviewed>
00092 // 
00093 // <prerequisite>
00094 //   <li> PanelDisplay
00095 // </prerequisite>
00096 //
00097 // <etymology>
00098 // </etymology>
00099 //
00100 // <synopsis>
00101 //
00102 // </synopsis>
00103 //
00104 // <example>
00105 // </example>
00106 //
00107 // <motivation>
00108 // Slicing is a handy tool to ananlyse data cubes
00109 // </motivation>
00110 //
00111 // <todo> 
00112 // </todo>
00113 //
00114 
00115 class SlicePanelDisplay : public WCMotionEH {
00116 public:
00117   SlicePanelDisplay(PixelCanvas* pcanvas);
00118   virtual ~SlicePanelDisplay();
00119 
00120   virtual Record getOptions() const;
00121   virtual Bool setOptions(const Record& rec, Record& updatedOptions);
00122 
00123   virtual void hold();
00124   virtual void release();
00125 
00126   virtual void refresh(const Display::RefreshReason &reason = Display::UserCommand);
00127 
00128   virtual PanelDisplay* getPanelDisplay(const String& pdname);
00129   
00130   virtual void setToolKey(const String& toolname,
00131                           const Display::KeySym& keysym);
00132   virtual void disableTools();
00133   virtual void enableTools();
00134 
00135   virtual void operator()(const WCMotionEvent &ev);
00136   virtual PanelDisplay* activePanelDisplay() { return itsActivePD;};
00137  
00138   virtual void precompute();
00139 
00140 private:
00141   SimpleOrderedMap<String, PanelDisplay* > itsPanelDisplays;
00142   SimpleOrderedMap<String, SliceEH* > itsSliceEHs;
00143   PanelDisplay* itsActivePD;
00144   void installEHs();
00145   void removeEHs();
00146 };
00147 
00148 
00149 } //# NAMESPACE CASA - END
00150 
00151 #endif