#include <VTransferFunction.h>
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, m_VolumeHistogram, and m_VolumeHistogramDisplayList.
void VTransferFunction::draw1d | ( | ) |
draws the Transferfunction
Definition at line 28 of file VTransferFunction.cpp.
References bigzoom, QVolRendCanvas::getLoaded(), m_FuncControlPoints, m_MainCanvas, m_VolumeHistogram, m_VolumeHistogramDisplayList, m_zoom_active, and zoom_ptx.
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.
References clear(), generateDisplayList(), and m_VolumeHistogram.
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 137 of file VTransferFunction.cpp.
References 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 146 of file VTransferFunction.cpp.
References m_FuncControlPoints, and m_hasChanged.
Referenced by QTFCanvas::mouseDoubleClickEvent(), and QTFCanvas::mouseMoveEvent().
std::vector<vTransferFunctionPoint> VTransferFunction::getFullTransferFunction | ( | ) | [inline] |
computes and returns the full TransferFunction
Definition at line 184 of file VTransferFunction.h.
References interpolateTransferPoints(), m_hasChanged, and m_TransferFunction.
unsigned int VTransferFunction::getGLHandle | ( | ) | [inline] |
gets the OpenGL Handle of the transferfunction
Definition at line 197 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 211 of file VTransferFunction.h.
References m_MainCanvas.
Referenced by QVolRendCanvas::setTransferFunctionPtr().
void VTransferFunction::setMaxHist | ( | float | val | ) | [inline] |
sets the maximum density of the histogram
val | maximum value |
Definition at line 220 of file VTransferFunction.h.
References m_maxdensity.
Referenced by QVolRendCanvas::load_data().
bool VTransferFunction::load | ( | std::string | filename | ) |
loads a tf from the disc
filename | name of File |
Definition at line 231 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 271 of file VTransferFunction.cpp.
References m_FuncControlPoints.
Referenced by QTFCanvas::saveTf().
void VTransferFunction::clear | ( | ) | [inline] |
resets the tf
Definition at line 240 of file VTransferFunction.h.
References m_FuncControlPoints, m_hasChanged, m_TransferFunction, and m_TransferFunctionHandle.
Referenced by setHistogram().
void VTransferFunction::generateDisplayList | ( | ) | [private] |
generates the DisplayList
Definition at line 155 of file VTransferFunction.cpp.
References m_maxdensity, m_VolumeHistogram, and m_VolumeHistogramDisplayList.
Referenced by setHistogram().
void VTransferFunction::generateDisplayList2D | ( | ) | [private] |
void VTransferFunction::interpolateTransferPoints | ( | ) | [private] |
interpolates the Transferfunction Points
Definition at line 181 of file VTransferFunction.cpp.
References VFramebufferObject::bind(), VFramebufferObject::getFboHandle(), VFramebufferObject::init(), m_FramebufferObject, m_FuncControlPoints, m_hasChanged, and VFramebufferObject::unbind().
Referenced by getFullTransferFunction(), 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 267 of file VTransferFunction.h.
std::map<int, vTransferFunctionPoint> VTransferFunction::m_FuncControlPoints [private] |
Control Points of the Transferfunction.
Definition at line 273 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 274 of file VTransferFunction.h.
Referenced by clear(), getFullTransferFunction(), and ~VTransferFunction().
std::vector<int>* VTransferFunction::m_VolumeHistogram [private] |
Histogram of Volume.
Definition at line 275 of file VTransferFunction.h.
Referenced by draw1d(), generateDisplayList(), setHistogram(), and ~VTransferFunction().
unsigned int VTransferFunction::m_VolumeHistogramDisplayList [private] |
Handle for OpenGl DisplayList used when drawing the Histogram.
Definition at line 276 of file VTransferFunction.h.
Referenced by draw1d(), generateDisplayList(), and ~VTransferFunction().
unsigned int VTransferFunction::m_TransferFunctionHandle [private] |
Handle to Texture where Transferfunction is Stored.
Definition at line 278 of file VTransferFunction.h.
Referenced by clear().
bool VTransferFunction::m_hasChanged [private] |
If Transferfunction has changed since last Render to texture.
Definition at line 280 of file VTransferFunction.h.
Referenced by addTransferFunctionPoint(), clear(), getFullTransferFunction(), getGLHandle(), interpolateTransferPoints(), load(), and removeTransferFunctionPoint().
QVolRendCanvas* VTransferFunction::m_MainCanvas [private] |
Pointer to Main Canvas.
Definition at line 281 of file VTransferFunction.h.
Referenced by draw1d(), setMainCanvas(), and ~VTransferFunction().
float VTransferFunction::m_maxdensity [private] |
MaximumDensity of the Histogram.
Definition at line 282 of file VTransferFunction.h.
Referenced by generateDisplayList(), and setMaxHist().
FBO where tf is stored.
Definition at line 284 of file VTransferFunction.h.
Referenced by getGLHandle(), and interpolateTransferPoints().
float VTransferFunction::zoom_ptx [private] |
Value where the zoom is applied.
Definition at line 286 of file VTransferFunction.h.
Referenced by draw1d(), and setZoomPoint().
bool VTransferFunction::m_zoom_active [private] |
If Zoom is active.
Definition at line 287 of file VTransferFunction.h.
Referenced by draw1d(), and setZoomPoint().
bool VTransferFunction::bigzoom [private] |
If Zoom is bigzoom.
Definition at line 288 of file VTransferFunction.h.
Referenced by draw1d(), and setZoomPoint().