#include <VTransferFunction2D.h>
Definition at line 100 of file VTransferFunction2D.h.
VTransferFunction2D::VTransferFunction2D | ( | ) | [inline] |
default constructor
Definition at line 107 of file VTransferFunction2D.h.
VTransferFunction2D::~VTransferFunction2D | ( | ) |
default destructor
Definition at line 6 of file VTransferFunction2D.cpp.
References m_MainCanvas, m_VolumeHistogram2D, and m_VolumeHistogramDisplayList2D.
void VTransferFunction2D::reinit | ( | ) |
resets the 2D Transferfunction
Definition at line 26 of file VTransferFunction2D.cpp.
Referenced by setHistogram2D().
void VTransferFunction2D::draw2d | ( | ) |
draws the histogram
Definition at line 72 of file VTransferFunction2D.cpp.
References vNormal2DPoint::alpha, VVector::getX(), VVector::getY(), VVector::getZ(), vTransferFunction2DPoint::m_Color, vTransferFunction2DPoint::m_density, m_FuncControlPoints, m_FuncControlTriangles, vTransferFunction2DPoint::m_gmag, m_VolumeHistogramDisplayList2D, vTransferFunctionWannabeTriangle::point1, vTransferFunctionWannabeTriangle::point2, vTransferFunctionWannabeTriangle::point3, vTransferFunctionWannabeTriangle::point4, vNormal2DPoint::rgb, vNormal2DPoint::x, and vNormal2DPoint::y.
Referenced by QTFCanvas::paintGL().
void VTransferFunction2D::setHistogram2D | ( | unsigned char * | volumeHistogram2d | ) |
sets the Pointer to the data where the histogram is stored
volumeHistogram2d | char Pointer to the histogram |
Definition at line 361 of file VTransferFunction2D.cpp.
References clear(), generateDisplayList2D(), m_Histogram2DTextureHandle, m_VolumeHistogram2D, and reinit().
Referenced by QTFCanvas::setHistogram().
vTransferFunction2DPoint VTransferFunction2D::getTransferFunctionPoint | ( | float | density, | |
float | gmag | |||
) |
returns the Point at a given Density and gradient magnitude
density | Density of Point | |
gmag | GradientMagnitude of Point |
vTransferFunctionWannabeTriangle VTransferFunction2D::getTransferFunction2dTriangle | ( | float | density, | |
float | gmag | |||
) |
returns the Triangle at a given Density and gradient magnitude
density | Density of Point | |
gmag | GradientMagnitude of Point |
VVector VTransferFunction2D::transferFunctionPointInRange | ( | float | selectedDensity, | |
float | gmag, | |||
float | range | |||
) |
returns a VVector if point is in range
selectedDensity | density where to look for | |
gmag | Gradient Magnitude | |
range | searchrange |
Definition at line 204 of file VTransferFunction2D.cpp.
Referenced by QTFCanvas::mouseClickEvent().
void VTransferFunction2D::addTransferFunctionPoint | ( | vTransferFunction2DPoint | newPoint | ) |
adds a new TransferfunctionPoint
newPoint | new Point in TF |
Definition at line 168 of file VTransferFunction2D.cpp.
References vNormal2DPoint::alpha, vTransferFunction2DPoint::m_Alpha, vTransferFunction2DPoint::m_Color, vTransferFunction2DPoint::m_density, m_FuncControlPoints, m_FuncControlTriangles, vTransferFunction2DPoint::m_gmag, m_hasChanged, vTransferFunctionWannabeTriangle::point1, vTransferFunctionWannabeTriangle::point2, vTransferFunctionWannabeTriangle::point3, vTransferFunctionWannabeTriangle::point4, vNormal2DPoint::rgb, vNormal2DPoint::x, and vNormal2DPoint::y.
Referenced by QTFCanvas::mouseClickEvent().
void VTransferFunction2D::addTransferFunctionPoint | ( | vTransferFunctionWannabeTriangle | t, | |
vTransferFunction2DPoint | newPoint | |||
) |
adds a new TransferfunctionPoint
t | vTransferFunctionWannabeTriangle | |
newPoint | new Point |
Definition at line 210 of file VTransferFunction2D.cpp.
References m_FuncControlPoints, m_FuncControlTriangles, and m_hasChanged.
void VTransferFunction2D::removeTransferFunctionPoint | ( | float | density, | |
float | gmag, | |||
float | tres | |||
) |
removes a point with given values
density | given density of Point | |
gmag | Gradient Magnitude of point | |
tres | threshold |
Definition at line 217 of file VTransferFunction2D.cpp.
References m_FuncControlPoints, m_FuncControlTriangles, and m_hasChanged.
Referenced by QTFCanvas::mouseDoubleClickEvent().
int VTransferFunction2D::findIndexTransferFunctionPoint | ( | float | density, | |
float | gmag, | |||
float | tres | |||
) |
gets the index for a certain point
density | given density of possible point | |
gmag | Gradient magnitude of Point | |
tres | searchthreshold |
Definition at line 310 of file VTransferFunction2D.cpp.
References m_FuncControlPoints.
Referenced by QTFCanvas::mouseMoveEvent().
void VTransferFunction2D::changeTriangleSize | ( | int | index, | |
float | offsetw, | |||
float | offseth | |||
) |
changes the size of a Triangle
index | of triangle | |
offsetw | offset in width | |
offseth | offset in height |
Definition at line 271 of file VTransferFunction2D.cpp.
References m_FuncControlTriangles, and m_hasChanged.
Referenced by QTFCanvas::mouseMoveEvent().
void VTransferFunction2D::changeTriangleSkew | ( | int | index, | |
float | skew | |||
) |
changes the skew of the Triangle
index | of triangle | |
skew | new skew of triangle |
Definition at line 297 of file VTransferFunction2D.cpp.
References m_FuncControlTriangles, and m_hasChanged.
Referenced by QTFCanvas::mouseMoveEvent().
void VTransferFunction2D::changePointColor | ( | float | density, | |
float | gmag, | |||
VVector | color, | |||
float | a, | |||
float | tres | |||
) |
changes the color of a given Point
density | Density of Point | |
gmag | Gradient Magnitude of Point | |
color | new Color | |
a | new Alpha | |
tres | search treshold |
Definition at line 242 of file VTransferFunction2D.cpp.
References m_FuncControlPoints, m_FuncControlTriangles, and m_hasChanged.
Referenced by QTFCanvas::mouseDoubleClickEvent().
void VTransferFunction2D::changePointPosition | ( | int | index, | |
float | newx, | |||
float | newy | |||
) |
changes the position of a given triangles
index | index of triangle | |
newx | new Density | |
newy | new Gradient Magnitude |
Definition at line 327 of file VTransferFunction2D.cpp.
References m_FuncControlPoints, m_FuncControlTriangles, and m_hasChanged.
Referenced by QTFCanvas::mouseMoveEvent().
std::vector<vTransferFunctionWannabeTriangle> VTransferFunction2D::getFullTransferFunction | ( | ) | [inline] |
returns a vector with the Full Transferfunction
Definition at line 230 of file VTransferFunction2D.h.
References interpolateTransferTriangles(), m_FuncControlTriangles, and m_hasChanged.
unsigned int VTransferFunction2D::getGLHandle | ( | ) | [inline] |
gets the OpenGl Handle of the Transferfunction
Definition at line 243 of file VTransferFunction2D.h.
References VFramebufferObject::getTextureHandle(), interpolateTransferTriangles(), m_FramebufferObject, and m_hasChanged.
Referenced by QVolRendCanvas::paintGL().
void VTransferFunction2D::setMainCanvas | ( | QVolRendCanvas * | maincanvas | ) | [inline] |
sets a Pointer to the main canvas
maincanvas | Pointer to main Canvas |
Definition at line 257 of file VTransferFunction2D.h.
References m_MainCanvas.
Referenced by QVolRendCanvas::setTransferFunction2DPtr().
bool VTransferFunction2D::load | ( | std::string | filename | ) |
loads a Transferfunction with the given name
filename | filepath to Tf File |
Definition at line 481 of file VTransferFunction2D.cpp.
References vTransferFunctionWannabeTriangle::a_offseth, vTransferFunctionWannabeTriangle::a_offsetw, vTransferFunctionWannabeTriangle::a_skew, vNormal2DPoint::alpha, vTransferFunction2DPoint::m_Alpha, vTransferFunction2DPoint::m_Color, vTransferFunction2DPoint::m_density, m_FuncControlPoints, m_FuncControlTriangles, vTransferFunction2DPoint::m_gmag, m_hasChanged, vTransferFunctionWannabeTriangle::point1, vTransferFunctionWannabeTriangle::point2, vTransferFunctionWannabeTriangle::point3, vTransferFunctionWannabeTriangle::point4, vNormal2DPoint::rgb, VVector::setX(), VVector::setY(), VVector::setZ(), vNormal2DPoint::x, and vNormal2DPoint::y.
Referenced by QTFCanvas::loadTf().
bool VTransferFunction2D::save | ( | std::string | filename | ) |
saves the current Transferfunction
filename | filenname on disc |
Definition at line 571 of file VTransferFunction2D.cpp.
References vTransferFunctionWannabeTriangle::a_offseth, vTransferFunctionWannabeTriangle::a_offsetw, vTransferFunctionWannabeTriangle::a_skew, vNormal2DPoint::alpha, VVector::getX(), VVector::getY(), VVector::getZ(), vTransferFunction2DPoint::m_Alpha, vTransferFunction2DPoint::m_Color, vTransferFunction2DPoint::m_density, m_FuncControlPoints, m_FuncControlTriangles, vTransferFunction2DPoint::m_gmag, vTransferFunctionWannabeTriangle::point1, vTransferFunctionWannabeTriangle::point2, vTransferFunctionWannabeTriangle::point3, vTransferFunctionWannabeTriangle::point4, vNormal2DPoint::rgb, vNormal2DPoint::x, and vNormal2DPoint::y.
Referenced by QTFCanvas::saveTf().
void VTransferFunction2D::clear | ( | ) | [inline] |
resets the tf
Definition at line 277 of file VTransferFunction2D.h.
References m_FuncControlPoints, m_FuncControlTriangles, m_hasChanged, and m_TransferFunction2DHandle.
Referenced by setHistogram2D().
void VTransferFunction2D::renderTest | ( | ) | [inline] |
for testredering the tf
Definition at line 288 of file VTransferFunction2D.h.
References m_FramebufferObject, and VFramebufferObject::renderToLowerRightQuad().
void VTransferFunction2D::generateDisplayList2D | ( | ) | [private] |
generates the DisplayList
Definition at line 389 of file VTransferFunction2D.cpp.
References m_VolumeHistogramDisplayList2D.
Referenced by setHistogram2D().
void VTransferFunction2D::interpolateTransferTriangles | ( | ) | [private] |
interpolates the Transferfunction Points
Definition at line 418 of file VTransferFunction2D.cpp.
References vNormal2DPoint::alpha, VFramebufferObject::bind(), VFramebufferObject::getFboHandle(), VVector::getX(), VVector::getY(), VVector::getZ(), VFramebufferObject::init(), m_FramebufferObject, m_FuncControlTriangles, m_hasChanged, vTransferFunctionWannabeTriangle::point1, vTransferFunctionWannabeTriangle::point2, vTransferFunctionWannabeTriangle::point3, vTransferFunctionWannabeTriangle::point4, vNormal2DPoint::rgb, VFramebufferObject::unbind(), vNormal2DPoint::x, and vNormal2DPoint::y.
Referenced by getFullTransferFunction(), and getGLHandle().
double VTransferFunction2D::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 311 of file VTransferFunction2D.h.
std::vector<vTransferFunction2DPoint> VTransferFunction2D::m_FuncControlPoints [private] |
Control Points of the Transferfunction.
Definition at line 317 of file VTransferFunction2D.h.
Referenced by addTransferFunctionPoint(), changePointColor(), changePointPosition(), clear(), draw2d(), findIndexTransferFunctionPoint(), load(), removeTransferFunctionPoint(), and save().
std::vector<vTransferFunctionWannabeTriangle> VTransferFunction2D::m_FuncControlTriangles [private] |
Control Triangles of the Transferfunction.
Definition at line 318 of file VTransferFunction2D.h.
Referenced by addTransferFunctionPoint(), changePointColor(), changePointPosition(), changeTriangleSize(), changeTriangleSkew(), clear(), draw2d(), getFullTransferFunction(), interpolateTransferTriangles(), load(), removeTransferFunctionPoint(), and save().
unsigned char* VTransferFunction2D::m_VolumeHistogram2D [private] |
Pointer to the 2D Volume Histogram.
Definition at line 320 of file VTransferFunction2D.h.
Referenced by setHistogram2D(), and ~VTransferFunction2D().
unsigned int VTransferFunction2D::m_VolumeHistogramDisplayList2D [private] |
Handle for OpenGl DisplayList used when drawing the 2D Histogram.
Definition at line 322 of file VTransferFunction2D.h.
Referenced by draw2d(), generateDisplayList2D(), and ~VTransferFunction2D().
unsigned int VTransferFunction2D::m_TransferFunction2DHandle [private] |
Handle to Texture where Transferfunction is Stored.
Definition at line 323 of file VTransferFunction2D.h.
Referenced by clear().
unsigned int VTransferFunction2D::m_Histogram2DTextureHandle [private] |
Handle to Texture where 2D Histogram is Stored.
Definition at line 324 of file VTransferFunction2D.h.
Referenced by setHistogram2D().
bool VTransferFunction2D::m_hasChanged [private] |
If Transferfunction has changed since last Render to texture.
Definition at line 325 of file VTransferFunction2D.h.
Referenced by addTransferFunctionPoint(), changePointColor(), changePointPosition(), changeTriangleSize(), changeTriangleSkew(), clear(), getFullTransferFunction(), getGLHandle(), interpolateTransferTriangles(), load(), and removeTransferFunctionPoint().
QVolRendCanvas* VTransferFunction2D::m_MainCanvas [private] |
Pointer to Main Canvas.
Definition at line 326 of file VTransferFunction2D.h.
Referenced by setMainCanvas(), and ~VTransferFunction2D().
FBO containing the TransferfunctionTexture.
Definition at line 328 of file VTransferFunction2D.h.
Referenced by getGLHandle(), interpolateTransferTriangles(), and renderTest().