Helios++
Helios software for LiDAR simulations
|
Class to handle a noise source. More...
#include <NoiseSource.h>
Public Member Functions | |
void | build () |
Common behavior for all NoiseSource constructors. | |
double | getClipMin () |
Obtain the clip min value. More... | |
NoiseSource & | setClipMin (RealType clipMin) |
Set the clip min value. More... | |
double | getClipMax () |
Obtain the clip max value. More... | |
NoiseSource & | setClipMax (RealType clipMax) |
Set the clip max value. More... | |
bool | isClipEnabled () |
Check if clipping is enabled or not. More... | |
NoiseSource & | setClipEnabled (bool clipEnabled) |
Enable clipping by setting it to true or disable it by setting to false. More... | |
bool | isFixedValueEnabled () |
Check if fixed value usage is enabled or not. More... | |
unsigned long | getFixedLifespan () |
Obtain the fixed value lifespan. More... | |
NoiseSource & | setFixedLifespan (unsigned long fixedLifespan) |
Set the fixed value lifespan. More... | |
unsigned long | getFixedValueRemainingUses () |
Obtain the remaining uses of current fixed value. More... | |
NoiseSource & | setFixedValueRemainingUses (unsigned long remainingUses) |
Update remaining uses count for current fixed value. More... | |
NoiseSource & | fixedRenew () |
Forces a renewal of fixed value and its remaining uses. More... | |
RealType | next () |
Obtain the next default noise value. More... | |
virtual RealType | noiseFunction ()=0 |
Function which computes noise values. More... | |
Protected Member Functions | |
RealType | clip (RealType v) |
If clipping is enabled, it will clip received value. If clipping is not enabled, received value will not be clipped. More... | |
Protected Attributes | |
RealType | clipMin = 0.0 |
All noise values which are less than clipMin will be clipped to clipMin if clipping is enabled. More... | |
RealType | clipMax = 1.0 |
All noise values which are greater than clipMax will be clipped to clipMaxx if clipping is enabled. | |
bool | clipEnabled = false |
True when clipping is enabled, False otherwise. | |
unsigned long | fixedLifespan = 1L |
Specify the how many times a fixed value can be used before being renewed. More... | |
unsigned long | fixedRemainingUses = 0L |
How many remaining uses the fixed value has. More... | |
RealType | fixedValue = 0 |
The fixed value. More... | |
Friends | |
template<typename _RealType > | |
std::ostream & | operator<< (std::ostream &out, NoiseSource< _RealType > const &ns) |
Output stream behavior. | |
Class to handle a noise source.
RealType | Type of the generated noise. For instance double or float. |
|
inlineprotected |
If clipping is enabled, it will clip received value. If clipping is not enabled, received value will not be clipped.
NoiseSource< RealType > & NoiseSource< RealType >::fixedRenew | ( | ) |
Forces a renewal of fixed value and its remaining uses.
|
inline |
|
inline |
|
inline |
|
inline |
Obtain the remaining uses of current fixed value.
NOTICE lifespan might be eternal (0L), in which case remaining uses count does not affect the behavior of the noise source
|
inline |
Check if clipping is enabled or not.
|
inline |
Check if fixed value usage is enabled or not.
RealType NoiseSource< RealType >::next | ( | ) |
Obtain the next default noise value.
NOTICE this function considers fixed values.
|
pure virtual |
Function which computes noise values.
Implemented in UniformNoiseSource< RealType >, UniformNoiseSource< double >, and NormalNoiseSource< RealType >.
|
inline |
Enable clipping by setting it to true or disable it by setting to false.
clipEnabled | True to enable clipping, False to disable it |
|
inline |
Set the clip max value.
clipMax | New clip max value |
|
inline |
Set the clip min value.
clipMin | New clip min value |
|
inline |
Set the fixed value lifespan.
NOTICE this does not update fixed value remaining uses
fixedLifespan | The new lifespan for fixed values |
|
inline |
Update remaining uses count for current fixed value.
remainingUses | New remaining uses count |
|
protected |
All noise values which are less than clipMin will be clipped to clipMin if clipping is enabled.
|
protected |
Specify the how many times a fixed value can be used before being renewed.
NOTICE a value of 0 means the fixed value will not be renewed, unless manually specified through fixedRenew function invocation.
A value of 1 means the fixed value will be renewed between each pair of consecutive uses, hence it behaves like if it was not a fixed value
Having fixed enabled (fixedLifespan != 1) means a noise value will be computed one time and always that a next noise value is requested the previously computed fixed value will be returned, as long as its lifespan has not expired yet
WARNING fixed value only is considered when obtaining noise through next function. Specific noise functions do not support fixed values.
|
protected |
How many remaining uses the fixed value has.
|
protected |
The fixed value.