Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuTFDesignSpec Class Reference

A transfer function based on vuTFDesign with specialization on spectral colour models. More...

#include <vuTFDesignSpec.h>

Inheritance diagram for vuTFDesignSpec:

Inheritance graph
[legend]
Collaboration diagram for vuTFDesignSpec:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuTFDesignSpec (dword ncomp=32, dword range=256)
 This default constructor creates a 32 by 256 look up table for intensities.
void generateFunction ()
 Generates the transfer function using the defined control nodes.
void generateOpacities ()
 Interpolates the opacity nodes as alpha values into the transfer function.
dword addLight (const float *_col)
 Adds a light source.
const LightNodegetLightNode (dword index) const
 returns a light of given index
dword getNumLights () const
 Returns the number of lights.
void setLightWeight (dword index, float _weight)
 Set the weight for one light.
float getLightWeight (dword index) const
void weightLights (const float *weights)
 Define the weights for the lights.
void setLightIntensity (float intensity)
 Sets a scalar that is used to rescale the intensity of the light.
float getLightIntensity ()
 Returns the light intensity scaling factor.
void setLightOpacityNode (word lindex, int intensity)
 Set index of the node whose opacity should be controled by the weight of the light.
void generateLight ()
 Calculate a light source from a weighted sum of the added light sources.
void setupMtlTriAlphaNodes ()
 Adds opacity nodes to span triangles over the materials.
void setAlphaByLight ()
 Sets the alpha values of some nodes by the weights of the according light source.
void clearAllNodes ()
 Remove all colour and opacity nodes and insert default nodes at 0 and 255.
SPalettegetPalette ()
 returns a handle to the spectral palette
void updatePalette ()
 sets entries in palette according to lights and materials in transfer func.
void updateFromPalette ()
 sets materials and lights in transfer function from values in palette
 vuTFDesignSpec (dword ncomp=32, dword range=256)
 This default constructor creates a 32 by 256 look up table for intensities.
void generateFunction ()
 Generates the transfer function using the defined control nodes.
void generateOpacities ()
 Interpolates the opacity nodes as alpha values into the transfer function.
dword addLight (const float *_col)
 Adds a light source.
const LightNodegetLightNode (dword index) const
 returns a light of given index
dword getNumLights () const
 Returns the number of lights.
void setLightWeight (dword index, float _weight)
 Set the weight for one light.
float getLightWeight (dword index) const
void weightLights (const float *weights)
 Define the weights for the lights.
void setLightIntensity (float intensity)
 Sets a scalar that is used to rescale the intensity of the light.
float getLightIntensity ()
 Returns the light intensity scaling factor.
void setLightOpacityNode (word lindex, int intensity)
 Set index of the node whose opacity should be controled by the weight of the light.
void generateLight ()
 Calculate a light source from a weighted sum of the added light sources.
void setupMtlTriAlphaNodes ()
 Adds opacity nodes to span triangles over the materials.
void setAlphaByLight ()
 Sets the alpha values of some nodes by the weights of the according light source.
void clearAllNodes ()
 Remove all colour and opacity nodes and insert default nodes at 0 and 255.
SPalettegetPalette ()
 returns a handle to the spectral palette
void updatePalette ()
 sets entries in palette according to lights and materials in transfer func.
void updateFromPalette ()
 sets materials and lights in transfer function from values in palette

Protected Member Functions

void parseTFunc ()
 Parses the transfer function description file.
void writeTFunc (ofstream &ofp) const
 Save the specified transfer function to output stream.
bool readLight ()
 Read a line defining a light source.
bool writeLights (ofstream &ofp) const
 Writes information about all registered lights to the output stream.
void parseTFunc ()
 Parses the transfer function description file.
void writeTFunc (ofstream &ofp) const
 Save the specified transfer function to output stream.
bool readLight ()
 Read a line defining a light source.
bool writeLights (ofstream &ofp) const
 Writes information about all registered lights to the output stream.

Protected Attributes

