#include <vtkQtChartInteractor.h>
The chart area object is is shared among the mouse and keyboard functions. The chart area can be used to get access to the contents space object or the mouse box. 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.
Mouse and keyboard buttons can be configured to perform functions using the configuration methods. Mouse functions can be combined on the same mouse button. To access the different functions on a button, the mode must first be set. Only on keyboard function can be added to a key sequence.
Definition at line 60 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. | |
Keyboard Methods | |
void | addKeyboardFunction (const QKeySequence &sequence, vtkQtChartKeyboardFunction *function) |
Adds a keyboard function to the chart. | |
void | removeKeyboardFunction (vtkQtChartKeyboardFunction *function) |
Removes the keyboard function from the chart. | |
void | removeKeyboardFunctions () |
Removes all the keyboard functions from the chart. | |
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 77 of file vtkQtChartInteractor.h.
void vtkQtChartInteractor::setChartArea | ( | vtkQtChartArea * | area | ) |
Sets the chart area.
area | The new chart area. |
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. |
void vtkQtChartInteractor::addKeyboardFunction | ( | const QKeySequence & | sequence, | |
vtkQtChartKeyboardFunction * | function | |||
) |
Adds a keyboard function to the chart.
The key sequence must be unique to be added to the chart. The same function pointer can be added to multiple key sequence entries.
sequence | The key sequence to activate the function. | |
function | The keyboard function. |
void vtkQtChartInteractor::removeKeyboardFunction | ( | vtkQtChartKeyboardFunction * | function | ) |
Removes the keyboard function from the chart.
function | The keyboard function to remove. |
void vtkQtChartInteractor::removeKeyboardFunctions | ( | ) |
Removes all the keyboard functions from the chart.
virtual bool vtkQtChartInteractor::keyPressEvent | ( | QKeyEvent * | e | ) | [virtual] |
Handles the key press events for the chart.
The key and modifiers from the keyboard event are used to determine the function to call.
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. |