casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MWCRulerlineTool.h
Go to the documentation of this file.
1 //# MWCPannerTool.h: MultiWorldCanvas panning tool
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 
27 #ifndef TRIALDISPLAY_MWCRULERTOOL_H
28 #define TRIALDISPLAY_MWCRULERTOOL_H
29 
30 #include <casa/aips.h>
31 #include <casa/Arrays/Vector.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37  class WorldCanvas;
38 
39 // <summary>
40 // Multi WorldCanvas event-based ruler line tool
41 // </summary>
42 //
43 // <use visibility=export>
44 //
45 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46 // </reviewed>
47 //
48 // <prerequisites>
49 // </prerequisites>
50 //
51 // <etymology>
52 // MWCRulerlineTool stands for MultiWorldCanvas ruler line Tool
53 // </etymology>
54 //
55 // <synopsis>
56 // </synopsis>
57 //
58 // <example>
59 // </example>
60 //
61 // <motivation>
62 // A nice little tool to measure distances on the screen.
63 // </motivation>
64 //
65 // <todo asof="2011/06/10">
66 // Does not get the proper units if measuring distances on a frequency axis.
67 // </todo>
68 
69  class MWCRulerlineTool : public MultiWCTool, public DTVisible {
70 
71  public:
72  // Constructor
74  casacore::Bool scrollingAllowed = true);
75 
76  // Destructor
77  virtual ~MWCRulerlineTool();
78 
79  // Reset to non-showing, non-active. Refreshes if necessary to erase
80  // (unless skipRefresh==true).
81  // (Does not unregister from WCs or disable future event handling).
82  virtual void reset(casacore::Bool skipRefresh=false);
83 
84  protected:
85  // Functions called by the base class mouse event handling operators -
86  // these maintain the state of the pan vector and order it to be drawn
87  // via refresh().
88  // <group>
89  virtual void keyPressed(const WCPositionEvent &/*ev*/);
90  virtual void keyReleased(const WCPositionEvent &/*ev*/);
91  virtual void moved(const WCMotionEvent &/*ev*/, const viewer::region::region_list_type & /*selected_regions*/);
92  // </group>
93 
94  // draw the distance vector on a PixelCanvas. (To be called only by the
95  // base class refresh event handler).
96  virtual void draw(const WCRefreshEvent&/*ev*/, const viewer::region::region_list_type & /*selected_regions*/);
97 
98  private:
99  // Should we respond to mouse movement and button release? Should
100  // we draw? Set when the button is pushed in one of the tool's WCs.
102 
103  // are the units in x and y identical?
105 
106  // pixel coordinates of the pan vector. 1 = anchor, 2 = new position.
108 
109  // axis index for RA and DEC
111  };
112 
113 
114 } //# NAMESPACE CASA - END
115 
116 #endif
117 
118 
casacore::Int itsX1
pixel coordinates of the pan vector.
int Int
Definition: aipstype.h:50
virtual void draw(const WCRefreshEvent &, const viewer::region::region_list_type &)
draw the distance vector on a PixelCanvas.
Class which stores WorldCanvas refresh event information.
virtual void keyPressed(const WCPositionEvent &)
Functions called by the base class mouse event handling operators - these maintain the state of the p...
casacore::Int itsRaIndex
axis index for RA and DEC
virtual void moved(const WCMotionEvent &, const viewer::region::region_list_type &)
Class which stores WorldCanvas motion event information.
Definition: WCMotionEvent.h:79
virtual void keyReleased(const WCPositionEvent &)
casacore::Bool itsActive
Should we respond to mouse movement and button release? Should we draw? Set when the button is pushed...
MWCRulerlineTool(Display::KeySym keysym=Display::K_Pointer_Button1, casacore::Bool scrollingAllowed=true)
Constructor.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Multi WorldCanvas event-based ruler line tool.
Class providing draw style settings for visible DisplayTools.
Definition: DTVisible.h:95
Class which stores WorldCanvas position event information.
Base class for MultiWorldCanvas event-based tools.
Definition: MultiWCTool.h:89
std::set< Region * > region_list_type
Definition: RegionEnums.h:14
casacore::Bool itsEqualUnits
are the units in x and y identical?
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412
virtual void reset(casacore::Bool skipRefresh=false)
Reset to non-showing, non-active.
virtual ~MWCRulerlineTool()
Destructor.