vuDVector< LightNodem_Lights
float m_LightIntensity
SPalette m_Palette
vuDVector< LightNodem_Lights

Detailed Description

A transfer function based on vuTFDesign with specialization on spectral colour models.

The getRGBa() function of vuTFIntensity base class is overridden to provide a proper transformation of the spectral colours to RGBa.

Definition at line 13 of file General/vuTFunc/vuTFDesignSpec.h.


Constructor & Destructor Documentation

vuTFDesignSpec::vuTFDesignSpec dword  ncomp = 32,
dword  range = 256
[inline]
 

This default constructor creates a 32 by 256 look up table for intensities.

Definition at line 58 of file General/vuTFunc/vuTFDesignSpec.h.

vuTFDesignSpec::vuTFDesignSpec dword  ncomp = 32,
dword  range = 256
[inline]
 

This default constructor creates a 32 by 256 look up table for intensities.

Definition at line 58 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.


Member Function Documentation

dword vuTFDesignSpec::addLight const float _col  ) 
 

Adds a light source.

The spectrum is defined by an array of floating point components. The number of elements in the array has to match the number of components for the light model used in the transfer function (see constructor vuTFDesign() )

Returns:
The index of the new light source.

dword vuTFDesignSpec::addLight const float _col  ) 
 

Adds a light source.

The spectrum is defined by an array of floating point components. The number of elements in the array has to match the number of components for the light model used in the transfer function (see constructor vuTFDesign() )

Returns:
The index of the new light source.

Definition at line 62 of file General/vuTFunc/vuTFDesignSpec.cpp.

References vuDVector< T >::add(), dword, vuDVector< T >::getLength(), and m_Lights.

Referenced by readLight(), and updateFromPalette().

Here is the call graph for this function:

void vuTFDesignSpec::clearAllNodes  )  [virtual]
 

Remove all colour and opacity nodes and insert default nodes at 0 and 255.

Reimplemented from vuTFDesign.

void vuTFDesignSpec::clearAllNodes  )  [virtual]
 

Remove all colour and opacity nodes and insert default nodes at 0 and 255.

Reimplemented from vuTFDesign.

Definition at line 269 of file General/vuTFunc/vuTFDesignSpec.cpp.

References vuTFDesign::clearAllNodes(), vuDVector< T >::getLength(), m_Lights, and vuDVector< T >::removeRange().

Referenced by parseTFunc().

Here is the call graph for this function:

void vuTFDesignSpec::generateFunction  )  [virtual]
 

Generates the transfer function using the defined control nodes.

Extends vuTFDesign::generateFunction()

Reimplemented from vuTFDesign.

void vuTFDesignSpec::generateFunction  )  [virtual]
 

Generates the transfer function using the defined control nodes.

Extends vuTFDesign::generateFunction()

Reimplemented from vuTFDesign.

Definition at line 13 of file General/vuTFunc/vuTFDesignSpec.cpp.

References vuTFDesign::generateFunction().

Referenced by vuTFDialogSpec::editSpecColour(), vuSpectral::init(), vuSpecSplat::init(), vuSpecFVR::init(), main(), vuTFDialogSpec::OnEditPalette(), vuTFDialogSpec::OnSetupNodes(), and vuTFDialogSpec::OnSlideLight().

Here is the call graph for this function:

void vuTFDesignSpec::generateLight  ) 
 

Calculate a light source from a weighted sum of the added light sources.

The resulting light is stored in m_Light and is used to make 'colours' out of the reflectances, which is performed in getRGBa().

void vuTFDesignSpec::generateLight  ) 
 

Calculate a light source from a weighted sum of the added light sources.

The resulting light is stored in m_Light and is used to make 'colours' out of the reflectances, which is performed in getRGBa().

Definition at line 116 of file General/vuTFunc/vuTFDesignSpec.cpp.

References dword, vuColour< S >::getData(), getNumLights(), and m_Lights.

Referenced by weightLights().

Here is the call graph for this function:

