TFWidget Class Reference

#include <TFWidget.h>

List of all members.

Signals

void functionChanged (float *data)

Public Member Functions

 TFWidget (QWidget *parent=0)
 Initializes TFWidget.
int angle () const
void addMode ()
 Sets mode to true so that vertex-add-mode is activated.
void delMode ()
 Sets mode to false so that vertex-delete-mode is activated.
void resetTF ()
 Resets all parameters in TFWidget to initial values.
void save (QFile *file)
 Saves the current transfer function to a file.
void load (QFile *file)
 Loads a transfer function file.

Public Attributes

QPoint posi

Protected Member Functions

void paintEvent (QPaintEvent *event)
 Paints a visualization of interpolated vertex colors.
void mousePressEvent (QMouseEvent *event)
 Checks if the click area contains an existing vertex and stores the index of this vertex in poly.
void mouseReleaseEvent (QMouseEvent *event)
 Draws or deletes vertices according to mode. Edits vertex colors in case of right click.
void createClickArea (int x, int y)
 Creates polygon around click position with specified size (areaSize).
void prepareTF ()
 Transforms the transfer function into a float array that can be directly used for generating the transfer function texture.

Private Attributes

int currentAngle
int currentAngley
QPolygon poly
QPolygon tempPoly
QSize size
bool drawn
bool vertexSelected
QPoint selectedVertex
QPolygon clickArea
int selectedIndex
int areaSize
int areaHeight
int areaWidth
int xcoord
int ycoord
bool mode
bool dataSet
QVector< QColor > vertexColors
QVector< QLine > histoLines
float data [4096 *3]
QMap< int, QVector< int > > tf


Constructor & Destructor Documentation

TFWidget::TFWidget ( QWidget *  parent = 0  ) 

Initializes TFWidget.

Sets initial polyline at left and right border with black and white as vertex colors.


Member Function Documentation

void TFWidget::addMode (  ) 

Sets mode to true so that vertex-add-mode is activated.

int TFWidget::angle (  )  const [inline]

void TFWidget::createClickArea ( int  x,
int  y 
) [protected]

Creates polygon around click position with specified size (areaSize).

Parameters:
x x-pos around which area is created.
y y-pos around which area is created.

void TFWidget::delMode (  ) 

Sets mode to false so that vertex-delete-mode is activated.

void TFWidget::functionChanged ( float *  data  )  [signal]

void TFWidget::load ( QFile *  file  ) 

Loads a transfer function file.

Parameters:
file Receives a pointer to a QFile.
A stream on the QFile is opened and loaded onto the QMap tf which stores all the data of the transfer function: vertex positions and their color values. This data is then restored to QPolygon poly and QVector <QColor> vertexColors. Finally the TFWidget gets updated to paint the loaded transfer function.

void TFWidget::mousePressEvent ( QMouseEvent *  event  )  [protected]

Checks if the click area contains an existing vertex and stores the index of this vertex in poly.

Parameters:
event contains information about mousePressEvent.

void TFWidget::mouseReleaseEvent ( QMouseEvent *  event  )  [protected]

Draws or deletes vertices according to mode. Edits vertex colors in case of right click.

Parameters:
event contains information about mouseReleaseEvent.
If mousePressEvent recognized an existing vertex at click position and the right mouse button was released a QColorDialog is opened and the chosen color replaces the old vertex color. Otherwise a new vertex is inserted at the specified position into the QPolygon poly if vertex-add-mode is active or an existing vertex is removed from poly if delete-mode is active.

void TFWidget::paintEvent ( QPaintEvent *  event  )  [protected]

Paints a visualization of interpolated vertex colors.

void TFWidget::prepareTF (  )  [protected]

Transforms the transfer function into a float array that can be directly used for generating the transfer function texture.

The values between vertices are interpolated and saved to an array that is returned to volGLWidget.

void TFWidget::resetTF (  ) 

Resets all parameters in TFWidget to initial values.

void TFWidget::save ( QFile *  file  ) 

Saves the current transfer function to a file.

Parameters:
file points to a QFile object


Member Data Documentation

int TFWidget::areaHeight [private]

int TFWidget::areaSize [private]

int TFWidget::areaWidth [private]

QPolygon TFWidget::clickArea [private]

int TFWidget::currentAngle [private]

int TFWidget::currentAngley [private]

float TFWidget::data[4096 *3] [private]

bool TFWidget::dataSet [private]

bool TFWidget::drawn [private]

QVector<QLine> TFWidget::histoLines [private]

bool TFWidget::mode [private]

QPolygon TFWidget::poly [private]

int TFWidget::selectedIndex [private]

QPoint TFWidget::selectedVertex [private]

QSize TFWidget::size [private]

QPolygon TFWidget::tempPoly [private]

QMap<int, QVector <int> > TFWidget::tf [private]

QVector<QColor> TFWidget::vertexColors [private]

bool TFWidget::vertexSelected [private]

int TFWidget::xcoord [private]

int TFWidget::ycoord [private]


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

Generated on Mon Jan 26 22:10:05 2009 for FlowVis by  doxygen 1.5.7.1