Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

TxFunction Class Reference

#include <TxFunction.h>

List of all members.

Public Member Functions

 TxFunction (float x1, float y1, float x2, float y2)
 ~TxFunction ()
void addControlPoint (GLfloat x, GLfloat y, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
void removeControlPoint (TxPoint *p)
void moveControlPoint (TxPoint *point, GLfloat x, GLfloat y)
TxPointhitTxPoint (GLfloat x, GLfloat y)
TxPointgetLastTxPoint ()
TxPointgetFirstTxPoint ()
void render ()
TxPointgetNearestNeighbour (unsigned short density)
void getLinearInterpolatedColor (unsigned short density, float &red, float &green, float &blue, float &alpha)
void getLinearInterpolatedVoxelColor (float density, float &red, float &green, float &blue)
void getLevoyVoxelColor (float density, float &red, float &green, float &blue, float gradient)
void getSolidVoxelColor (float denisty, float &red, float &green, float &blue)

Private Attributes

vector< TxPointcontrolPoints


Detailed Description

This file defines a Transferfunction. A transferfunction is made of controlpoints and lines between them. The control points here are stored in a vector. To add a controlpoint, simply call the addControlPoint method.

Version:
12-04-2005


Constructor & Destructor Documentation

TxFunction::TxFunction float  x1,
float  y1,
float  x2,
float  y2
 

The contructor the tranferfunction creates a function with 2 controlpoints - at the beginning and at the end. The controlpoints are usually given by the histogram dimensions.

Parameters:
x1 the x coordinate of the first control point
y1 the y coordinate of the first control point
x2 the x coordinate of the second control point
y2 the y coordinate of the second control point

TxFunction::~TxFunction  )  [inline]
 


Member Function Documentation

void TxFunction::addControlPoint GLfloat  x,
GLfloat  y,
GLfloat  red,
GLfloat  green,
GLfloat  blue,
GLfloat  alpha
 

Add a controlPoint to the vector wich holds the TxPoints. The function should only be called after the check.

Parameters:
x the x coordinate of the control point
y the y coordinate of the control point
red color part
green color part
blue color part
alpha value

TxPoint * TxFunction::getFirstTxPoint  ) 
 

Retrieve the first point

TxPoint * TxFunction::getLastTxPoint  ) 
 

Retrieve the last point

void TxFunction::getLevoyVoxelColor float  density,
float &  red,
float &  green,
float &  blue,
float  gradient
 

void TxFunction::getLinearInterpolatedColor unsigned short  density,
float &  red,
float &  green,
float &  blue,
float &  alpha
 

Find the linear interpolated color of a given density. The method searches for the controlpoint that is next to the given density using the getNearestNeighbour method. Afterwards it calculates the distance to the two next neighbours and assigns the weighted color values to red, green, blue and alpha.

Parameters:
red component of the resulting color
green component of the resulting color
blue component of the resulting color
alpha component of the resulting color

void TxFunction::getLinearInterpolatedVoxelColor float  density,
float &  red,
float &  green,
float &  blue
 

TxPoint * TxFunction::getNearestNeighbour unsigned short  density  ) 
 

Find the next greater neighbour for a given density. This will also determine the

void TxFunction::getSolidVoxelColor float  denisty,
float &  red,
float &  green,
float &  blue
 

TxPoint* TxFunction::hitTxPoint GLfloat  x,
GLfloat  y
 

Check if the point is already in the function. This function is called each time before the user adds a point

Returns:
TxPoint* the point wich was slapped

void TxFunction::moveControlPoint TxPoint point,
GLfloat  x,
GLfloat  y
 

Update the coordinates of a given controlpoint.

Parameters:
*point a valid point in the transferfunction list
x coodinate to move to
y coordinate to move to

void TxFunction::removeControlPoint TxPoint p  ) 
 

Remove the given controlPoint from the list, if it is not the end or starting point of the transfer function.

Parameters:
*p a refernce to the point that should be removed

void TxFunction::render  ) 
 

This function draws the shape of the transfer function.


Member Data Documentation

vector<TxPoint> TxFunction::controlPoints [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Jan 24 00:36:47 2006 for ZVis by  doxygen 1.4.1