VolVis::Gui::TFWidget Class Reference

#include <TFWidget.h>


Detailed Description

In this graphics scene the histogram of the loaded volume is drawn. The class provides a gui for editing the transfer function. QT graphics objects are used. A wrapper widget for the graphics scene is created in the constructor.


Public Types

enum  Type { INTENSITY, GRADIENT }

Public Member Functions

void bindTransferFunction (VolumeRendering::TransferFunction *tf)
void bindVolumeData (VolumeRendering::VolumeData *volume)
VolumeRendering::TransferFunctiongetTransferFunction ()
QWidget * getWidget () const
void loadTFFromFile (std::string &filePath)
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent)
void mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent)
void mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent)
void mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent)
void saveTFToFile (std::string &filePath)
 TFWidget (QWidget *parent=0, int width=256, int height=100, Type t=INTENSITY)
void updateHistogram ()
 ~TFWidget ()


Member Enumeration Documentation

enum VolVis::Gui::TFWidget::Type

Defines if the transfer function is used for intensity values or for gradient magnitude values.


Constructor & Destructor Documentation

VolVis::Gui::TFWidget::TFWidget ( QWidget *  parent = 0,
int  width = 256,
int  height = 100,
Type  t = INTENSITY 
)

Constructor. Sets up all widgets and gui objects.

Parameters:
parent widget, only used for the constructor of the base class
width width of the widget
height height of the widget
t defines the type. Default value is INTENSITY

VolVis::Gui::TFWidget::~TFWidget (  ) 

Destructor.


Member Function Documentation

void VolVis::Gui::TFWidget::bindTransferFunction ( VolumeRendering::TransferFunction tf  ) 

Binds the transfer function which is edited by this widget.

Parameters:
tf Transfer function assigned to this widget

void VolVis::Gui::TFWidget::bindVolumeData ( VolumeRendering::VolumeData volume  ) 

Binds the volume data which contains the histogram to the widget.

Parameters:
volume Volume data whose histogram is visualized.

VolumeRendering::TransferFunction* VolVis::Gui::TFWidget::getTransferFunction (  ) 

Returns the transfer function where the values edited in this widget are stored

Returns:
transfer function assigned to this widget

QWidget* VolVis::Gui::TFWidget::getWidget (  )  const

This method gives access to the wrapper widget in which the graphics scene is embedded. Use this widget to place the tf widget in the gui.

Returns:
wrapper widget which contains the graphics scene

void VolVis::Gui::TFWidget::loadTFFromFile ( std::string &  filePath  ) 

Load a transfer function which is stored in a file and pass the arguments to the bounded TransferFunction.

Parameters:
filePath path to the file which contains the transfer function to be loaded.
See also:
TransferFunction::openFile

void VolVis::Gui::TFWidget::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  mouseEvent  ) 

With a double click the color of a node can be changed. This method is inherited by QGraphicsScene and is called when a mouse button is clicked twice.

Parameters:
mouseEvent contains the parameters of the mouse event (e.g. which mouse button has been used)

void VolVis::Gui::TFWidget::mouseMoveEvent ( QGraphicsSceneMouseEvent *  mouseEvent  ) 

A node can be moved with the left mouse button. If a node has been selected is checked in the method mousePressEvent. The selected node is stored in a member variable. This method is inherited by QGraphicsScene and is called when the mouse is moved over the widget.

Parameters:
mouseEvent contains the parameters of the mouse event (e.g. which mouse button has been used)

void VolVis::Gui::TFWidget::mousePressEvent ( QGraphicsSceneMouseEvent *  mouseEvent  ) 

Depending on which mouse button has been pressed, a node is added, changed or removed. This method is inherited by QGraphicsScene and is called when a mouse button is pressed.

Parameters:
mouseEvent contains the parameters of the mouse event (e.g. which mouse button has been used)

void VolVis::Gui::TFWidget::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  mouseEvent  ) 

Releases the selected node which has been stored for moving. This method is inherited by QGraphicsScene and is called when a pressed mouse button is released.

Parameters:
mouseEvent contains the parameters of the mouse event (e.g. which mouse button has been used)

void VolVis::Gui::TFWidget::saveTFToFile ( std::string &  filePath  ) 

Save a transfer function to a file.

Parameters:
filePath path to the file where the transfer function should be saved.
See also:
TransferFunction::saveToFile

void VolVis::Gui::TFWidget::updateHistogram (  ) 

In this method the histogram values are loaded from the bounded volume and the histogram is rendered completely new.


The documentation for this class was generated from the following file:
Generated on Wed Dec 5 12:27:31 2007 for VolVis by  doxygen 1.5.1-p1