TransferFunction Class Reference

#include <TransferFunction.h>

List of all members.

Public Member Functions

 TransferFunction (const float _x, const float _y, const float _width, const float _height, const int _numberOfBars, const float _pointSize, ColorChooser *_colorChooser, Shader *_shader, int _textureID, bool _extraTF, FlowData *_dataset, int _channelNr)
 ~TransferFunction ()
void setPointList (TransferPointList *_pointList)
TransferPointListgetPointList ()
void render ()
bool isTransferFunctionClicked (const float xWorld, const float yWorld)
void handleClick (const int button, const int state, const float xWorld, const float yWorld)
void updateTransferFunctionTextureData ()
void uploadTexture ()
 TransferFunction (const float _x, const float _y, const float _width, const float _height, const int _numberOfBars, const float _pointSize, ColorChooser *_colorChooser, Shader *_shader, int _textureID, bool _extraTF, FlowData *_dataset, int _channelNr)
 ~TransferFunction ()
void setPointList (TransferPointList *_pointList)
TransferPointListgetPointList ()
void render ()
bool isTransferFunctionClicked (const float xWorld, const float yWorld)
void handleClick (const int button, const int state, const float xWorld, const float yWorld)
void updateTransferFunctionTextureData ()
void uploadTexture ()

Protected Member Functions

void initHistogramm ()
void drawHistogramm ()
void drawTransferPointPolynom ()
void drawTransferPoint (TransferPoint *prePoint, TransferPoint *point)
void drawDensityDistribution ()
void initHistogramm ()
void drawHistogramm ()
void drawTransferPointPolynom ()
void drawTransferPoint (TransferPoint *prePoint, TransferPoint *point)
void drawDensityDistribution ()

Private Attributes

float x
float y
float width
float height
float pointSize
int numberOfBars
int * histogramm
float * logHistHeights
int maxOfHistogramm
TransferPointListpointList
ColorChoosercolorChooser
bool pointDragged
Shadershader
unsigned char * transferTextureData
GLuint transferTexture
int textureID
bool extraTF
FlowDatadataset
int channelNr


Detailed Description

The transfer function class

Constructor & Destructor Documentation

TransferFunction::TransferFunction ( const float  _x,
const float  _y,
const float  _width,
const float  _height,
const int  _numberOfBars,
const float  _pointSize,
ColorChooser _colorChooser,
Shader _shader,
int  _textureID,
bool  _extraTF,
FlowData _dataset,
int  _channelNr 
)

Constructs a new TransferFunction object

Parameters:
_x X-Coordinate of the left down corner of the Transfer Function
_y Y-Coordinate of the left down corner of the Transfer Function
_width Width of the Transfer Function
_height Height of the Transfer Function
_numberOfBars Number of bars that are drawn to visualize the density distribution
_volume Pointer to the volume
_colorChooser Pointer to the color chooser
_shader Pointer to the Shader-Object

TransferFunction::~TransferFunction (  ) 

Destroys the object

TransferFunction::TransferFunction ( const float  _x,
const float  _y,
const float  _width,
const float  _height,
const int  _numberOfBars,
const float  _pointSize,
ColorChooser _colorChooser,
Shader _shader,
int  _textureID,
bool  _extraTF,
FlowData _dataset,
int  _channelNr 
)

TransferFunction::~TransferFunction (  ) 


Member Function Documentation

void TransferFunction::drawDensityDistribution (  )  [protected]

void TransferFunction::drawDensityDistribution (  )  [protected]

Draws the density distribution

void TransferFunction::drawHistogramm (  )  [protected]

void TransferFunction::drawHistogramm (  )  [protected]

Draws the histogram

void TransferFunction::drawTransferPoint ( TransferPoint prePoint,
TransferPoint point 
) [protected]

void TransferFunction::drawTransferPoint ( TransferPoint prePoint,
TransferPoint point 
) [protected]

Draws a transferPoint and the background between the current and the last point if the current point is not the head of the list

Parameters:
prePoint the predecessor of the current point
point the current point in the transfer point list

void TransferFunction::drawTransferPointPolynom (  )  [protected]

void TransferFunction::drawTransferPointPolynom (  )  [protected]

Draws the Transfer Point Polynom, which is the tranfer point list connected by lines and shaded with the colors of the points

TransferPointList* TransferFunction::getPointList (  ) 

TransferPointList * TransferFunction::getPointList (  ) 

Returns a pointer to the transfer-point-list

Returns:
Pointer to the transfer-point-list

void TransferFunction::handleClick ( const int  button,
const int  state,
const float  xWorld,
const float  yWorld 
)

void TransferFunction::handleClick ( const int  button,
const int  state,
const float  xWorld,
const float  yWorld 
)

Handles a click into the transfer function

Parameters:
button value indicating which button was pressed on the mouse
state value indicating whether the button was pressed or released
xWorld x-Coordinate of the click relative to the left down corner of the viewport
yWorld y-Coordinate of the click relative to the left down corner of the viewport

void TransferFunction::initHistogramm (  )  [protected]

void TransferFunction::initHistogramm (  )  [protected]

Initializes the histogram

bool TransferFunction::isTransferFunctionClicked ( const float  xWorld,
const float  yWorld 
)

bool TransferFunction::isTransferFunctionClicked ( const float  xWorld,
const float  yWorld 
)

Returns a boolean value indicating whether the current click was into the transfer function or not

Parameters:
_xWorld x-Coordinate of the click relative to the left down corner of the viewport
_yWorld y-Coordinate of the click relative to the left down corner of the viewport
Returns:
boolean value indicating whether the current click was into the transfer function or not

void TransferFunction::render (  ) 

void TransferFunction::render (  ) 

Renders the Transfer Function

void TransferFunction::setPointList ( TransferPointList _pointList  ) 

void TransferFunction::setPointList ( TransferPointList _pointList  ) 

Sets the pointer to the transfer-point-list

Parameters:
_pointList the pointer to the transfer-point-list

void TransferFunction::updateTransferFunctionTextureData (  ) 

void TransferFunction::updateTransferFunctionTextureData (  ) 

Updates the 1D transfer function texture according to the current values in the transfer function

void TransferFunction::uploadTexture (  ) 

void TransferFunction::uploadTexture (  ) 

Uploads the transfer function texture to the shader


Member Data Documentation

Pointer to the color chooser

bool TransferFunction::extraTF [private]

Determines if the transferfunction should be uploaded as a own transfer function

float TransferFunction::height [private]

Height of the Transfer Function

Pointer to the array containing the histogram values

Pointer to the array containing the logarithmized heights of the histogram bars

The maximum of the histogram

Number of bars that are drawn to visualize the density distribution

Boolean value indicating whether a transfer point is dragged at the moment or not

Pointer to the transfer-point-list

float TransferFunction::pointSize [private]

Size of the points

Pointer to the Shader-Object

ID of the underlying texture

The 1D Transfer Function Texture

unsigned char * TransferFunction::transferTextureData [private]

Pointer to an array containing the 1D Transfer Function Texture

float TransferFunction::width [private]

Width of the Transfer Function

float TransferFunction::x [private]

X-Coordinate of the left down corner of the Transfer Function

float TransferFunction::y [private]

Y-Coordinate of the left down corner of the Transfer Function


The documentation for this class was generated from the following files:

Generated on Tue Jan 20 23:44:15 2009 for FlowVis by  doxygen 1.5.7.1