void vuTFDesignSpec::generateOpacities  )  [virtual]
 

Interpolates the opacity nodes as alpha values into the transfer function.

Reimplemented from vuTFDesign.

void vuTFDesignSpec::generateOpacities  )  [virtual]
 

Interpolates the opacity nodes as alpha values into the transfer function.

Reimplemented from vuTFDesign.

Definition at line 20 of file General/vuTFunc/vuTFDesignSpec.cpp.

References dword, and vuDVector< T >::getLength().

Here is the call graph for this function:

float vuTFDesignSpec::getLightIntensity  )  [inline]
 

Returns the light intensity scaling factor.

Definition at line 98 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.

float vuTFDesignSpec::getLightIntensity  )  [inline]
 

Returns the light intensity scaling factor.

Definition at line 98 of file General/vuTFunc/vuTFDesignSpec.h.

Referenced by vuTFDialogSpec::updateSliders(), and vuLightDial::updateSliders().

const LightNode& vuTFDesignSpec::getLightNode dword  index  )  const
 

returns a light of given index

const vuTFDesignSpec::LightNode & vuTFDesignSpec::getLightNode dword  index  )  const
 

returns a light of given index

Definition at line 86 of file General/vuTFunc/vuTFDesignSpec.cpp.

References m_Lights.

Referenced by main(), vuTFDialogSpec::OnSlideLight(), vuTFDialogSpec::updateSliders(), and writeLights().

float vuTFDesignSpec::getLightWeight dword  index  )  const [inline]
 

Definition at line 86 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.

References getNumLights(), and m_Lights.

Here is the call graph for this function:

float vuTFDesignSpec::getLightWeight dword  index  )  const [inline]
 

Definition at line 86 of file General/vuTFunc/vuTFDesignSpec.h.

References getNumLights(), and m_Lights.

Here is the call graph for this function:

dword vuTFDesignSpec::getNumLights  )  const
 

Returns the number of lights.

dword vuTFDesignSpec::getNumLights  )  const
 

Returns the number of lights.

Definition at line 76 of file General/vuTFunc/vuTFDesignSpec.cpp.

References dword, vuDVector< T >::getLength(), and m_Lights.

Referenced by vuTFDialogSpec::buildCustomSizer(), vuLightDial::DrawShape(), vuTFDialogSpec::editSpecColour(), generateLight(), getLightWeight(), vuTFDialogSpec::OnEditPalette(), vuLightDial::reweightLights(), setLightOpacityNode(), updateFromPalette(), updatePalette(), weightLights(), and writeLights().

Here is the call graph for this function:

SPalette& vuTFDesignSpec::getPalette  )  [inline]
 

returns a handle to the spectral palette

Definition at line 123 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.

SPalette& vuTFDesignSpec::getPalette  )  [inline]
 

returns a handle to the spectral palette

Definition at line 123 of file General/vuTFunc/vuTFDesignSpec.h.

void vuTFDesignSpec::parseTFunc  )  [protected, virtual]
 

Parses the transfer function description file.

Reimplemented from vuTFDesign.

void vuTFDesignSpec::parseTFunc  )  [protected, virtual]
 

Parses the transfer function description file.

Reimplemented from vuTFDesign.

Definition at line 279 of file General/vuTFunc/vuTFDesignSpec.cpp.

References clearAllNodes(), m_Palette, vuTFDesign::readColour(), readLight(), vuTFDesign::readNComp(), vuTFDesign::readOpacity(), SPalette::reset(), and updatePalette().

Here is the call graph for this function:

bool vuTFDesignSpec::readLight  )  [protected]
 

Read a line defining a light source.

If there is a syntactic error a char* exception is thrown. On succesful reading the light node is added to the transfer function.

Returns:
true if an light line was found otherwise false.

bool vuTFDesignSpec::readLight  )  [protected]
 

Read a line defining a light source.

If there is a syntactic error a char* exception is thrown. On succesful reading the light node is added to the transfer function.

