casa
$Rev:20696$
|
#include <MWCPannerTool.h>
Public Member Functions | |
MWCPannerTool (Display::KeySym keysym=Display::K_Pointer_Button1, Bool scrollingAllowed=True) | |
Constructor. | |
virtual | ~MWCPannerTool () |
Destructor. | |
virtual void | reset (Bool skipRefresh=False) |
Reset to non-showing, non-active. | |
Protected Member Functions | |
virtual void | keyPressed (const WCPositionEvent &) |
Functions called by the base class mouse event handling operators - these maintain the state of the pan vector and order it to be drawn via refresh(), send the pan request to the WC, and pass on notice of the pan (zoomed()) when it is complete. | |
virtual void | keyReleased (const WCPositionEvent &) |
virtual void | moved (const WCMotionEvent &, const viewer::region::region_list_type &) |
virtual void | otherKeyPressed (const WCPositionEvent &) |
virtual void | draw (const WCRefreshEvent &, const viewer::region::region_list_type &) |
draw the pan vector on a PixelCanvas. | |
virtual void | zoomed (const Vector< Double > &, const Vector< Double > &) |
Output callback to indicate that we have zoomed. | |
Private Member Functions | |
virtual void | pan (Vector< Double > &shift) |
execute the pan. | |
Private Attributes | |
Bool | itsActive |
Should we respond to mouse movement and button release? Should we draw? Set when the button is pushed in one of the tool's WCs. | |
Int | itsX1 |
pixel coordinates of the pan vector. | |
Int | itsY1 |
Int | itsX2 |
Int | itsY2 |
Bool | itsScrollingAllowed |
allow scrolling via arrow keys, et. | |
Double | itsLastScrollTime |
prevents key repeat from piling up scroll events, if refresh can't keep up with them | |
Int | itsLastKey |
Public interface
<h3>Review Status</h3><dl><dt>Date Reviewed:<dd>yyyy/mm/dd</dl> <prerequisites> <li> MWCTool </prerequisites> <h3>Etymology</h3> MWCPannerTool stands for MultiWorldCanvas Panner Tool <h3>Synopsis</h3> This class provides panning functionality. The zoomed() function should be overriden to catch the event, if needed. The pan line is drawn by dragging the mouse from one point to another. The release of the mouse button triggers the movement of the image by the same displacement. The Tool also responds to the arrow keys, scroll wheel, et. al., moving the zoom window in the same direction through the image. A constructor parameter is provided to turn these features off, if needed. <h3>Example</h3> @anchor MWCPannerTool_example <h3>Motivation</h3> Panning is a common function in most visualization applications
Definition at line 81 of file MWCPannerTool.h.
casa::MWCPannerTool::MWCPannerTool | ( | Display::KeySym | keysym = Display::K_Pointer_Button1 , |
Bool | scrollingAllowed = True |
||
) |
Constructor.
virtual casa::MWCPannerTool::~MWCPannerTool | ( | ) | [virtual] |
Destructor.
virtual void casa::MWCPannerTool::draw | ( | const WCRefreshEvent & | , |
const viewer::region::region_list_type & | |||
) | [protected, virtual] |
draw the pan vector on a PixelCanvas.
(To be called only by the base class refresh event handler).
Reimplemented from casa::MultiWCTool.
virtual void casa::MWCPannerTool::keyPressed | ( | const WCPositionEvent & | ) | [protected, virtual] |
Functions called by the base class mouse event handling operators - these maintain the state of the pan vector and order it to be drawn via refresh(), send the pan request to the WC, and pass on notice of the pan (zoomed()) when it is complete.
functions
Reimplemented from casa::MultiWCTool.
virtual void casa::MWCPannerTool::keyReleased | ( | const WCPositionEvent & | ) | [protected, virtual] |
Reimplemented from casa::MultiWCTool.
virtual void casa::MWCPannerTool::moved | ( | const WCMotionEvent & | , |
const viewer::region::region_list_type & | |||
) | [protected, virtual] |
Reimplemented from casa::MultiWCTool.
virtual void casa::MWCPannerTool::otherKeyPressed | ( | const WCPositionEvent & | ) | [protected, virtual] |
Reimplemented from casa::MultiWCTool.
virtual void casa::MWCPannerTool::pan | ( | Vector< Double > & | shift | ) | [private, virtual] |
execute the pan.
shift is the (2-element) shift vector for the zoom window, in linear coordinates. Resets the tool, removing the line (if any) from screen
virtual void casa::MWCPannerTool::reset | ( | Bool | skipRefresh = False | ) | [virtual] |
Reset to non-showing, non-active.
Refreshes if necessary to erase (unless skipRefresh==True). (Does not unregister from WCs or disable future event handling).
Reimplemented from casa::MultiWCTool.
virtual void casa::MWCPannerTool::zoomed | ( | const Vector< Double > & | , |
const Vector< Double > & | |||
) | [inline, protected, virtual] |
Output callback to indicate that we have zoomed.
Override to handle, if needed.
Definition at line 116 of file MWCPannerTool.h.
Bool casa::MWCPannerTool::itsActive [private] |
Should we respond to mouse movement and button release? Should we draw? Set when the button is pushed in one of the tool's WCs.
Definition at line 128 of file MWCPannerTool.h.
Int casa::MWCPannerTool::itsLastKey [private] |
Definition at line 140 of file MWCPannerTool.h.
Double casa::MWCPannerTool::itsLastScrollTime [private] |
prevents key repeat from piling up scroll events, if refresh can't keep up with them
Definition at line 139 of file MWCPannerTool.h.
Bool casa::MWCPannerTool::itsScrollingAllowed [private] |
Int casa::MWCPannerTool::itsX1 [private] |
pixel coordinates of the pan vector.
1 = anchor, 2 = new position.
Definition at line 131 of file MWCPannerTool.h.
Int casa::MWCPannerTool::itsX2 [private] |
Definition at line 131 of file MWCPannerTool.h.
Int casa::MWCPannerTool::itsY1 [private] |
Definition at line 131 of file MWCPannerTool.h.
Int casa::MWCPannerTool::itsY2 [private] |
Definition at line 131 of file MWCPannerTool.h.