#include <VTransferFunction.h>
Public Member Functions | |
VTransferFunction () | |
~VTransferFunction () | |
void | draw1d () |
void | setHistogram (std::vector< int > *volumeHistogram) |
void | setZoomPoint (bool zoom_active, float x, bool bigcanvas) |
float | getAlpha (int index) |
void | addTransferFunctionPoint (int density, vTransferFunctionPoint newPoint) |
int | transferFunctionPointInRange (int selectedDensity, float alpha, int range) |
vTransferFunctionPoint | getTransferFunctionPoint (int density) |
void | removeTransferFunctionPoint (int density) |
unsigned int | getGLHandle () |
void | setMainCanvas (QVolRendCanvas *maincanvas) |
void | setMaxHist (float val) |
bool | load (std::string filename) |
bool | save (std::string filename) |
void | clear () |
void | renderTest () |
Private Member Functions | |
void | generateDisplayList () |
void | interpolateTransferPoints () |
double | round (double Zahl, int Stellen) |
Private Attributes | |
std::map< int, vTransferFunctionPoint > | m_FuncControlPoints |
std::vector < vTransferFunctionPoint > | m_TransferFunction |
unsigned int | m_VolumeHistogramDisplayList |
unsigned int | m_TransferFunctionHandle |
bool | m_hasChanged |
QVolRendCanvas * | m_MainCanvas |
float | m_maxdensity |
VFramebufferObject * | m_FramebufferObject |
float | zoom_ptx |
bool | m_zoom_active |
bool | bigzoom |
Definition at line 32 of file VTransferFunction.h.
VTransferFunction::VTransferFunction | ( | ) | [inline] |
default constructor
Definition at line 39 of file VTransferFunction.h.
VTransferFunction::~VTransferFunction | ( | ) |
default destructor
Definition at line 6 of file VTransferFunction.cpp.
References m_FuncControlPoints, m_MainCanvas, m_TransferFunction, and m_VolumeHistogramDisplayList.
void VTransferFunction::draw1d | ( | ) |
draws the Transferfunction
Definition at line 30 of file VTransferFunction.cpp.
References m_FuncControlPoints, and m_VolumeHistogramDisplayList.
Referenced by QTFCanvas::paintGL().
void VTransferFunction::setHistogram | ( | std::vector< int > * | volumeHistogram | ) | [inline] |
sets the current Histogram
volumeHistogram | Histogram of current loaded Volume |
Definition at line 63 of file VTransferFunction.h.
Referenced by QTFCanvas::setHistogram().
void VTransferFunction::setZoomPoint | ( | bool | zoom_active, | |
float | x, | |||
bool | bigcanvas | |||
) | [inline] |
sets the Point where the TF should be zoomed to
zoom_active | if zoom is active | |
x | zoom point | |
bigcanvas | if the bigcanvas is shown |
Definition at line 76 of file VTransferFunction.h.
References bigzoom, m_zoom_active, and zoom_ptx.
Referenced by QTFCanvas::mouseMoveEvent(), and QTFCanvas::mouseReleaseEvent().
float VTransferFunction::getAlpha | ( | int | index | ) | [inline] |
gets the alpha Value of a Point with a given density
index | equals the density of the point |
Definition at line 89 of file VTransferFunction.h.
References m_FuncControlPoints.
Referenced by QTFCanvas::mouseDoubleClickEvent().
void VTransferFunction::addTransferFunctionPoint | ( | int | density, | |
vTransferFunctionPoint | newPoint | |||
) |
adds a Point to the current Transferfunction
density | densitiy value of new Point | |
newPoint | Values of the new Point |
Definition at line 149 of file VTransferFunction.cpp.
References interpolateTransferPoints(), m_FuncControlPoints, and m_hasChanged.
Referenced by QTFCanvas::mouseClickEvent(), QTFCanvas::mouseDoubleClickEvent(), and QTFCanvas::mouseMoveEvent().
int VTransferFunction::transferFunctionPointInRange | ( | int | selectedDensity, | |
float | alpha, | |||
int | range | |||
) | [inline] |
checks if a current transferFunctionPoint is already set in the specified range
selectedDensity | of selection in range [0,4095] | |
alpha | Alpha Value of Point | |
range | around the given density where it should be looked for a point |
Definition at line 109 of file VTransferFunction.h.
References m_FuncControlPoints.
Referenced by QTFCanvas::mouseClickEvent(), QTFCanvas::mouseDoubleClickEvent(), and QTFCanvas::mouseMoveEvent().
vTransferFunctionPoint VTransferFunction::getTransferFunctionPoint | ( | int | density | ) | [inline] |
returns the Point at a given Density
Definition at line 169 of file VTransferFunction.h.
References m_FuncControlPoints.
Referenced by QTFCanvas::mouseMoveEvent().
void VTransferFunction::removeTransferFunctionPoint | ( | int | density | ) |
removes the Transferfunction point with the given density
density | of Point to remove |
Definition at line 158 of file VTransferFunction.cpp.
References m_FuncControlPoints, and m_hasChanged.
Referenced by QTFCanvas::mouseDoubleClickEvent(), and QTFCanvas::mouseMoveEvent().
unsigned int VTransferFunction::getGLHandle | ( | ) | [inline] |
gets the OpenGL Handle of the transferfunction
Definition at line 184 of file VTransferFunction.h.
References VFramebufferObject::getTextureHandle(), interpolateTransferPoints(), m_FramebufferObject, and m_hasChanged.
Referenced by QVolRendCanvas::paintGL().
void VTransferFunction::setMainCanvas | ( | QVolRendCanvas * | maincanvas | ) | [inline] |
sets the Main Canvas, used for switching to the right context
maincanvas | the Pointer to the Main Canvas |
Definition at line 198 of file VTransferFunction.h.
References m_MainCanvas.
Referenced by QVolRendCanvas::setArrowTransferFunctionPtr(), QVolRendCanvas::setLicTransferFunctionPtr(), QVolRendCanvas::setStreamLineTransferFunctionPtr(), and QVolRendCanvas::setTransferFunctionPtr().
void VTransferFunction::setMaxHist | ( | float | val | ) | [inline] |
sets the maximum density of the histogram
val | maximum value |
Definition at line 207 of file VTransferFunction.h.
References m_maxdensity.
bool VTransferFunction::load | ( | std::string | filename | ) |
loads a tf from the disc
filename | name of File |
Definition at line 244 of file VTransferFunction.cpp.
References vTransferFunctionPoint::m_Alpha, vTransferFunctionPoint::m_Color, m_FuncControlPoints, and m_hasChanged.
Referenced by QTFCanvas::loadTf().
bool VTransferFunction::save | ( | std::string | filename | ) |
saves a tf from the disc
filename | name of File |
Definition at line 284 of file VTransferFunction.cpp.
References m_FuncControlPoints.
Referenced by QTFCanvas::saveTf().
void VTransferFunction::clear | ( | ) | [inline] |
resets the tf
Definition at line 227 of file VTransferFunction.h.
References m_FuncControlPoints, m_hasChanged, m_TransferFunction, and m_TransferFunctionHandle.
void VTransferFunction::renderTest | ( | ) | [inline] |
Definition at line 235 of file VTransferFunction.h.
References m_FramebufferObject, and VFramebufferObject::renderToLowerLeftQuad().
void VTransferFunction::generateDisplayList | ( | ) | [private] |
generates the DisplayList
Definition at line 167 of file VTransferFunction.cpp.
void VTransferFunction::interpolateTransferPoints | ( | ) | [private] |
interpolates the Transferfunction Points
Definition at line 193 of file VTransferFunction.cpp.
References VFramebufferObject::bind(), VFramebufferObject::getFboHandle(), VFramebufferObject::init(), m_FramebufferObject, m_FuncControlPoints, m_hasChanged, m_MainCanvas, and VFramebufferObject::unbind().
Referenced by addTransferFunctionPoint(), and getGLHandle().
double VTransferFunction::round | ( | double | Zahl, | |
int | Stellen | |||
) | [inline, private] |
method for rounding a double to certain steps
Zahl | the value to round | |
Stellen | numbers behind the coma |
Definition at line 259 of file VTransferFunction.h.
std::map<int, vTransferFunctionPoint> VTransferFunction::m_FuncControlPoints [private] |
Control Points of the Transferfunction.
Definition at line 265 of file VTransferFunction.h.
Referenced by addTransferFunctionPoint(), clear(), draw1d(), getAlpha(), getTransferFunctionPoint(), interpolateTransferPoints(), load(), removeTransferFunctionPoint(), save(), transferFunctionPointInRange(), and ~VTransferFunction().
std::vector<vTransferFunctionPoint> VTransferFunction::m_TransferFunction [private] |
All computed Values of the Transferfunction.
Definition at line 266 of file VTransferFunction.h.
Referenced by clear(), and ~VTransferFunction().
unsigned int VTransferFunction::m_VolumeHistogramDisplayList [private] |
Handle for OpenGl DisplayList used when drawing the Histogram.
Definition at line 268 of file VTransferFunction.h.
Referenced by draw1d(), and ~VTransferFunction().
unsigned int VTransferFunction::m_TransferFunctionHandle [private] |
Handle to Texture where Transferfunction is Stored.
Definition at line 270 of file VTransferFunction.h.
Referenced by clear().
bool VTransferFunction::m_hasChanged [private] |
If Transferfunction has changed since last Render to texture.
Definition at line 272 of file VTransferFunction.h.
Referenced by addTransferFunctionPoint(), clear(), getGLHandle(), interpolateTransferPoints(), load(), and removeTransferFunctionPoint().
QVolRendCanvas* VTransferFunction::m_MainCanvas [private] |
Pointer to Main Canvas.
Definition at line 273 of file VTransferFunction.h.
Referenced by interpolateTransferPoints(), setMainCanvas(), and ~VTransferFunction().
float VTransferFunction::m_maxdensity [private] |
MaximumDensity of the Histogram.
Definition at line 274 of file VTransferFunction.h.
Referenced by setMaxHist().
FBO where tf is stored.
Definition at line 276 of file VTransferFunction.h.
Referenced by getGLHandle(), interpolateTransferPoints(), and renderTest().
float VTransferFunction::zoom_ptx [private] |
Value where the zoom is applied.
Definition at line 278 of file VTransferFunction.h.
Referenced by setZoomPoint().
bool VTransferFunction::m_zoom_active [private] |
If Zoom is active.
Definition at line 279 of file VTransferFunction.h.
Referenced by setZoomPoint().
bool VTransferFunction::bigzoom [private] |
If Zoom is bigzoom.
Definition at line 280 of file VTransferFunction.h.
Referenced by setZoomPoint().