#include <QTFCanvas.h>
Public Member Functions | |
QTFCanvas (QWidget *parent=0) | |
virtual | ~QTFCanvas () |
void | setHistogram (std::vector< int > *histogram, unsigned char *histogram2d) |
VTransferFunction * | getTransferFunctionPtr () |
VTransferFunction * | getTransferFunctionPtr (int index) |
void | setObjectName (const QString &name) |
void | setActiveTF (int index) |
void | setHScroll (QScrollBar *_hbar) |
void | setVScroll (QScrollBar *_vbar) |
void | defaultSize () |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | mouseClickEvent (VMouseEvent gme) |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | keyReleaseEvent (QKeyEvent *e) |
const VMouseEvent | getMouseEvent (QMouseEvent *e) |
const VKeyboardEvent | getKeyboardEvent (QKeyEvent *e) |
virtual void | redraw () |
void | saveTf (std::string filename) |
void | loadTf (std::string filename) |
Protected Member Functions | |
virtual void | initializeGL () |
virtual void | resizeGL (int w, int h) |
virtual void | paintGL () |
Private Attributes | |
VTransferFunction * | m_TransferFunction |
std::vector< VTransferFunction > | m_TFVector |
float | m_maxdensity |
QScrollBar * | hbar |
QScrollBar * | vbar |
bool | tfbig |
Definition at line 20 of file QTFCanvas.h.
QTFCanvas::QTFCanvas | ( | QWidget * | parent = 0 |
) |
constructor with given parent widget pointer
parent | Pointer to parent widget |
Definition at line 24 of file QTFCanvas.cpp.
References m_TFVector, m_TransferFunction, and tfbig.
QTFCanvas::~QTFCanvas | ( | ) | [virtual] |
void QTFCanvas::setHistogram | ( | std::vector< int > * | histogram, | |
unsigned char * | histogram2d | |||
) |
sets the Histogram data
histogram | std::vector containing the 1d histogram of the volume data | |
histogram2d | pointer to a memory block where the 2d histogram is stored |
Definition at line 486 of file QTFCanvas.cpp.
References m_TransferFunction, and VTransferFunction::setHistogram().
VTransferFunction * QTFCanvas::getTransferFunctionPtr | ( | ) |
returns a pointer to the 1d transferfunction
Definition at line 494 of file QTFCanvas.cpp.
References m_TransferFunction.
Referenced by QMain::enableArrowTF(), QMain::enableLicTF(), QMain::enableStreamLineTF(), QMain::QMain(), and QMain::slider_colprop_valuechanged().
VTransferFunction * QTFCanvas::getTransferFunctionPtr | ( | int | index | ) |
returns a pointer to the 1d transferfunction
index | of TF |
Definition at line 499 of file QTFCanvas.cpp.
References m_TFVector.
void QTFCanvas::initializeGL | ( | ) | [protected, virtual] |
method for initializing the OpenGl context
Definition at line 97 of file QTFCanvas.cpp.
void QTFCanvas::resizeGL | ( | int | w, | |
int | h | |||
) | [protected, virtual] |
method called when resizing the window
w | width of widget | |
h | height of widget |
Definition at line 108 of file QTFCanvas.cpp.
void QTFCanvas::paintGL | ( | ) | [protected, virtual] |
paint method
Definition at line 116 of file QTFCanvas.cpp.
References VTransferFunction::draw1d(), and m_TransferFunction.
Referenced by redraw().
void QTFCanvas::setObjectName | ( | const QString & | name | ) |
sets the Objectname
name | QString containing the Widgets name |
Definition at line 47 of file QTFCanvas.cpp.
Referenced by Ui_QMain::setupUi().
void QTFCanvas::setActiveTF | ( | int | index | ) |
sets the active trasnfer function
index | identifies the TF to select |
Definition at line 51 of file QTFCanvas.cpp.
References m_TFVector, and m_TransferFunction.
Referenced by QMain::enableArrowTF(), QMain::enableLicTF(), QMain::enableStreamLineTF(), and QMain::slider_colprop_valuechanged().
void QTFCanvas::setHScroll | ( | QScrollBar * | _hbar | ) | [inline] |
sets the state of the horizontal scrollbar
_hbar | Pointer to the scrollbar |
Definition at line 96 of file QTFCanvas.h.
References hbar.
Referenced by QMain::QMain().
void QTFCanvas::setVScroll | ( | QScrollBar * | _vbar | ) | [inline] |
sets the state of the vertical scrollbar
_vbar | Pointer to the scrollbar |
Definition at line 105 of file QTFCanvas.h.
References vbar.
Referenced by QMain::QMain().
void QTFCanvas::defaultSize | ( | ) | [inline] |
resets the size of the canvas
Definition at line 113 of file QTFCanvas.h.
References tfbig.
Referenced by QMain::load_tf_file().
void QTFCanvas::paintEvent | ( | QPaintEvent * | e | ) | [virtual] |
paint event for Canvas
e | Pointer to the Event |
Definition at line 177 of file QTFCanvas.cpp.
void QTFCanvas::mousePressEvent | ( | QMouseEvent * | e | ) | [virtual] |
method handling the mouse Press Event
e | QMouseEvent |
Definition at line 182 of file QTFCanvas.cpp.
References clicked, getMouseEvent(), VMouseEvent::getRightState(), and RIGHT_PRESSED.
void QTFCanvas::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [virtual] |
method handling the mouse Release Event
e | QMouseEvent |
Definition at line 191 of file QTFCanvas.cpp.
References clicked, dragging_tfpt, dragging_tfpt2d, dtClick, m_TransferFunction, modifytriangle, mouseClickEvent(), RIGHT_PRESSED, VTransferFunction::setZoomPoint(), and tfbig.
void QTFCanvas::mouseMoveEvent | ( | QMouseEvent * | e | ) | [virtual] |
method handling the mouse move Event
e | QMouseEvent |
Definition at line 214 of file QTFCanvas.cpp.
References VTransferFunction::addTransferFunctionPoint(), dragging_tfpt, VMouseEvent::getLeftState(), VMouseEvent::getMiddleState(), getMouseEvent(), VMouseEvent::getPosition(), VTransferFunction::getTransferFunctionPoint(), VVector::getX(), VVector::getY(), vTransferFunctionPoint::m_Alpha, m_TransferFunction, VTransferFunction::removeTransferFunctionPoint(), VTransferFunction::setZoomPoint(), tfbig, THRESHOLD_DETAIL, THRESHOLD_OVERVIEW, and VTransferFunction::transferFunctionPointInRange().
void QTFCanvas::mouseClickEvent | ( | VMouseEvent | gme | ) | [virtual] |
method handling the mouse click Event
e | QMouseEvent |
Definition at line 302 of file QTFCanvas.cpp.
References VTransferFunction::addTransferFunctionPoint(), VMouseEvent::getLeftState(), VMouseEvent::getModifiers(), VMouseEvent::getPosition(), VVector::getX(), VVector::getY(), vTransferFunctionPoint::m_Alpha, vTransferFunctionPoint::m_Color, m_TransferFunction, VMouseEvent::MODIFIER_ALT, tfbig, THRESHOLD_DETAIL, THRESHOLD_OVERVIEW, and VTransferFunction::transferFunctionPointInRange().
Referenced by mouseReleaseEvent().
void QTFCanvas::mouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [virtual] |
method handling the mouse doubleclick Event
e | QMouseEvent |
Definition at line 355 of file QTFCanvas.cpp.
References VTransferFunction::addTransferFunctionPoint(), VTransferFunction::getAlpha(), VMouseEvent::getLeftState(), VMouseEvent::getModifiers(), getMouseEvent(), VMouseEvent::getPosition(), VMouseEvent::getRightState(), VVector::getX(), VVector::getY(), hbar, vTransferFunctionPoint::m_Alpha, vTransferFunctionPoint::m_Color, m_TransferFunction, VMouseEvent::MODIFIER_ALT, VTransferFunction::removeTransferFunctionPoint(), tfbig, THRESHOLD_DETAIL, THRESHOLD_OVERVIEW, VTransferFunction::transferFunctionPointInRange(), and vbar.
void QTFCanvas::keyPressEvent | ( | QKeyEvent * | e | ) | [virtual] |
method handling the key Press Event
e | QKeyEvent |
Definition at line 433 of file QTFCanvas.cpp.
void QTFCanvas::keyReleaseEvent | ( | QKeyEvent * | e | ) | [virtual] |
method handling the release Event
e | QKeyEvent |
Definition at line 439 of file QTFCanvas.cpp.
const VMouseEvent QTFCanvas::getMouseEvent | ( | QMouseEvent * | e | ) |
creates a VMouseEvent out of a QMouseEvent
e | QMouseEvent Pointer |
Definition at line 446 of file QTFCanvas.cpp.
References VMouseEvent::BUTTON_LEFT, VMouseEvent::BUTTON_MIDDLE, VMouseEvent::BUTTON_NONE, VMouseEvent::BUTTON_RIGHT, VKeyboardEvent::MODIFIER_ALT, VKeyboardEvent::MODIFIER_CTRL, VKeyboardEvent::MODIFIER_SHIFT, VMouseEvent::STATE_DOWN, and VMouseEvent::STATE_UP.
Referenced by mouseDoubleClickEvent(), mouseMoveEvent(), and mousePressEvent().
const VKeyboardEvent QTFCanvas::getKeyboardEvent | ( | QKeyEvent * | e | ) |
creates a VKeyboardEvent out of a QKeyEvent
e | QKeyEvent Pointer |
Definition at line 468 of file QTFCanvas.cpp.
References VKeyboardEvent::key, VKeyboardEvent::MODIFIER_ALT, VKeyboardEvent::MODIFIER_CTRL, and VKeyboardEvent::MODIFIER_SHIFT.
void QTFCanvas::redraw | ( | ) | [virtual] |
method called when window is redrawn
Definition at line 480 of file QTFCanvas.cpp.
References paintGL().
void QTFCanvas::saveTf | ( | std::string | filename | ) |
saves the current active tf
filename | string containing the filename to save the tf to |
Definition at line 505 of file QTFCanvas.cpp.
References m_TransferFunction, and VTransferFunction::save().
Referenced by QMain::save_tf_file().
void QTFCanvas::loadTf | ( | std::string | filename | ) |
method for loading the tf
filename | string with filename of new tf |
Definition at line 523 of file QTFCanvas.cpp.
References VTransferFunction::load(), and m_TransferFunction.
Referenced by QMain::load_tf_file().
VTransferFunction* QTFCanvas::m_TransferFunction [private] |
1D Transferfunction.
Definition at line 203 of file QTFCanvas.h.
Referenced by getTransferFunctionPtr(), loadTf(), mouseClickEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mouseReleaseEvent(), paintGL(), QTFCanvas(), saveTf(), setActiveTF(), and setHistogram().
std::vector< VTransferFunction > QTFCanvas::m_TFVector [private] |
1D Transferfunction.
Definition at line 204 of file QTFCanvas.h.
Referenced by getTransferFunctionPtr(), QTFCanvas(), setActiveTF(), and ~QTFCanvas().
float QTFCanvas::m_maxdensity [private] |
maxdensity of volume.
Definition at line 206 of file QTFCanvas.h.
QScrollBar* QTFCanvas::hbar [private] |
Pointer to the scrollbar.
Definition at line 207 of file QTFCanvas.h.
Referenced by mouseDoubleClickEvent(), and setHScroll().
QScrollBar* QTFCanvas::vbar [private] |
Pointer to the scrollbar.
Definition at line 208 of file QTFCanvas.h.
Referenced by mouseDoubleClickEvent(), and setVScroll().
bool QTFCanvas::tfbig [private] |
if the tf is zoomed.
Definition at line 210 of file QTFCanvas.h.
Referenced by defaultSize(), mouseClickEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mouseReleaseEvent(), and QTFCanvas().