#include <vtkQtChartInteractor.h>
The contents space and mouse box object used by the chart are shared among the mouse functions. The contents space object is used to convert widget coordinates to contents coordinates. It is also used to pan and zoom the contents. The chart uses the mouse box to draw a dashed rectangle on top of the chart. Mouse functions can use this rectangle for selection or zooming.
The keyboard shortcuts are as follows:
Plus...................Zoom in. Minus..................Zoom out. Ctrl+Plus..............Horizontally zoom in. Ctrl+minus.............Horizontally zoom out. Alt+Plus...............Vertically zoom in. Alt+minus..............Vertically zoom out. Up.....................Pan up. Down...................Pan down. Left...................Pan left. Right..................Pan right. Alt+Left...............Go to previous view in the history. Alt+Right..............Go to next view in the history.
Definition at line 72 of file vtkQtChartInteractor.h.
Signals | |
void | cursorChangeRequested (const QCursor &cursor) |
Emitted when the mouse cursor needs to be changed. | |
Public Member Functions | |
vtkQtChartInteractor (QObject *parent=0) | |
Creates a chart interactor instance. | |
virtual | ~vtkQtChartInteractor () |
Setup Methods | |
vtkQtChartArea * | getChartArea () const |
Gets the chart area. | |
void | setChartArea (vtkQtChartArea *area) |
Sets the chart area. | |
Configuration Methods | |
void | setFunction (Qt::MouseButton button, vtkQtChartMouseFunction *function, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
Sets the given function on the indicated mouse button. | |
void | setWheelFunction (vtkQtChartMouseFunction *function, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
Sets the given function on the mouse wheel. | |
void | addFunction (Qt::MouseButton button, vtkQtChartMouseFunction *function, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
Adds the given function to the indicated mouse button. | |
void | addWheelFunction (vtkQtChartMouseFunction *function, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
Adds the given function to the mouse wheel. | |
void | removeFunction (vtkQtChartMouseFunction *function) |
Removes the given function from its assigned button. | |
void | removeFunctions (Qt::MouseButton button) |
Removes all the functions assigned to the given button. | |
void | removeWheelFunctions () |
Removes all the functions assigned to the mouse wheel. | |
void | removeAllFunctions () |
Removes all the functions from all the buttons. | |
int | getNumberOfModes (Qt::MouseButton button) const |
Gets the number of modes on a mouse button. | |
int | getMode (Qt::MouseButton button) const |
Gets the current mode for the given button. | |
void | setMode (Qt::MouseButton button, int index) |
Sets the current mode for the given button. | |
int | getNumberOfWheelModes () const |
Gets the number of modes on the mouse wheel. | |
int | getWheelMode () const |
Gets the current mode for the mouse wheel. | |
void | setWheelMode (int index) |
Sets the current mode for the mouse wheel. | |
Interaction Methods | |
virtual bool | keyPressEvent (QKeyEvent *e) |
Handles the key press events for the chart. | |
virtual void | mousePressEvent (QMouseEvent *e) |
Calls the appropriate function to handle the mouse press. | |
virtual void | mouseMoveEvent (QMouseEvent *e) |
Calls the appropriate function to handle the mouse move. | |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
Calls the appropriate function to handle the mouse release. | |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
Calls the appropriate function to handle the double click. | |
virtual void | wheelEvent (QWheelEvent *e) |
Handles the mouse wheel events for the chart. |
vtkQtChartInteractor::vtkQtChartInteractor | ( | QObject * | parent = 0 |
) |
Creates a chart interactor instance.
parent | The parent object. |
virtual vtkQtChartInteractor::~vtkQtChartInteractor | ( | ) | [virtual] |
vtkQtChartArea* vtkQtChartInteractor::getChartArea | ( | ) | const [inline] |
Gets the chart area.
Definition at line 89 of file vtkQtChartInteractor.h.
void vtkQtChartInteractor::setChartArea | ( | vtkQtChartArea * | area | ) | [inline] |
Sets the chart area.
area | The new chart area. |
Definition at line 94 of file vtkQtChartInteractor.h.
void vtkQtChartInteractor::setFunction | ( | Qt::MouseButton | button, | |
vtkQtChartMouseFunction * | function, | |||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier | |||
) |
Sets the given function on the indicated mouse button.
This method clears any functions currently assigned to the given button before adding the new function.
button | The mouse button to assign the function to. | |
function | The mouse function to add. | |
modifiers | The keyboard modifiers used to activate the function. |
void vtkQtChartInteractor::setWheelFunction | ( | vtkQtChartMouseFunction * | function, | |
Qt::KeyboardModifiers | modifiers = Qt::NoModifier | |||
) |
Sets the given function on the mouse wheel.
function | The mouse function to add. | |
modifiers | The keyboard modifiers used to activate the function. |
void vtkQtChartInteractor::addFunction | ( | Qt::MouseButton | button, | |
vtkQtChartMouseFunction * | function, | |||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier | |||
) |
Adds the given function to the indicated mouse button.
If the new function is not combinable, it will be added to its own interaction mode. If the function is combinable, it is added to the first mode that does not have the given modifiers.
button | The mouse button to assign the function to. | |
function | The mouse function to add. | |
modifiers | The keyboard modifiers used to activate the function. |
void vtkQtChartInteractor::addWheelFunction | ( | vtkQtChartMouseFunction * | function, | |
Qt::KeyboardModifiers | modifiers = Qt::NoModifier | |||
) |
Adds the given function to the mouse wheel.
function | The mouse function to add. | |
modifiers | The keyboard modifiers used to activate the function. |
void vtkQtChartInteractor::removeFunction | ( | vtkQtChartMouseFunction * | function | ) |
Removes the given function from its assigned button.
function | The mouse function to remove. |
void vtkQtChartInteractor::removeFunctions | ( | Qt::MouseButton | button | ) |
Removes all the functions assigned to the given button.
button | The mouse button to clear. |
void vtkQtChartInteractor::removeWheelFunctions | ( | ) |
Removes all the functions assigned to the mouse wheel.
void vtkQtChartInteractor::removeAllFunctions | ( | ) |
Removes all the functions from all the buttons.
int vtkQtChartInteractor::getNumberOfModes | ( | Qt::MouseButton | button | ) | const |
Gets the number of modes on a mouse button.
button | The mouse button. |
int vtkQtChartInteractor::getMode | ( | Qt::MouseButton | button | ) | const |
Gets the current mode for the given button.
button | The mouse button. |
void vtkQtChartInteractor::setMode | ( | Qt::MouseButton | button, | |
int | index | |||
) |
Sets the current mode for the given button.
button | The mouse button. | |
index | The new interaction mode. |
int vtkQtChartInteractor::getNumberOfWheelModes | ( | ) | const |
Gets the number of modes on the mouse wheel.
int vtkQtChartInteractor::getWheelMode | ( | ) | const |
Gets the current mode for the mouse wheel.
void vtkQtChartInteractor::setWheelMode | ( | int | index | ) |
Sets the current mode for the mouse wheel.
index | The new interaction mode. |
virtual bool vtkQtChartInteractor::keyPressEvent | ( | QKeyEvent * | e | ) | [virtual] |
Handles the key press events for the chart.
e | Event specific information. |
virtual void vtkQtChartInteractor::mousePressEvent | ( | QMouseEvent * | e | ) | [virtual] |
Calls the appropriate function to handle the mouse press.
The mouse button and that button's current mode are used to determine the function to call. If a function on another button owns the mouse, the event will be ignored.
e | Event specific information. |
virtual void vtkQtChartInteractor::mouseMoveEvent | ( | QMouseEvent * | e | ) | [virtual] |
Calls the appropriate function to handle the mouse move.
e | Event specific information. |
virtual void vtkQtChartInteractor::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [virtual] |
Calls the appropriate function to handle the mouse release.
e | Event specific information. |
virtual void vtkQtChartInteractor::mouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [virtual] |
Calls the appropriate function to handle the double click.
e | Event specific information. |
virtual void vtkQtChartInteractor::wheelEvent | ( | QWheelEvent * | e | ) | [virtual] |
Handles the mouse wheel events for the chart.
e | Event specific information. |
void vtkQtChartInteractor::cursorChangeRequested | ( | const QCursor & | cursor | ) | [signal] |
Emitted when the mouse cursor needs to be changed.
cursor | The new cursor to use. |