Developer Documentation
TextureMath Class Reference

Public Member Functions

 TextureMath (const bool _abs, const bool _clamp, const double _clampMin, const double _clampMax, const bool _repeat, const double _minRepeat, const double _maxRepeat, const bool _center, const bool _scale, const double _minimalInput, const double _maximalInput)
 
 TextureMath (const TexParameters &_parameters, const double _minimalInput, const double _maximalInput)
 Convenience constructor. More...
 
double transform (const double _input) const
 Modify given values based on the specified parameters given to the constructor. More...
 

Private Attributes

bool abs_
 
bool clamp_
 
double clampMin_
 
double clampMax_
 
bool repeat_
 
double repeatMin_
 
double repeatMax_
 
bool center_
 
bool scale_
 
double minInput_
 
double maxInput_
 

Detailed Description

Definition at line 55 of file TextureMath.hh.

Constructor & Destructor Documentation

TextureMath::TextureMath ( const bool  _abs,
const bool  _clamp,
const double  _clampMin,
const double  _clampMax,
const bool  _repeat,
const double  _minRepeat,
const double  _maxRepeat,
const bool  _center,
const bool  _scale,
const double  _minimalInput,
const double  _maximalInput 
)

\ brief Initialize converter

The values are modified in the following way:
First the absolute value of the property is taken if requested (_abs)

Then this value is clamped against the given values (_clamp,_clampMin,_clampMax)

If the texture should be repeated, the values are translated such that the minimum is at min_val(0.0 by default) and than scaled such that the maximum is at max_val. This data is than passed to the rendering (_repeat,_minRepeat,_maxRepeat)

If the texture should not be repeated you could choose to center the data around 0.5. The negative values are than mapped to 0..0.5 and the positive values to 0.5..1 (_center)

Otherwise, the values are mapped directly to 0..1. You can also disable that final scaling with (_scale)

Parameters
_absTake absolute value?
_clampClamp values?
_clampMinMinimal clamping value
_clampMaxMaximal Clamping value
_repeatRepeat Texture?
_minRepeatMinimal value for repeat
_maxRepeatMaximal value for repeat
_centerCenter values?
_scaleScale values?
_minimalInputMinimal input value given
_maximalInputMaximal input value given

Definition at line 54 of file TextureMath.cc.

TextureMath::TextureMath ( const TexParameters _parameters,
const double  _minimalInput,
const double  _maximalInput 
)

Convenience constructor.

Parameters
_parameterstexture parameters
_minimalInput
_maximalInput

Definition at line 80 of file TextureMath.cc.

Member Function Documentation

double TextureMath::transform ( const double  _input) const

Modify given values based on the specified parameters given to the constructor.

Parameters
_inputInput value
Returns
Modified value

Definition at line 95 of file TextureMath.cc.


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