#include <vuTFDesign.h>
Inheritance diagram for vuTFDesign:
Public Member Functions | |
vuTFDesign (dword ncomp=4, dword range=256) | |
Constructor creating an empty transfer function. | |
virtual | ~vuTFDesign () |
dword | addOpacity (byte intensity, float alpha) |
Adds an opacity control node to the transfer function. | |
void | removeOpacity (dword index) |
Removes a previously added opacity control node. | |
dword | getNumOpacities () const |
Returns the number of opacity control nodes defined for the function. | |
const OpacityNode & | getOpacity (dword index) const |
float | getOpacitySmoothing () const |
Returns the relative smoothing of the opacity function. | |
void | setOpacitySmoothing (float rate) |
Sets the relative smoothing of the opacity function. | |
dword | addColour (dword intensity, const vuColourN &_col) |
Adds a colour control node to the transfer function. | |
dword | addColour (dword intensity, const float *_col) |
Adds a colour control node to the transfer function. | |
void | removeColour (dword index) |
Removes a previously added colour control node. | |
dword | getNumColours () const |
Returns the number of colour control nodes defined for the function. | |
const ColourNode & | getColour (dword index) const |
Returns the colour control node at the given index. | |
dword | getColourNodeIndex (const ColourNode &cnode) const |
Returns index of a colour node. | |
virtual void | clearAllNodes () |
Remove all colour and opacity nodes and insert default nodes at 0 and m_Range-1. | |
float | getColourSmoothing () const |
Returns the relative smoothing between the colour nodes. | |
void | setColourSmoothing (float rate) |
Sets the relative smoothing between the colour control nodes. | |
virtual void | generateFunction () |
Generates the transfer function using the defined control nodes. | |
virtual void | generateOpacities () |
Interpolates the opacity nodes as alpha values into the transfer function. | |
bool | loadTF (const char *fname) |
Load a specifiaction for a transfer function from a text file. | |
bool | saveTF (const char *fname) const |
Save the specified transfer function. | |
vuTFDesign (dword ncomp=4, dword range=256) | |
Constructor creating an empty transfer function. | |
virtual | ~vuTFDesign () |
dword | addOpacity (byte intensity, float alpha) |
Adds an opacity control node to the transfer function. | |
void | removeOpacity (dword index) |
Removes a previously added opacity control node. | |
dword | getNumOpacities () const |
Returns the number of opacity control nodes defined for the function. | |
const OpacityNode & | getOpacity (dword index) const |
float | getOpacitySmoothing () const |
Returns the relative smoothing of the opacity function. | |
void | setOpacitySmoothing (float rate) |
Sets the relative smoothing of the opacity function. | |
dword | addColour (dword intensity, const vuColourN &_col) |
Adds a colour control node to the transfer function. | |
dword | addColour (dword intensity, const float *_col) |
Adds a colour control node to the transfer function. | |
void | removeColour (dword index) |
Removes a previously added colour control node. | |
dword | getNumColours () const |
Returns the number of colour control nodes defined for the function. | |
const ColourNode & | getColour (dword index) const |
Returns the colour control node at the given index. | |
dword | getColourNodeIndex (const ColourNode &cnode) const |
Returns index of a colour node. | |
virtual void | clearAllNodes () |
Remove all colour and opacity nodes and insert default nodes at 0 and m_Range-1. | |
float | getColourSmoothing () const |
Returns the relative smoothing between the colour nodes. | |
void | setColourSmoothing (float rate) |
Sets the relative smoothing between the colour control nodes. | |
virtual void | generateFunction () |
Generates the transfer function using the defined control nodes. | |
virtual void | generateOpacities () |
Interpolates the opacity nodes as alpha values into the transfer function. | |
bool | loadTF (const char *fname) |
Load a specifiaction for a transfer function from a text file. | |
bool | saveTF (const char *fname) const |
Save the specified transfer function. | |
Protected Member Functions | |
void | smooth (float *array, float percent) const |
Smooths the passed in array, of num elements, by the given percentage. | |
void | Parse (const char *filename) throw (const char *) |
Parses the file. | |
virtual void | parseTFunc () |
Parse the file. | |
virtual void | writeTFunc (ofstream &ofp) const |
Save the specified transfer function to output stream. | |
bool | writeNComp (ofstream &ofp) const |
write number of components in this tfunc to file | |
bool | readNComp () |
Reads a reset line that can setup a different number of components. | |
bool | readOpacity () |
Read a line defining an opacity control point. | |
bool | writeOpacities (ofstream &ofp) const |
Writing equicalent to readOpacity(). | |
bool | readColour () |
Read a line defining a colour control point. | |
bool | writeColours (ofstream &ofp) const |
Writing equivalent to readColour(). | |
void | smooth (float *array, float percent) const |
Smooths the passed in array, of num elements, by the given percentage. | |
void | Parse (const char *filename) throw (const char *) |
Parses the file. | |
virtual void | parseTFunc () |
Parse the file. | |
virtual void | writeTFunc (ofstream &ofp) const |
Save the specified transfer function to output stream. | |
bool | writeNComp (ofstream &ofp) const |
write number of components in this tfunc to file | |
bool | readNComp () |
Reads a reset line that can setup a different number of components. | |
bool | readOpacity () |
Read a line defining an opacity control point. | |
bool | writeOpacities (ofstream &ofp) const |
Writing equicalent to readOpacity(). | |
bool | readColour () |
Read a line defining a colour control point. | |
bool | writeColours (ofstream &ofp) const |
Writing equivalent to readColour(). | |
Protected Attributes | |
vuDVector< OpacityNode > | m_Opacities |
The opacity control nodes. | |
float | m_OpacitySmoothing |
The relative smoothing of the opacity function. | |
vuDVector< ColourNode > | m_Colours |
The colour control nodes. | |
float | m_ColourSmoothing |
The relative smoothing of the colour function. | |
vuDVector< OpacityNode > | m_Opacities |
The opacity control nodes. | |
vuDVector< ColourNode > | m_Colours |
The colour control nodes. |
This class is a powerful transfer function that lets you define transfer functions of any complexity. The transfer function is built from two types of control nodes.
First, there are opacity control nodes which control the opacity transfer function. These define an opacity polyline function for assigning opacity to byte density values. Specifically, they define vertices which are then joined using straight lines. Before being applied, the opacity polyline is smoothed to avoid any sharp changes.
Second, there are colour control nodes which define colour regions for the transfer function. These combine the rgb values into one type of control node, to be applied over a density region. For simplicity, the colour control nodes are defined at a given density value, and define the colour for all density values before, up to the next colour control node. The colour regions are smoothed as well so as to avoid sharp colour changes.
Together, the two control nodes define an opacity transfer function with colours applied to the different regions. There can be an unlimited number of control nodes, limited only by the number of density values.
Definition at line 38 of file General/vuTFunc/vuTFDesign.h.
|
Constructor creating an empty transfer function. The empty transfer function is seethrough and black throughout. To get different behaviour, opacity and colour control nodes have to be added. Definition at line 10 of file General/vuTFunc/vuTFDesign.cpp. References vuDVector< T >::add(), generateFunction(), m_Colours, m_ColourSmoothing, m_Opacities, and m_OpacitySmoothing. |
Here is the call graph for this function:
|
Definition at line 72 of file General/vuTFunc/vuTFDesign.h. |
|
Constructor creating an empty transfer function. The empty transfer function is seethrough and black throughout. To get different behaviour, opacity and colour control nodes have to be added. |
|
Definition at line 72 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesign.h. |
|
Adds a colour control node to the transfer function.
|
|
Adds a colour control node to the transfer function.
|
|
Adds a colour control node to the transfer function.
Definition at line 141 of file General/vuTFunc/vuTFDesign.cpp. References dword, vuDVector< T >::getLength(), vuDVector< T >::insert(), and m_Colours. |
Here is the call graph for this function:
|
Adds a colour control node to the transfer function.
Definition at line 117 of file General/vuTFunc/vuTFDesign.cpp. References dword, vuDVector< T >::getLength(), vuDVector< T >::insert(), and m_Colours. Referenced by Scanner::_initTransferFunction(), vuSplat::init(), vuSpectral::init(), vuSpecFVR::init(), vuSlicer::init(), vuRaycast::init(), vuBccSplat::init(), vuBCCSheetSplatter::init(), vuTransferCanvas::OnMouse(), readColour(), and vuTransferCanvas::setActiveColour(). |
Here is the call graph for this function:
|
Adds an opacity control node to the transfer function.
|
|
Adds an opacity control node to the transfer function.
Definition at line 28 of file General/vuTFunc/vuTFDesign.cpp. References dword, vuDVector< T >::getLength(), vuDVector< T >::insert(), and m_Opacities. Referenced by Scanner::_initTransferFunction(), vuSplat::init(), vuSpectral::init(), vuSpecFVR::init(), vuSlicer::init(), vuShearWarp::init(), vuRaycast::init(), vuBccSplat::init(), vuBCCSheetSplatter::init(), vuBCCShearWarp::init(), vuTransferCanvas::OnMouse(), readOpacity(), vuTransferCanvas::setActiveOpacity(), and vu1112117::vu1112117(). |
Here is the call graph for this function:
|
Remove all colour and opacity nodes and insert default nodes at 0 and m_Range-1.
Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. |
|
Remove all colour and opacity nodes and insert default nodes at 0 and m_Range-1.
Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. Definition at line 78 of file General/vuTFunc/vuTFDesign.cpp. References vuDVector< T >::add(), vuDVector< T >::getLength(), m_Colours, m_ColourSmoothing, m_Opacities, m_OpacitySmoothing, and vuDVector< T >::removeRange(). Referenced by vuTFDesignSpec::clearAllNodes(), and parseTFunc(). |
Here is the call graph for this function:
|
Generates the transfer function using the defined control nodes. The added opacity and colour control nodes don't take effect until this method is called. The function is generated as described in the comments on the class, with smoothing automatically applied. Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. |
|
Here is the call graph for this function:
|
Interpolates the opacity nodes as alpha values into the transfer function.
Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. |
|
Interpolates the opacity nodes as alpha values into the transfer function.
Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. Definition at line 254 of file General/vuTFunc/vuTFDesign.cpp. References dword, vuDVector< T >::getLength(), and m_Opacities. Referenced by generateFunction(). |
Here is the call graph for this function:
|
Returns the colour control node at the given index.
|
|
Returns the colour control node at the given index.
Definition at line 194 of file General/vuTFunc/vuTFDesign.cpp. References m_Colours. Referenced by vuTransferCanvas::getActiveColour(), vuTransferCanvas::OnMouse(), vuTransferCanvas::render(), and writeColours(). |
|
Returns index of a colour node.
|
|
Returns index of a colour node.
Definition at line 183 of file General/vuTFunc/vuTFDesign.cpp. References dword, vuTFDesign::ColourNode::intensity, and m_Colours. Referenced by vuTransferDialog::OnOpen(). |
|
Returns the relative smoothing between the colour nodes.
|
|
Returns the relative smoothing between the colour nodes.
Definition at line 204 of file General/vuTFunc/vuTFDesign.cpp. |
|
Returns the number of colour control nodes defined for the function.
|
|
Returns the number of colour control nodes defined for the function.
Definition at line 178 of file General/vuTFunc/vuTFDesign.cpp. References dword, vuDVector< T >::getLength(), and m_Colours. Referenced by vuTransferCanvas::OnMouse(), vuTransferCanvas::render(), vuTFDesignSpec::updateFromPalette(), vuTFDesignSpec::updatePalette(), and writeColours(). |
Here is the call graph for this function:
|
Returns the number of opacity control nodes defined for the function.
|
|
Returns the number of opacity control nodes defined for the function.
Definition at line 62 of file General/vuTFunc/vuTFDesign.cpp. References dword, vuDVector< T >::getLength(), and m_Opacities. Referenced by vuTransferCanvas::OnMouse(), vuTransferCanvas::render(), vuTFDesignSpec::setLightOpacityNode(), and writeOpacities(). |
Here is the call graph for this function:
|
Returns the opacity control node with the given index. |
|
Returns the opacity control node with the given index. Definition at line 71 of file General/vuTFunc/vuTFDesign.cpp. References m_Opacities. Referenced by vuTransferCanvas::getActiveOpacity(), vuTransferCanvas::OnMouse(), vuTransferCanvas::render(), and writeOpacities(). |
|
Returns the relative smoothing of the opacity function.
|
|
Returns the relative smoothing of the opacity function.
Definition at line 97 of file General/vuTFunc/vuTFDesign.cpp. |
|
Load a specifiaction for a transfer function from a text file. Calls virtual parseTFunc()
|
|
Load a specifiaction for a transfer function from a text file. Calls virtual parseTFunc()
Definition at line 312 of file General/vuTFunc/vuTFDesign.cpp. References Parse(). Referenced by vuCellProjector::init(), loadTFuncFromFile(), Scanner::loadTFuncFromFile(), main(), and vuTransferDialog::OnLoadTF(). |
Here is the call graph for this function:
|
Parses the file. Calls parseTFunc(). Reimplemented from vuParser. |
|
Parses the file. Calls parseTFunc(). Reimplemented from vuParser. Definition at line 428 of file General/vuTFunc/vuTFDesign.cpp. References vuParser::FixBuffer(), parseTFunc(), and vuParser::readBuffer(). Referenced by loadTF(). |
Here is the call graph for this function:
|
Parse the file. Customize this function to add own features to the loader. Make use of readOpacity(), readColour() and maybe see example parser in source file. This class is derived from vuParser and provides some helper functions for file parsing. Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. |
|
Parse the file. Customize this function to add own features to the loader. Make use of readOpacity(), readColour() and maybe see example parser in source file. This class is derived from vuParser and provides some helper functions for file parsing. Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. Definition at line 435 of file General/vuTFunc/vuTFDesign.cpp. References clearAllNodes(), readColour(), readNComp(), and readOpacity(). Referenced by Parse(). |
Here is the call graph for this function:
|
Read a line defining a colour control point. If there is a syntactic error a char* exception is thrown. On succesful reading the colour node is added to the transfer function.
|
|
Read a line defining a colour control point. If there is a syntactic error a char* exception is thrown. On succesful reading the colour node is added to the transfer function.
Definition at line 448 of file General/vuTFunc/vuTFDesign.cpp. References addColour(), dword, vuParser::readNumber(), and vuParser::readString(). Referenced by vuTFDesignSpec::parseTFunc(), and parseTFunc(). |
Here is the call graph for this function:
|
Reads a reset line that can setup a different number of components. If successfull the transfer function will be reset to the new number of components |
|
Reads a reset line that can setup a different number of components. If successfull the transfer function will be reset to the new number of components Definition at line 347 of file General/vuTFunc/vuTFDesign.cpp. References vuTFIntensity::init(), vuParser::readNumber(), and vuParser::readString(). Referenced by vuTFDesignSpec::parseTFunc(), and parseTFunc(). |
Here is the call graph for this function:
|
Read a line defining an opacity control point. If there is a syntactic error a char* exception is thrown. On succesful reading the opacity node is added to the transfer function.
|
|
Read a line defining an opacity control point. If there is a syntactic error a char* exception is thrown. On succesful reading the opacity node is added to the transfer function.
Definition at line 471 of file General/vuTFunc/vuTFDesign.cpp. References addOpacity(), dword, vuParser::readNumber(), and vuParser::readString(). Referenced by vuTFDesignSpec::parseTFunc(), and parseTFunc(). |
Here is the call graph for this function:
|
Removes a previously added colour control node.
|
|
Removes a previously added colour control node.
Definition at line 165 of file General/vuTFunc/vuTFDesign.cpp. References vuDVector< T >::getLength(), m_Colours, and vuDVector< T >::remove(). Referenced by vuTransferCanvas::OnMouse(), and vuTransferCanvas::setActiveColour(). |
Here is the call graph for this function:
|
Removes a previously added opacity control node.
|
|
Removes a previously added opacity control node.
Definition at line 49 of file General/vuTFunc/vuTFDesign.cpp. References vuDVector< T >::getLength(), m_Opacities, and vuDVector< T >::remove(). Referenced by vuTransferCanvas::OnMouse(), and vuTransferCanvas::setActiveOpacity(). |
Here is the call graph for this function:
|
Save the specified transfer function. Calls virtual writeTFunc() |
|
Save the specified transfer function. Calls virtual writeTFunc() Definition at line 324 of file General/vuTFunc/vuTFDesign.cpp. References writeTFunc(). Referenced by vuTransferDialog::OnSaveTF(). |
Here is the call graph for this function:
|
Sets the relative smoothing between the colour control nodes.
|
|
Sets the relative smoothing between the colour control nodes.
Definition at line 214 of file General/vuTFunc/vuTFDesign.cpp. References m_ColourSmoothing. Referenced by Scanner::_initTransferFunction(), vuSplat::init(), vuSpectral::init(), vuSpecFVR::init(), vuSlicer::init(), vuShearWarp::init(), vuRaycast::init(), vuCellProjector::init(), vuBccSplat::init(), vuBCCSheetSplatter::init(), vuBCCShearWarp::init(), vuTransferCanvas::setSmoothing(), and vu1112117::vu1112117(). |
|
Sets the relative smoothing of the opacity function.
|
|
Sets the relative smoothing of the opacity function.
Definition at line 106 of file General/vuTFunc/vuTFDesign.cpp. References m_OpacitySmoothing. Referenced by Scanner::_initTransferFunction(), vuSplat::init(), vuSpectral::init(), vuSpecFVR::init(), vuSlicer::init(), vuShearWarp::init(), vuRaycast::init(), vuCellProjector::init(), vuBccSplat::init(), vuBCCSheetSplatter::init(), vuBCCShearWarp::init(), vuTransferCanvas::setSmoothing(), and vu1112117::vu1112117(). |
|
Smooths the passed in array, of num elements, by the given percentage.
|
|
Smooths the passed in array, of num elements, by the given percentage.
Definition at line 278 of file General/vuTFunc/vuTFDesign.cpp. References data. Referenced by generateFunction(). |
|
Writing equivalent to readColour(). Writes information of all colour nodes to the output file stream ofp. |
|
Writing equivalent to readColour(). Writes information of all colour nodes to the output file stream ofp. Definition at line 373 of file General/vuTFunc/vuTFDesign.cpp. References vuTFDesign::ColourNode::col, dword, getColour(), getNumColours(), and vuTFDesign::ColourNode::intensity. Referenced by vuTFDesignSpec::writeTFunc(), and writeTFunc(). |
Here is the call graph for this function:
|
write number of components in this tfunc to file
|
|
write number of components in this tfunc to file
Definition at line 341 of file General/vuTFunc/vuTFDesign.cpp. Referenced by vuTFDesignSpec::writeTFunc(), and writeTFunc(). |
|
Writing equicalent to readOpacity(). Writes information about all opacity nodes to the output file stream ofp. |
|
Writing equicalent to readOpacity(). Writes information about all opacity nodes to the output file stream ofp. Definition at line 362 of file General/vuTFunc/vuTFDesign.cpp. References dword, getNumOpacities(), getOpacity(), vuTFDesign::OpacityNode::intensity, and vuTFDesign::OpacityNode::opacity. Referenced by vuTFDesignSpec::writeTFunc(), and writeTFunc(). |
Here is the call graph for this function:
|
Save the specified transfer function to output stream. Override to save extended properties of derived transfer function. On error throw const char * Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. |
|
Save the specified transfer function to output stream. Override to save extended properties of derived transfer function. On error throw const char * Reimplemented in vuTFDesignSpec, and vuTFDesignSpec. Definition at line 334 of file General/vuTFunc/vuTFDesign.cpp. References writeColours(), writeNComp(), and writeOpacities(). Referenced by saveTF(). |
Here is the call graph for this function:
|
The colour control nodes.
Definition at line 193 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesign.h. |
|
The colour control nodes.
Definition at line 193 of file General/vuTFunc/vuTFDesign.h. Referenced by addColour(), clearAllNodes(), generateFunction(), getColour(), getColourNodeIndex(), getNumColours(), removeColour(), and vuTFDesign(). |
|
The relative smoothing of the colour function.
Definition at line 195 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesign.h. Referenced by clearAllNodes(), generateFunction(), setColourSmoothing(), and vuTFDesign(). |
|
The opacity control nodes.
Definition at line 188 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesign.h. |
|
The opacity control nodes.
Definition at line 188 of file General/vuTFunc/vuTFDesign.h. Referenced by addOpacity(), clearAllNodes(), generateOpacities(), getNumOpacities(), getOpacity(), removeOpacity(), and vuTFDesign(). |
|
The relative smoothing of the opacity function.
Definition at line 190 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesign.h. Referenced by clearAllNodes(), generateFunction(), setOpacitySmoothing(), and vuTFDesign(). |