casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MWCRTZoomer.h
Go to the documentation of this file.
1 //# MWCRTZoomer.h: MultiWorldCanvas event-based zoomer
2 //# Copyright (C) 2000,2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_MWCRTZOOMER_H
29 #define TRIALDISPLAY_MWCRTZOOMER_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37 // <summary>
38 // Multi WorldCanvas event-based zoomer
39 // </summary>
40 //
41 // <use visibility=export>
42 //
43 // <reviewed reviewer="" data="yyyy/mm/dd" tests="" demos="">
44 // </reviewed>
45 //
46 // <prerequisites>
47 // <li> WCRectTool
48 // </prerequisites>
49 //
50 // <etymology>
51 // MWCRTZoomer stands for WorldCanvas Rectangling Tool Zoomer
52 // </etymology>
53 //
54 // <synopsis>
55 // This class finalises the functionality in WCRectTool to implement
56 // event-based zooming on a WorldCanvas. casacore::Double clicking inside the
57 // constructed rectangle results in zooming in; double clicking outside
58 // the rectangle gives zooming out.
59 // </synopsis>
60 //
61 // <example>
62 // </example>
63 //
64 // <motivation>
65 // Zooming is an essential tool for interacting with data displays.
66 // </motivation>
67 //
68 // <todo asof="1999/02/10">
69 // <li> Nothing known
70 // </todo>
71 
72  class MWCRTZoomer : public MWCRectTool {
73 
74  public:
75 
76  // Constructor
78 
79  // Destructor
80  virtual ~MWCRTZoomer();
81 
82  // This function resets the zoom
83  virtual void unzoom();
84 
85  //This function zooms with a given blc,trc
86  virtual void zoom(const casacore::Vector<casacore::Double> &linBlc,
88 
89  // zoom in/out by given factor
90  //<group>
91  virtual void zoomIn(casacore::Double factor=2.);
92  virtual void zoomOut(casacore::Double factor=2.);
93  //</group>
94 
95  protected:
96 
97  // Handle double-click inside or outside the rectangle; called by
98  // the base class when these events occur. They execute
99  // zoom-in/zoom-out on the tool's active WC's (which should all
100  // have indentical linear coordinates for their draw areas--they
101  // certainly will have, after a zoom).
102  // Then the routines invoke the zoomed() callback, below.
103  // <group>
104  virtual void doubleInside();
105  virtual void doubleOutside();
106  // </group>
107 
108  // This function is called when a zoom occurs. It is supplied
109  // with the linear coords of the new zoom box, and thus can be
110  // implemented to do further actions, such as reporting the
111  // new zoom box to the application
112  virtual void zoomed(const casacore::Vector<casacore::Double> &linBlc,
113  const casacore::Vector<casacore::Double> &linTrc);
114 
115  private:
116 
117  // get the linear coords of the current zoom box
119 
120  };
121 
122 
123 } //# NAMESPACE CASA - END
124 
125 #endif
Multi WorldCanvas event-based zoomer.
Definition: MWCRTZoomer.h:72
virtual void zoomIn(casacore::Double factor=2.)
zoom in/out by given factor
Base class for MultiWorldCanvas event-based rectangle tools.
Definition: MWCRectTool.h:84
virtual void doubleOutside()
virtual void doubleInside()
Handle double-click inside or outside the rectangle; called by the base class when these events occu...
virtual void zoomOut(casacore::Double factor=2.)
double Double
Definition: aipstype.h:55
virtual ~MWCRTZoomer()
Destructor.
virtual void unzoom()
This function resets the zoom.
void getLinearCoords(casacore::Vector< casacore::Double > &blc, casacore::Vector< casacore::Double > &trc)
get the linear coords of the current zoom box
virtual void zoomed(const casacore::Vector< casacore::Double > &linBlc, const casacore::Vector< casacore::Double > &linTrc)
This function is called when a zoom occurs.
virtual void zoom(const casacore::Vector< casacore::Double > &linBlc, const casacore::Vector< casacore::Double > &linTrc)
This function zooms with a given blc,trc.
MWCRTZoomer(Display::KeySym keysym=Display::K_Pointer_Button1)
Constructor.
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412