vtkQtChartInteractor Class Reference

#include <vtkQtChartInteractor.h>

Collaboration diagram for vtkQtChartInteractor:

Collaboration graph
[legend]

List of all members.


Detailed Description

The vtkQtChartInteractor class is used to interact with a chart.

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
vtkQtChartAreagetChartArea () 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.

Constructor & Destructor Documentation

vtkQtChartInteractor::vtkQtChartInteractor ( QObject *  parent = 0  ) 

Creates a chart interactor instance.

Parameters:
parent The parent object.

virtual vtkQtChartInteractor::~vtkQtChartInteractor (  )  [virtual]


Member Function Documentation

vtkQtChartArea* vtkQtChartInteractor::getChartArea (  )  const [inline]

Gets the chart area.

Returns:
A pointer to the chart area.

Definition at line 77 of file vtkQtChartInteractor.h.

void vtkQtChartInteractor::setChartArea ( vtkQtChartArea area  ) 

Sets the chart area.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
function The mouse function to remove.

void vtkQtChartInteractor::removeFunctions ( Qt::MouseButton  button  ) 

Removes all the functions assigned to the given button.

Parameters:
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.

Parameters:
button The mouse button.
Returns:
The number of modes on a mouse button.

int vtkQtChartInteractor::getMode ( Qt::MouseButton  button  )  const

Gets the current mode for the given button.

Parameters:
button The mouse button.
Returns:
The current mode for the given button.

void vtkQtChartInteractor::setMode ( Qt::MouseButton  button,
int  index 
)

Sets the current mode for the given button.

Parameters:
button The mouse button.
index The new interaction mode.

int vtkQtChartInteractor::getNumberOfWheelModes (  )  const

Gets the number of modes on the mouse wheel.

Returns:
The number of modes on the mouse wheel.

int vtkQtChartInteractor::getWheelMode (  )  const

Gets the current mode for the mouse wheel.

Returns:
The current mode for the mouse wheel.

void vtkQtChartInteractor::setWheelMode ( int  index  ) 

Sets the current mode for the mouse wheel.

Parameters:
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.

Parameters:
sequence The key sequence to activate the function.
function The keyboard function.

void vtkQtChartInteractor::removeKeyboardFunction ( vtkQtChartKeyboardFunction function  ) 

Removes the keyboard function from the chart.

Parameters:
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.

Parameters:
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.

Parameters:
e Event specific information.

virtual void vtkQtChartInteractor::mouseMoveEvent ( QMouseEvent *  e  )  [virtual]

Calls the appropriate function to handle the mouse move.

Parameters:
e Event specific information.

virtual void vtkQtChartInteractor::mouseReleaseEvent ( QMouseEvent *  e  )  [virtual]

Calls the appropriate function to handle the mouse release.

Parameters:
e Event specific information.

virtual void vtkQtChartInteractor::mouseDoubleClickEvent ( QMouseEvent *  e  )  [virtual]

Calls the appropriate function to handle the double click.

Parameters:
e Event specific information.

virtual void vtkQtChartInteractor::wheelEvent ( QWheelEvent *  e  )  [virtual]

Handles the mouse wheel events for the chart.

Parameters:
e Event specific information.

void vtkQtChartInteractor::cursorChangeRequested ( const QCursor &  cursor  )  [signal]

Emitted when the mouse cursor needs to be changed.

Parameters:
cursor The new cursor to use.


The documentation for this class was generated from the following file:

Generated on Mon Sep 27 18:44:15 2010 for VTK by  doxygen 1.5.6