FlowVis.Data.TransferFunction Class Reference

A transfer function maps int values to colors. This is done by nodes which define a color for a certain position. The color values between these positions will be interpolated. More...

List of all members.

Public Member Functions

 TransferFunction ()
 Constructor creates a new transfer function.
Math.Vector3f GetColorByCoord (float position)
 Returns the interpolated value at a specified position. The value for the position should be between 0 and 1.
Math.Vector3f GetColorByIndex (int index)
 Returns a color from a specified node.
Math.Vector3f GetColorByKey (int key)
 Returns a color specified by a key of the interpolated data.
float GetCoordByIndex (int index)
 Calculates the percentaged position of the index. This depends on the resolution of the transfer function.
int GetKeyByIndex (int index)
 Returns the key of the node with the specified index. The key depends on the resolution of the transfer function.
void AddNodeByCoord (float position, Math.Vector3f color)
 Adds a node to the transfer function. A node is defined by its position and a color value.
void RemoveNodeByCoord (float position, float range)
 Removes the node of the transfer function. The node is identified with the position which has been defined when the node has been added to the transfer function.
bool ContainsNodeByCoord (float position, float range)
 Checks if the transfer function has a node at the specified position.
int GetKeyByCoord (float position, float range)
 Converts a coordinate value into the according key value. Only a valid position is returned if a node exists with the calculated key.
void ChangeNodeColorByCoord (float position, float range, Math.Vector3f color)
 If the node at the specified position exists, the color is changed.
void MoveNodeByCoord (float oldPosition, float range, float translation)
 Moves a node if there exists one at the specified position. The node is distinguished by it's coords (within a range). The new position of the node is the old position plus the translation value.
bool MoveNodeToNewCoord (float oldPosition, float range, float newPosition)
 Moves an existent node to a new position.
int MoveNodeByKeyToNewCoord (int oldkey, float newPosition)
 Moves an existing node with the specified key to a new position given in coordinates.

Properties

int IndexCount [get]
 Get the number of nodes.
Math.Vector3f[] InterpolatedData [get]
 Returns an array of 3d vectors which represents the interpolated colors.


Detailed Description

A transfer function maps int values to colors. This is done by nodes which define a color for a certain position. The color values between these positions will be interpolated.


Constructor & Destructor Documentation

FlowVis.Data.TransferFunction.TransferFunction (  ) 

Constructor creates a new transfer function.


Member Function Documentation

Math.Vector3f FlowVis.Data.TransferFunction.GetColorByCoord ( float  position  ) 

Returns the interpolated value at a specified position. The value for the position should be between 0 and 1.

Parameters:
position position for which the color value is retrieved
Returns:
interpolated color value

Math.Vector3f FlowVis.Data.TransferFunction.GetColorByIndex ( int  index  ) 

Returns a color from a specified node.

Parameters:
index index of the sorted list which contains all nodes
Returns:
Color at the specified index position

Math.Vector3f FlowVis.Data.TransferFunction.GetColorByKey ( int  key  ) 

Returns a color specified by a key of the interpolated data.

Parameters:
key A key is defined between zero and the resolution - 1
Returns:
Interpolated color value

float FlowVis.Data.TransferFunction.GetCoordByIndex ( int  index  ) 

Calculates the percentaged position of the index. This depends on the resolution of the transfer function.

Parameters:
index index of the sorted list which contains all nodes
Returns:
coord in the range of 0 and 1

int FlowVis.Data.TransferFunction.GetKeyByIndex ( int  index  ) 

Returns the key of the node with the specified index. The key depends on the resolution of the transfer function.

Parameters:
index index of the sorted list which contains all nodes
Returns:
key in the range of zero and the texture resolution minus one

void FlowVis.Data.TransferFunction.AddNodeByCoord ( float  position,
Math.Vector3f  color 
)

Adds a node to the transfer function. A node is defined by its position and a color value.

Parameters:
position Coordinate in the range of 0 and 1
color Color which should be specified at the new node

void FlowVis.Data.TransferFunction.RemoveNodeByCoord ( float  position,
float  range 
)

Removes the node of the transfer function. The node is identified with the position which has been defined when the node has been added to the transfer function.

Parameters:
position Coordinate in the range of 0 and 1
range range around the position. The node is also deleted if it is located in this area

bool FlowVis.Data.TransferFunction.ContainsNodeByCoord ( float  position,
float  range 
)

Checks if the transfer function has a node at the specified position.

Parameters:
position Coordinate in the range of 0 and 1
range Range which increases the area to look for the node
Returns:
true if a node exists

int FlowVis.Data.TransferFunction.GetKeyByCoord ( float  position,
float  range 
)

Converts a coordinate value into the according key value. Only a valid position is returned if a node exists with the calculated key.

Parameters:
position Coordinate in the range of 0 to 1
range Range broadens the area in which for a node with the computed key is looked
Returns:
Key in the range of 0 and

void FlowVis.Data.TransferFunction.ChangeNodeColorByCoord ( float  position,
float  range,
Math.Vector3f  color 
)

If the node at the specified position exists, the color is changed.

Parameters:
position 
color 
range 

void FlowVis.Data.TransferFunction.MoveNodeByCoord ( float  oldPosition,
float  range,
float  translation 
)

Moves a node if there exists one at the specified position. The node is distinguished by it's coords (within a range). The new position of the node is the old position plus the translation value.

Parameters:
oldPosition 
range 
translation Translation given in coords (from 0 to 1).

bool FlowVis.Data.TransferFunction.MoveNodeToNewCoord ( float  oldPosition,
float  range,
float  newPosition 
)

Moves an existent node to a new position.

Parameters:
oldPosition 
range 
newPosition 
Returns:

int FlowVis.Data.TransferFunction.MoveNodeByKeyToNewCoord ( int  oldkey,
float  newPosition 
)

Moves an existing node with the specified key to a new position given in coordinates.

Parameters:
oldkey Key of the existing node
newPosition Position given with coordinate in the range of 0 and 1
Returns:
Key of the new position


Property Documentation

int FlowVis.Data.TransferFunction.IndexCount [get]

Get the number of nodes.

Math.Vector3f [] FlowVis.Data.TransferFunction.InterpolatedData [get]

Returns an array of 3d vectors which represents the interpolated colors.


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 16:09:36 2008 for FlowVis by  doxygen 1.5.1-p1