Display widget for the transfer function. More...
Provides the widget that displays the transfer function as a series of coloured nodes connected by dotted lines. The x-axis represents the density values, the y-axis the opacity of a node. A histogram of the currently loaded volume dataset is shown in the background.
TFView::TFView | ( | QGraphicsScene * | scene, | |
TFTexture * | transferFunction | |||
) |
Constructor.
scene | The Qt scene used by this view. | |
transferFunction | The transfer function to display. |
TFView::~TFView | ( | void | ) |
Default destructor.
void TFView::mousePressEvent | ( | QMouseEvent * | event | ) |
Event handler called when a mouse button is clicked on the widget.
If the left mouse button is clicked outside an existing node, a colour chooser dialog opens and a new node is created at the clicked position with the selected colour. If the right mouse button is clicked on a node, the node is deleted. If the right mouse button is clicked outside an existing node, the transfer function is cleared. Afterwards the view is redrawn and the underlying transfer function is re-generated.
event | The mouse event being handled. |
void TFView::drawTF | ( | ) |
Generates the scene and draws the view.
First clears the scene, then creates the bars for the histogram, the nodes, and the lines connecting them, then finally updates the widget.
void TFView::clear | ( | void | ) |
Helper function that clears the scene.
Removes all items in the scene.
void TFView::clearTF | ( | ) | [slot] |
Slot that clears the transfer function.
Clears the underlying transfer function, then redraws the scene.