Main Page Alphabetical List Compound List File List Compound Members Related Pages

# TTransfer Class Reference

This class represents the transfer function. More...

`#include <transfer.h>`

List of all members.

## Public Methods
| TTransfer (THistogram *h)
| Constructor.
| ~TTransfer ()
| Destructor.
int | split (TPaintBox *pb, int x, int y)
| Split the line at position (x,y).
void | clear ()
| Delete all lines.
bool | select (TPaintBox *pb, int x, int y)
| Select the line at position (x,y).
void | select (int idx)
| Select the line with index idx.
void | selectStart (int idx)
| Select the start point of the selected line.
void | selectEnd (int idx)
| Select the end point of the selected line.
TLine * | getSelected ()
| Returns the selected line.
int | getSelIdx ()
| Returns the index of the selected line.
TLine * | getLine (int idx)
| Get line with index idx.
void | unselect ()
| Unselect all lines.
void | drawTo (TPaintBox *pb)
| Draw the transfer function to the TPaintBox pb.
int __fastcall | lineNear (TPaintBox *pb, int x, int y)
| Return the index if the line to which the point (x,y) is near or -1 otherwise.
bool __fastcall | nearStart (int idx, TPaintBox *pb, int x, int y)
| Returns true if the point (x,y) is near the start point of the selected line.
bool __fastcall | nearEnd (int idx, TPaintBox *pb, int x, int y)
| Returns true if the point (x,y) is near the start point of the selected line.
int __fastcall | getName (double data)
| Get the name to the value spezified by data.
rgba __fastcall | getColor (__int16 data)
| Get the color value for the data value data.
TData __fastcall | getData (double data)
| Get data on base of a float value.
bool | loadFromXLM (_di_IXMLNode doc)
| Set up transfer function from XML document.
bool | saveToXML (_di_IXMLNode doc)
| Write to xml document.
int | addName (AnsiString &name)
| Add a new name to the names list.
## Public Attributes
__property int | numLines = { read=_fill }
| Number of lines currently in the lines array.
__property bool | Dirty = { write=_dirty }
| Dirty flag for the RGBA cache.
__property TStringList * | areaNames = { read=_areaNames }
| Area names list.
## Private Methods
void | _addLine (TLine *l)
| Add a new line at the end of the lines array.
void | _insertLine (TLine *l, int pos)
| Insert a line to the lines array at position pos.
void | _cleanTDataCache ()
| Clear the RBGA cache :).
bool | _setupTDataCache (__int16 data)
| Set up cache for position data.
## Private Attributes
int | _size
| The lines array size.
int | _hsize
| The histogram size.
int | _fill
| The fill of the lines array.
TLine ** | _lines
| The lines array.
THistogram * | _histo
| A reference to THistogram used to get several information from it during drawing it to the TPaintBox.
TData ** | _TDataCache
| A Cache to speed up the calculation of the color and alpha data for the voxel data.
TStringList * | _areaNames
| Area name list.

## Detailed Description

This class represents the transfer function.

It is on the one side responsible for drawing the transfer function to a TPaintBox and on the other side for applying color and alpha data for the whole spectrum of the histogram.

Todo:
  Refine nearLine to find all lines.

Definition at line 326 of file transfer.h.

## Member Function Documentation

bool TTransfer::select | ( | TPaintBox * | pb,
|  | int | x,
|  | int | y
| ) |

| Select the line at position (x,y). The function finds the line by itself. Definition at line 333 of file transfer.cpp. References _lines, lineNear(), TLine::Selected, and unselect(). Referenced by split().

int TTransfer::split | ( | TPaintBox * | pb,
|  | int | x,
|  | int | y
| ) |

| Split the line at position (x,y). The function finds the right line by itself. Definition at line 307 of file transfer.cpp. References _histo, _insertLine(), _lines, TLine::End, THistogram::getHPP(), lineNear(), nearEnd(), nearStart(), select(), and TLinePoint::X.

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

- transfer.h
- transfer.cpp