Links
Flow visualization
TTF Class
TTF = class(TGUISprite);

TTransferFunctions = class ds:TDataSet; histval:array[0..3]of array of cardinal;//values from the histogram xpos,pxpos:integer; scale:array[0..3]of single; 

iw,ih:integer; //dimensions of the target image mdx,mdy:integer; //mouse down coordinates 

TransFunc:array[0..3] of array of TTransferNode;//nodes of the transfer function TransFuncPoints:array[0..3]of integer;//number of nodes in the transfer function SquareSize:integer; //size of the rectangle drawn around a node 

CURRENT:integer; 

constructor Create(d:TDataSet; w,h:integer); destructor Destroy;override; procedure Histogram(w:integer); procedure DrawHistogram(c:TCanvas; w,h:integer; zoom:integer); procedure DrawSlider(c:TCanvas; w,h:integer); procedure MoveSlider(x:integer); procedure DrawTransferFunction(c:TCanvas; w,h:integer; zoom:integer); procedure AddTransferPoint(x,y,w,h:integer; c:TColor); procedure MouseDown(x,y:integer); procedure MouseUp(x,y:integer); function PointInSquare(px,py,sx,sy:integer):boolean; procedure SaveToTexture(n:integer); function GetTransfer(p:single;n:integer):TVector4f; function ColorToRGB(c:TColor):TVector3f; function GetInfo(x,y:integer; var n:TTransferNode):integer; procedure SetInfo(n:TTransferNode; i:integer); procedure RemoveNode(i:integer); end;

Field 
Description 
Anim 
Access to the TAnimation structure. 
Access to the TColordialog component 
Type of attribute that is handled by this transfer function - direction, speed,... 
unused 
Number of node, that is being dragged. Default = -1. 
ds 
Access to the TDataSet structure. 
flow 
Access to the TFlow structure. 
Texture data of the global histogram texture. 
True if the global histogram (all timesteps in one) is shown. 
Pointer to the texture of the global histogram 
Pointer to the mesh of transfer node 
Texture data of histogram textures for all time steps 
Histogram values for single time steps. 
Histogram values for the global historagm 
htex 
Histogram texture pointers for all the time steps. 
Pointer to the mesh of transfer node 
Pointer to the mesh of transfer node 
Number of node, that is selected. Default = -1. 
If false, only the transfer functino is drawn. 
Number of transfer points. 
Array of instances of the TTransferNode class. 
Method 
Description 
Transforms TColor value to a 3d vector of <0..1> 
Constructor, creates default transfer functions. 
Deletes texture, when switched to another TTF instance. 
Deletes selected transfer node. 
Destructor. Frees memory. 
Determines color of a point form <0..1> 
Checks if a swapped histogram texture from previous usage of the dataset exists. 
Saves data for creation of the histogram texture for one time step. 
If no data swapped, this generates the global histogram texture data. 
If no data swapped, this generates the histogram texture data for one tiome step. 
Init 
Initializes the histogram and transfer node meshes (display lists) 
Loads a lit of transfer nodes form a file 
Creates histogram textures for all time steps and global histogram from a swapped file. 
Draw routine called one per frame. 
MouseUp handler 
Checks if there is a transfer node under the mouse pointer 
Used by onSelect. It draw one node for onSelect
Resets the transfer function to it default. 
Saves data to be swapped to HDD. 
Saves the array of transfer nodes to a file 
Makes the transfer function visible and loads the textures to graphical memory. 
Sorts the transfer nodes by their position 
Determines, if the mouse clicked into the transfer node i. 
makes no node selected 
 
Data Member 
 
Method 
 
virtual 
Created with a demo version of Doc-O-Matic. This version is supplied for evaluation purposes only, do not distribute this documentation. To obtain a commercial license please see http://www.doc-o-matic.com/purchase.html.
Copyright (c) 2005. All rights reserved.
What do you think about this topic? Send feedback!