Returns:
true if an light line was found otherwise false.

Definition at line 297 of file General/vuTFunc/vuTFDesignSpec.cpp.

References addLight(), dword, vuParser::readNumber(), and vuParser::readString().

Referenced by parseTFunc().

Here is the call graph for this function:

void vuTFDesignSpec::setAlphaByLight  ) 
 

Sets the alpha values of some nodes by the weights of the according light source.

This is just an idea for handling multiple alpha values in a different way.

void vuTFDesignSpec::setAlphaByLight  ) 
 

Sets the alpha values of some nodes by the weights of the according light source.

This is just an idea for handling multiple alpha values in a different way.

Definition at line 217 of file General/vuTFunc/vuTFDesignSpec.cpp.

References vuDVector< T >::getLength(), m_Lights, and word.

Referenced by vuTFDialogSpec::OnSlideLight().

Here is the call graph for this function:

void vuTFDesignSpec::setLightIntensity float  intensity  )  [inline]
 

Sets a scalar that is used to rescale the intensity of the light.

Definition at line 96 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.

References m_LightIntensity.

void vuTFDesignSpec::setLightIntensity float  intensity  )  [inline]
 

Sets a scalar that is used to rescale the intensity of the light.

Definition at line 96 of file General/vuTFunc/vuTFDesignSpec.h.

References m_LightIntensity.

Referenced by vuTFDialogSpec::OnSlideLight(), and vuLightDial::reweightLights().

void vuTFDesignSpec::setLightOpacityNode word  lindex,
int  intensity
 

Set index of the node whose opacity should be controled by the weight of the light.

Parameters:
lindex index of the light
intensity intensity of the opacity node

void vuTFDesignSpec::setLightOpacityNode word  lindex,
int  intensity
 

Set index of the node whose opacity should be controled by the weight of the light.

Parameters:
lindex index of the light
intensity intensity of the opacity node

Definition at line 162 of file General/vuTFunc/vuTFDesignSpec.cpp.

References getNumLights(), vuTFDesign::getNumOpacities(), and m_Lights.

Referenced by vuTFDialogSpec::OnSlideLight().

Here is the call graph for this function:

void vuTFDesignSpec::setLightWeight dword  index,
float  _weight
 

Set the weight for one light.

The weight for each light is used as coefficient in the weighted sum to determine the final light source. This function does not call generateLight()

void vuTFDesignSpec::setLightWeight dword  index,
float  _weight
 

Set the weight for one light.

The weight for each light is used as coefficient in the weighted sum to determine the final light source. This function does not call generateLight()

Definition at line 94 of file General/vuTFunc/vuTFDesignSpec.cpp.

References m_Lights.

Referenced by weightLights().

void vuTFDesignSpec::setupMtlTriAlphaNodes  ) 
 

Adds opacity nodes to span triangles over the materials.

This is used for the alpha manipulation by light weights in connection with multiple spectral light sources.

void vuTFDesignSpec::setupMtlTriAlphaNodes  ) 
 

Adds opacity nodes to span triangles over the materials.

This is used for the alpha manipulation by light weights in connection with multiple spectral light sources.

Definition at line 180 of file General/vuTFunc/vuTFDesignSpec.cpp.

References vuDVector< T >::getLength(), vuDVector< T >::insert(), vuDVector< T >::removeRange(), and word.

Referenced by vuTFDialogSpec::OnSetupNodes().

Here is the call graph for this function:

void vuTFDesignSpec::updateFromPalette  ) 
 

sets materials and lights in transfer function from values in palette

void vuTFDesignSpec::updateFromPalette  ) 
 

sets materials and lights in transfer function from values in palette

Definition at line 345 of file General/vuTFunc/vuTFDesignSpec.cpp.

References addLight(), dword, vuColour< S >::getData(), SPalette::getNLights(), SPalette::getNRefls(), vuTFDesign::getNumColours(), getNumLights(), SPalette::getSpec(), m_Lights, and m_Palette.

