casa
$Rev:20696$
|
00001 //# WCRTZoomer.h: WorldCanvas event-based zoomer 00002 //# Copyright (C) 1999,2000 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_WCRTZOOMER_H 00029 #define TRIALDISPLAY_WCRTZOOMER_H 00030 00031 //# aips includes 00032 #include <casa/aips.h> 00033 #include <casa/Arrays/Vector.h> 00034 00035 //# trial includes 00036 00037 //# display library includes 00038 #include <display/DisplayEvents/WCRectTool.h> 00039 00040 namespace casa { //# NAMESPACE CASA - BEGIN 00041 00042 // <summary> 00043 // WorldCanvas event-based zoomer 00044 // </summary> 00045 00046 // <use visibility=export> 00047 00048 // <reviewed reviewer="" data="yyyy/mm/dd" tests="" demos=""> 00049 // </reviewed> 00050 00051 // <prerequisites> 00052 // <li> WCRectTool 00053 // </prerequisites> 00054 00055 // <etymology> 00056 // WCRTZoomer stands for WorldCanvas Rectangling Tool Zoomer 00057 // </etymology> 00058 00059 // <synopsis> 00060 // This class finalises the functionality in WCRectTool to implement 00061 // event-based zooming on a WorldCanvas. Double clicking inside the 00062 // constructed rectangle results in zooming in; double clicking outside 00063 // the rectangle gives zooming out. 00064 // </synopsis> 00065 00066 // <example> 00067 // </example> 00068 00069 // <motivation> 00070 // Zooming is an essential tool for interacting with data displays. 00071 // </motivation> 00072 00073 // <todo asof="1999/02/10"> 00074 // <li> Nothing known 00075 // </todo> 00076 00077 class WCRTZoomer : public WCRectTool { 00078 00079 public: 00080 00081 // Constructor 00082 WCRTZoomer(WorldCanvas *wcanvas, 00083 Display::KeySym keysym = Display::K_Pointer_Button1); 00084 00085 // Destructor 00086 virtual ~WCRTZoomer(); 00087 00088 // Functions specific to the zooming - these are called by 00089 // lower-level event handlers in the base classes 00090 // <group> 00091 virtual void doubleInside(); 00092 virtual void doubleOutside(); 00093 // </group> 00094 00095 // This function is called when a zoom occurs. It is supplied 00096 // with the linear coords of the new zoom box, and thus can be 00097 // implemented to do further actions, or perhaps report the 00098 // new zoom box to the application 00099 virtual void zoomed(const Vector<Double> &linBlc, 00100 const Vector<Double> &linTrc); 00101 00102 private: 00103 00104 // get the linear coords of the current zoom box 00105 void getLinearCoords(Vector<Double> &blc, Vector<Double> &trc); 00106 00107 }; 00108 00109 00110 } //# NAMESPACE CASA - END 00111 00112 #endif