#include <TransferFunction.h>
Classes | |
struct | lessThanVertex |
struct | TransferColor |
class | Vertex |
Public Slots | |
virtual void | update () |
void | setVolume (Volume *volume) |
void | setZoomFactor (int value) |
void | loadTfFile () |
void | saveTfFile () |
Signals | |
void | getTransferFunction (unsigned int *transferFunction, int length) |
Public Member Functions | |
TransferFunction (QWidget *parent=0) | |
~TransferFunction () | |
void | timerEvent (QTimerEvent *event) |
void | paintEvent (QPaintEvent *event) |
void | mousePressEvent (QMouseEvent *event) |
void | mouseDoubleClickEvent (QMouseEvent *event) |
void | mouseMoveEvent (QMouseEvent *event) |
void | mouseReleaseEvent (QMouseEvent *event) |
QSize | sizeHint () const |
int | width () const |
void | updateSize () |
void | updateTransferfunction () |
Private Types | |
typedef std::set< Vertex *, lessThanVertex >::iterator | IteratorVertices |
Private Member Functions | |
void | initHisto () |
void | initTransferfunction () |
void | updateScale () |
void | unselectAllVertices () |
Vertex * | addVertex (int xScaled, int y) |
Vertex * | addVertex (int scaledX, QColor color) |
void | addVertex (Vertex *v) |
void | removeVertex (Vertex *v) |
Vertex * | newVertex (int xScaled, int alpha) |
void | select (Vertex *v) |
void | unselect (Vertex *v) |
bool | containsVertex (Vertex *v) |
void | removeAllVertices () |
std::set< Vertex *, lessThanVertex >::iterator | containsNearVertex (Vertex *v) |
Private Attributes | |
bool | updateAsked |
int | timerIdentifier |
Volume * | volume |
QWidget * | parent |
int | widthMax |
int | scaledWidth |
int | height |
int | zoomFactor |
double | scaleFactor |
unsigned int * | normHistoVals |
unsigned int * | normScaledHistoVals |
int | marginBottom |
int | marginRight |
QString | curDir |
TransferColor * | transferFunction |
std::set< Vertex *, lessThanVertex > | vertices |
std::set< Vertex *, lessThanVertex > | selectedVertices |
std::set< Vertex *, lessThanVertex >::iterator | movingVertex |
Definition at line 12 of file TransferFunction.h.
typedef std::set<Vertex*, lessThanVertex>::iterator TransferFunction::IteratorVertices [private] |
Definition at line 100 of file TransferFunction.h.
TransferFunction::TransferFunction | ( | QWidget * | parent = 0 |
) |
Definition at line 11 of file TransferFunction.cpp.
References height, marginBottom, marginRight, normHistoVals, normScaledHistoVals, scaleFactor, timerIdentifier, transferFunction, updateAsked, volume, widthMax, and zoomFactor.
TransferFunction::~TransferFunction | ( | ) |
Definition at line 29 of file TransferFunction.cpp.
References normHistoVals, normScaledHistoVals, removeAllVertices(), timerIdentifier, and transferFunction.
void TransferFunction::addVertex | ( | Vertex * | v | ) | [private] |
Definition at line 542 of file TransferFunction.cpp.
References containsVertex(), scaleFactor, updateTransferfunction(), vertices, TransferFunction::Vertex::x, and TransferFunction::Vertex::xScaled.
TransferFunction::Vertex * TransferFunction::addVertex | ( | int | scaledX, | |
QColor | color | |||
) | [private] |
Definition at line 525 of file TransferFunction.cpp.
References containsVertex(), scaleFactor, updateTransferfunction(), and vertices.
TransferFunction::Vertex * TransferFunction::addVertex | ( | int | xScaled, | |
int | y | |||
) | [private] |
Definition at line 510 of file TransferFunction.cpp.
References containsVertex(), scaleFactor, updateTransferfunction(), and vertices.
Referenced by initTransferfunction(), and mouseDoubleClickEvent().
TransferFunction::IteratorVertices TransferFunction::containsNearVertex | ( | Vertex * | v | ) | [private] |
Definition at line 581 of file TransferFunction.cpp.
References TransferFunction::Vertex::color, TransferFunction::Vertex::DRAW_SIZE, vertices, and TransferFunction::Vertex::xScaled.
Referenced by mouseDoubleClickEvent(), and mousePressEvent().
bool TransferFunction::containsVertex | ( | Vertex * | v | ) | [private] |
Definition at line 576 of file TransferFunction.cpp.
References vertices.
Referenced by addVertex(), and removeVertex().
void TransferFunction::getTransferFunction | ( | unsigned int * | transferFunction, | |
int | length | |||
) | [signal] |
Referenced by updateTransferfunction().
void TransferFunction::initHisto | ( | ) | [private] |
Definition at line 325 of file TransferFunction.cpp.
References Volume::getHistHeight(), Volume::getHistogramm(), height, normHistoVals, normScaledHistoVals, updateScale(), volume, and widthMax.
Referenced by setVolume().
void TransferFunction::initTransferfunction | ( | ) | [private] |
Definition at line 307 of file TransferFunction.cpp.
References addVertex(), movingVertex, removeAllVertices(), scaledWidth, transferFunction, unselectAllVertices(), updateTransferfunction(), vertices, and widthMax.
Referenced by setVolume().
void TransferFunction::loadTfFile | ( | ) | [slot] |
Definition at line 67 of file TransferFunction.cpp.
References TransferFunction::Vertex::color, curDir, removeAllVertices(), scaleFactor, update(), updateTransferfunction(), vertices, TransferFunction::Vertex::x, and TransferFunction::Vertex::xScaled.
void TransferFunction::mouseDoubleClickEvent | ( | QMouseEvent * | event | ) |
Definition at line 231 of file TransferFunction.cpp.
References addVertex(), TransferFunction::Vertex::color, containsNearVertex(), ColorPicker::getColor(), newVertex(), removeVertex(), select(), ColorPicker::setColor(), ColorPicker::startPicker(), unselect(), unselectAllVertices(), update(), and updateTransferfunction().
void TransferFunction::mouseMoveEvent | ( | QMouseEvent * | event | ) |
Definition at line 181 of file TransferFunction.cpp.
References movingVertex, scaleFactor, update(), updateTransferfunction(), and vertices.
void TransferFunction::mousePressEvent | ( | QMouseEvent * | event | ) |
Definition at line 159 of file TransferFunction.cpp.
References containsNearVertex(), movingVertex, newVertex(), select(), unselectAllVertices(), and update().
void TransferFunction::mouseReleaseEvent | ( | QMouseEvent * | event | ) |
Definition at line 173 of file TransferFunction.cpp.
TransferFunction::Vertex * TransferFunction::newVertex | ( | int | xScaled, | |
int | alpha | |||
) | [private] |
Definition at line 504 of file TransferFunction.cpp.
References scaleFactor.
Referenced by mouseDoubleClickEvent(), and mousePressEvent().
void TransferFunction::paintEvent | ( | QPaintEvent * | event | ) |
Definition at line 399 of file TransferFunction.cpp.
References height, normScaledHistoVals, scaledWidth, scaleFactor, transferFunction, vertices, and volume.
void TransferFunction::removeAllVertices | ( | ) | [private] |
Definition at line 567 of file TransferFunction.cpp.
References vertices.
Referenced by initTransferfunction(), loadTfFile(), and ~TransferFunction().
void TransferFunction::removeVertex | ( | Vertex * | v | ) | [private] |
Definition at line 556 of file TransferFunction.cpp.
References containsVertex(), movingVertex, updateTransferfunction(), vertices, widthMax, TransferFunction::Vertex::x, and TransferFunction::Vertex::xScaled.
Referenced by mouseDoubleClickEvent().
void TransferFunction::saveTfFile | ( | ) | [slot] |
void TransferFunction::select | ( | Vertex * | v | ) | [private] |
Definition at line 627 of file TransferFunction.cpp.
References TransferFunction::Vertex::selected, and selectedVertices.
Referenced by mouseDoubleClickEvent(), and mousePressEvent().
void TransferFunction::setVolume | ( | Volume * | volume | ) | [slot] |
Definition at line 283 of file TransferFunction.cpp.
References Volume::getDataRange(), height, initHisto(), initTransferfunction(), update(), and widthMax.
void TransferFunction::setZoomFactor | ( | int | value | ) | [slot] |
QSize TransferFunction::sizeHint | ( | ) | const |
void TransferFunction::timerEvent | ( | QTimerEvent * | event | ) |
void TransferFunction::unselect | ( | Vertex * | v | ) | [private] |
Definition at line 618 of file TransferFunction.cpp.
References TransferFunction::Vertex::selected, and selectedVertices.
Referenced by mouseDoubleClickEvent().
void TransferFunction::unselectAllVertices | ( | ) | [private] |
Definition at line 609 of file TransferFunction.cpp.
References selectedVertices.
Referenced by initTransferfunction(), mouseDoubleClickEvent(), and mousePressEvent().
void TransferFunction::update | ( | ) | [virtual, slot] |
Definition at line 47 of file TransferFunction.cpp.
References updateAsked.
Referenced by loadTfFile(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), setVolume(), and timerEvent().
void TransferFunction::updateScale | ( | ) | [private] |
Definition at line 472 of file TransferFunction.cpp.
References normHistoVals, normScaledHistoVals, scaledWidth, scaleFactor, vertices, width(), widthMax, and zoomFactor.
Referenced by initHisto(), and updateSize().
void TransferFunction::updateSize | ( | ) |
Definition at line 301 of file TransferFunction.cpp.
References updateScale().
Referenced by setZoomFactor().
void TransferFunction::updateTransferfunction | ( | ) |
Definition at line 358 of file TransferFunction.cpp.
References TransferFunction::TransferColor::a, TransferFunction::TransferColor::b, TransferFunction::TransferColor::g, getTransferFunction(), TransferFunction::TransferColor::r, transferFunction, vertices, and widthMax.
Referenced by addVertex(), initTransferfunction(), loadTfFile(), mouseDoubleClickEvent(), mouseMoveEvent(), and removeVertex().
int TransferFunction::width | ( | ) | const |
Definition at line 278 of file TransferFunction.cpp.
References parent.
Referenced by updateScale().
QString TransferFunction::curDir [private] |
int TransferFunction::height [private] |
Definition at line 50 of file TransferFunction.h.
Referenced by initHisto(), paintEvent(), setVolume(), sizeHint(), and TransferFunction().
int TransferFunction::marginBottom [private] |
int TransferFunction::marginRight [private] |
std::set<Vertex*, lessThanVertex>::iterator TransferFunction::movingVertex [private] |
Definition at line 99 of file TransferFunction.h.
Referenced by initTransferfunction(), mouseMoveEvent(), mousePressEvent(), and removeVertex().
unsigned int* TransferFunction::normHistoVals [private] |
Definition at line 52 of file TransferFunction.h.
Referenced by initHisto(), TransferFunction(), updateScale(), and ~TransferFunction().
unsigned int* TransferFunction::normScaledHistoVals [private] |
Definition at line 53 of file TransferFunction.h.
Referenced by initHisto(), paintEvent(), TransferFunction(), updateScale(), and ~TransferFunction().
QWidget* TransferFunction::parent [private] |
int TransferFunction::scaledWidth [private] |
Definition at line 50 of file TransferFunction.h.
Referenced by initTransferfunction(), paintEvent(), sizeHint(), and updateScale().
double TransferFunction::scaleFactor [private] |
Definition at line 51 of file TransferFunction.h.
Referenced by addVertex(), loadTfFile(), mouseMoveEvent(), newVertex(), paintEvent(), TransferFunction(), and updateScale().
std::set<Vertex*, lessThanVertex> TransferFunction::selectedVertices [private] |
Definition at line 87 of file TransferFunction.h.
Referenced by select(), unselect(), and unselectAllVertices().
int TransferFunction::timerIdentifier [private] |
Definition at line 46 of file TransferFunction.h.
Referenced by TransferFunction(), and ~TransferFunction().
TransferColor* TransferFunction::transferFunction [private] |
Definition at line 62 of file TransferFunction.h.
Referenced by initTransferfunction(), paintEvent(), TransferFunction(), updateTransferfunction(), and ~TransferFunction().
bool TransferFunction::updateAsked [private] |
Definition at line 45 of file TransferFunction.h.
Referenced by timerEvent(), TransferFunction(), and update().
std::set<Vertex*, lessThanVertex> TransferFunction::vertices [private] |
Definition at line 86 of file TransferFunction.h.
Referenced by addVertex(), containsNearVertex(), containsVertex(), initTransferfunction(), loadTfFile(), mouseMoveEvent(), paintEvent(), removeAllVertices(), removeVertex(), saveTfFile(), updateScale(), and updateTransferfunction().
Volume* TransferFunction::volume [private] |
Definition at line 48 of file TransferFunction.h.
Referenced by initHisto(), paintEvent(), and TransferFunction().
int TransferFunction::widthMax [private] |
Definition at line 50 of file TransferFunction.h.
Referenced by initHisto(), initTransferfunction(), removeVertex(), setVolume(), TransferFunction(), updateScale(), and updateTransferfunction().
int TransferFunction::zoomFactor [private] |
Definition at line 50 of file TransferFunction.h.
Referenced by setZoomFactor(), TransferFunction(), and updateScale().