VTransferFunction Class Reference

#include <VTransferFunction.h>

List of all members.

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
QVolRendCanvasm_MainCanvas
float m_maxdensity
VFramebufferObjectm_FramebufferObject
float zoom_ptx
bool m_zoom_active
bool bigzoom


Detailed Description

class representing a Transferfunction. includes Histogram

Definition at line 32 of file VTransferFunction.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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

Parameters:
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

Parameters:
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

Parameters:
index equals the density of the point
Returns:
float containing the alpha value

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

Parameters:
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

Parameters:
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
Returns:
integer containing the density, -1 if no point found

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

Returns:
VTransferFunctionPoint

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

Parameters:
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

Returns:
unsigned int containing the handle

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

Parameters:
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

Parameters:
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

Parameters:
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

Parameters:
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

Parameters:
Zahl the value to round
Stellen numbers behind the coma
Returns:
double containing the rounded value

Definition at line 259 of file VTransferFunction.h.


Member Data Documentation

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().

VFramebufferObject* VTransferFunction::m_FramebufferObject [private]

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().


The documentation for this class was generated from the following files:
Generated on Mon Jan 21 01:15:17 2008 for FlowVis by  doxygen 1.5.4