#include <QTFCanvas.h>
Public Member Functions | |
| QTFCanvas (QWidget *parent=0) | |
| virtual | ~QTFCanvas () |
| void | setHistogram (std::vector< int > *histogram, unsigned char *histogram2d) |
| VTransferFunction * | getTransferFunctionPtr () |
| VTransferFunction2D * | getTransferFunction2DPtr () |
| void | setObjectName (const QString &name) |
| void | setModePtr (QComboBox *qmode) |
| void | setHScroll (QScrollBar *_hbar) |
| void | setVScroll (QScrollBar *_vbar) |
| void | defaultSize () |
| void | checkForLongClick () |
| void | modeChanged (int index) |
| 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 |
| VTransferFunction2D | m_TransferFunction2d |
| float | m_maxdensity |
| QComboBox * | m_tfmode_cb_Ptr |
| QScrollBar * | hbar |
| QScrollBar * | vbar |
| int | m_tfmode |
| bool | tfbig |
Definition at line 21 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.
| QTFCanvas::~QTFCanvas | ( | ) | [virtual] |
default destructor
Definition at line 33 of file QTFCanvas.cpp.
| 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 708 of file QTFCanvas.cpp.
References m_TransferFunction, m_TransferFunction2d, VTransferFunction::setHistogram(), and VTransferFunction2D::setHistogram2D().
Referenced by QMain::load_data_file().
| VTransferFunction * QTFCanvas::getTransferFunctionPtr | ( | ) |
returns a pointer to the 1d transferfunction
Definition at line 716 of file QTFCanvas.cpp.
References m_TransferFunction.
Referenced by QMain::QMain().
| VTransferFunction2D * QTFCanvas::getTransferFunction2DPtr | ( | ) |
returns a pointer to the 2d transferfunction
Definition at line 721 of file QTFCanvas.cpp.
References m_TransferFunction2d.
Referenced by QMain::QMain().
| void QTFCanvas::initializeGL | ( | ) | [protected, virtual] |
method for initializing the OpenGl context
Definition at line 66 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 77 of file QTFCanvas.cpp.
| void QTFCanvas::paintGL | ( | ) | [protected, virtual] |
paint method
Definition at line 85 of file QTFCanvas.cpp.
References VTransferFunction::draw1d(), VTransferFunction2D::draw2d(), m_tfmode, m_TransferFunction, and m_TransferFunction2d.
Referenced by redraw().
| void QTFCanvas::setObjectName | ( | const QString & | name | ) |
sets the Objectname
| name | QString containing the Widgets name |
Definition at line 39 of file QTFCanvas.cpp.
Referenced by Ui_QMain::setupUi().
| void QTFCanvas::setModePtr | ( | QComboBox * | qmode | ) |
sets the Current Transferfunction Mode
| qmode | Mode to the Combobox storing the modes |
Definition at line 43 of file QTFCanvas.cpp.
References m_tfmode_cb_Ptr.
Referenced by QMain::QMain().
| void QTFCanvas::setHScroll | ( | QScrollBar * | _hbar | ) | [inline] |
sets the state of the horizontal scrollbar
| _hbar | Pointer to the scrollbar |
Definition at line 94 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 103 of file QTFCanvas.h.
References vbar.
Referenced by QMain::QMain().
| void QTFCanvas::defaultSize | ( | ) | [inline] |
resets the size of the canvas
Definition at line 111 of file QTFCanvas.h.
References tfbig.
Referenced by QMain::load_tf_file().
| void QTFCanvas::checkForLongClick | ( | ) |
checks if the mouse is pressed for a certain time
Definition at line 48 of file QTFCanvas.cpp.
References clicked, dtClick, VMouseEvent::getPosition(), m_tfmode_cb_Ptr, and RIGHT_PRESSED.
Referenced by QMain::watch().
| void QTFCanvas::modeChanged | ( | int | index | ) |
method called when the mode of the TF Window is changed
| index | index of mode |
Definition at line 726 of file QTFCanvas.cpp.
References m_tfmode, and RIGHT_PRESSED.
Referenced by QMain::QMain(), QMain::tf_menu(), QMain::tf_menu_1d(), QMain::tf_menu_2d(), and QMain::tf_menu_no().
| void QTFCanvas::paintEvent | ( | QPaintEvent * | e | ) | [virtual] |
paint event for Canvas
| e | Pointer to the Event |
Definition at line 148 of file QTFCanvas.cpp.
| void QTFCanvas::mousePressEvent | ( | QMouseEvent * | e | ) | [virtual] |
method handling the mouse Press Event
| e | QMouseEvent |
Definition at line 153 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 162 of file QTFCanvas.cpp.
References clicked, dragging_tfpt, dragging_tfpt2d, dtClick, m_tfmode_cb_Ptr, 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 186 of file QTFCanvas.cpp.
References VTransferFunction::addTransferFunctionPoint(), VTransferFunction2D::changePointPosition(), VTransferFunction2D::changeTriangleSize(), VTransferFunction2D::changeTriangleSkew(), dragging_tfpt, dragging_tfpt2d, VTransferFunction2D::findIndexTransferFunctionPoint(), VMouseEvent::getLeftState(), VMouseEvent::getMiddleState(), VMouseEvent::getModifiers(), getMouseEvent(), VMouseEvent::getPosition(), VMouseEvent::getRightState(), VTransferFunction::getTransferFunctionPoint(), VVector::getX(), VVector::getY(), vTransferFunctionPoint::m_Alpha, m_tfmode, m_TransferFunction, m_TransferFunction2d, VMouseEvent::MODIFIER_CTRL, modifytriangle, 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 412 of file QTFCanvas.cpp.
References VTransferFunction2D::addTransferFunctionPoint(), VTransferFunction::addTransferFunctionPoint(), VMouseEvent::getLeftState(), VMouseEvent::getModifiers(), VMouseEvent::getPosition(), VVector::getX(), VVector::getY(), VVector::getZ(), vTransferFunctionPoint::m_Alpha, vTransferFunctionPoint::m_Color, m_tfmode, m_TransferFunction, m_TransferFunction2d, VMouseEvent::MODIFIER_ALT, VMouseEvent::MODIFIER_CTRL, tfbig, THRESHOLD_DETAIL, THRESHOLD_OVERVIEW, VTransferFunction2D::transferFunctionPointInRange(), and VTransferFunction::transferFunctionPointInRange().
Referenced by mouseReleaseEvent().
| void QTFCanvas::mouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [virtual] |
method handling the mouse doubleclick Event
| e | QMouseEvent |
Definition at line 509 of file QTFCanvas.cpp.
References VTransferFunction::addTransferFunctionPoint(), VTransferFunction2D::changePointColor(), VTransferFunction::getAlpha(), VMouseEvent::getLeftState(), VMouseEvent::getModifiers(), getMouseEvent(), VMouseEvent::getPosition(), VMouseEvent::getRightState(), VVector::getX(), VVector::getY(), hbar, vTransferFunctionPoint::m_Alpha, vTransferFunctionPoint::m_Color, m_tfmode, m_TransferFunction, m_TransferFunction2d, VMouseEvent::MODIFIER_ALT, VMouseEvent::MODIFIER_CTRL, VTransferFunction2D::removeTransferFunctionPoint(), 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 655 of file QTFCanvas.cpp.
| void QTFCanvas::keyReleaseEvent | ( | QKeyEvent * | e | ) | [virtual] |
method handling the release Event
| e | QKeyEvent |
Definition at line 661 of file QTFCanvas.cpp.
| const VMouseEvent QTFCanvas::getMouseEvent | ( | QMouseEvent * | e | ) |
creates a VMouseEvent out of a QMouseEvent
| e | QMouseEvent Pointer |
Definition at line 668 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 690 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 702 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 734 of file QTFCanvas.cpp.
References m_tfmode, m_TransferFunction, m_TransferFunction2d, VTransferFunction2D::save(), 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 779 of file QTFCanvas.cpp.
References VTransferFunction2D::load(), VTransferFunction::load(), m_TransferFunction, and m_TransferFunction2d.
Referenced by QMain::load_tf_file().
1D Transferfunction.
Definition at line 210 of file QTFCanvas.h.
Referenced by getTransferFunctionPtr(), loadTf(), mouseClickEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mouseReleaseEvent(), paintGL(), saveTf(), and setHistogram().
2D Transferfunction. _
Definition at line 211 of file QTFCanvas.h.
Referenced by getTransferFunction2DPtr(), loadTf(), mouseClickEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), paintGL(), saveTf(), and setHistogram().
float QTFCanvas::m_maxdensity [private] |
maxdensity of volume.
Definition at line 213 of file QTFCanvas.h.
QComboBox* QTFCanvas::m_tfmode_cb_Ptr [private] |
Pointer to the checkbox where tfs are switched.
Definition at line 214 of file QTFCanvas.h.
Referenced by checkForLongClick(), mouseReleaseEvent(), and setModePtr().
QScrollBar* QTFCanvas::hbar [private] |
Pointer to the scrollbar.
Definition at line 215 of file QTFCanvas.h.
Referenced by mouseDoubleClickEvent(), and setHScroll().
QScrollBar* QTFCanvas::vbar [private] |
Pointer to the scrollbar.
Definition at line 216 of file QTFCanvas.h.
Referenced by mouseDoubleClickEvent(), and setVScroll().
int QTFCanvas::m_tfmode [private] |
int containing the current transferfunction mode.
Definition at line 218 of file QTFCanvas.h.
Referenced by modeChanged(), mouseClickEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), paintGL(), QTFCanvas(), and saveTf().
bool QTFCanvas::tfbig [private] |
if the tf is zoomed.
Definition at line 219 of file QTFCanvas.h.
Referenced by defaultSize(), mouseClickEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mouseReleaseEvent(), and QTFCanvas().
1.5.4