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 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
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.
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 89 of file vtkQtChartInteractor.h.

void vtkQtChartInteractor::setChartArea ( vtkQtChartArea area  )  [inline]

Sets the chart area.

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

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.

virtual bool vtkQtChartInteractor::keyPressEvent ( QKeyEvent *  e  )  [virtual]

Handles the key press events for the chart.

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 Wed Jun 3 19:28:16 2009 for VTK by  doxygen 1.5.6