Referenced by vuTFDialogSpec::editSpecColour(), and vuTFDialogSpec::OnEditPalette().

Here is the call graph for this function:

void vuTFDesignSpec::updatePalette  ) 
 

sets entries in palette according to lights and materials in transfer func.

void vuTFDesignSpec::updatePalette  ) 
 

sets entries in palette according to lights and materials in transfer func.

Definition at line 321 of file General/vuTFunc/vuTFDesignSpec.cpp.

References SPalette::addLight(), SPalette::addReflectance(), dword, SPalette::getNLights(), SPalette::getNRefls(), vuTFDesign::getNumColours(), getNumLights(), SPalette::getSpec(), ns_vu1112112::light, m_Lights, m_Palette, and SPalette::matchDesignColours().

Referenced by vuTFDialogSpec::editSpecColour(), vuTFDialogSpec::OnEditPalette(), and parseTFunc().

Here is the call graph for this function:

void vuTFDesignSpec::weightLights const float weights  ) 
 

Define the weights for the lights.

The light source used for the scene is then a weighted sum of the given lights ATTENTION: The length of the weights array has to match the number of light sources given by getNumLights(). This function also calls generateLight()

void vuTFDesignSpec::weightLights const float weights  ) 
 

Define the weights for the lights.

The light source used for the scene is then a weighted sum of the given lights ATTENTION: The length of the weights array has to match the number of light sources given by getNumLights(). This function also calls generateLight()

Definition at line 103 of file General/vuTFunc/vuTFDesignSpec.cpp.

References dword, generateLight(), getNumLights(), and setLightWeight().

Referenced by vuTFDialogSpec::OnSlideLight(), and vuLightDial::reweightLights().

Here is the call graph for this function:

bool vuTFDesignSpec::writeLights ofstream &  ofp  )  const [protected]
 

Writes information about all registered lights to the output stream.

bool vuTFDesignSpec::writeLights ofstream &  ofp  )  const [protected]
 

Writes information about all registered lights to the output stream.

Definition at line 254 of file General/vuTFunc/vuTFDesignSpec.cpp.

References vuTFDesignSpec::LightNode::col, dword, getLightNode(), getNumLights(), and word.

Referenced by writeTFunc().

Here is the call graph for this function:

void vuTFDesignSpec::writeTFunc ofstream &  ofp  )  const [protected, virtual]
 

Save the specified transfer function to output stream.

Override to save extended properties of derived transfer function. On error throw const char *

Reimplemented from vuTFDesign.

void vuTFDesignSpec::writeTFunc ofstream &  ofp  )  const [protected, virtual]
 

Save the specified transfer function to output stream.

Override to save extended properties of derived transfer function. On error throw const char *

Reimplemented from vuTFDesign.

Definition at line 246 of file General/vuTFunc/vuTFDesignSpec.cpp.

References vuTFDesign::writeColours(), writeLights(), vuTFDesign::writeNComp(), and vuTFDesign::writeOpacities().

Here is the call graph for this function:


Member Data Documentation

float vuTFDesignSpec::m_LightIntensity [protected]
 

Definition at line 155 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.

Referenced by setLightIntensity().

vuDVector<LightNode> vuTFDesignSpec::m_Lights [protected]
 

Definition at line 154 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.

vuDVector<LightNode> vuTFDesignSpec::m_Lights [protected]
 

Definition at line 154 of file General/vuTFunc/vuTFDesignSpec.h.

Referenced by addLight(), clearAllNodes(), generateLight(), getLightNode(), getLightWeight(), getNumLights(), setAlphaByLight(), setLightOpacityNode(), setLightWeight(), updateFromPalette(), and updatePalette().

SPalette vuTFDesignSpec::m_Palette [protected]
 

Definition at line 156 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFDesignSpec.h.

Referenced by parseTFunc(), updateFromPalette(), and updatePalette().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:22:07 2004 for vuVolume by  doxygen 1.3.9.1