16 template <
typename RealType>
103 {this->clipMin =
clipMin;
return *
this;}
118 {this->clipMax =
clipMax;
return *
this;}
142 inline RealType
clip(RealType v);
152 {
return this->fixedLifespan != 1L;}
187 {fixedRemainingUses = remainingUses;
return *
this;}
220 template<
typename _RealType>
235 template <
typename RealType>
247 template <
typename RealType>
257 template <
typename RealType>
282 template<
typename RealType>
283 std::ostream& operator <<(std::ostream &out, NoiseSource<RealType>
const &ns){
284 std::stringstream ss;
285 ss <<
"Noise source ("<<&ns<<
"):\n" 286 <<
"\tclipMin = " << ns.clipMin <<
"\n" 287 <<
"\tclipMax = " << ns.clipMax <<
"\n" 288 <<
"\tclipEnabled = " << ns.clipEnabled <<
"\n" 289 <<
"\tfixedLifespan = " << ns.fixedLifespan <<
"\n" 290 <<
"\tfixedRemainingUses = " << ns.fixedRemainingUses <<
"\n" 291 <<
"\tfixedValue = " << ns.fixedValue <<
"\n";
double getClipMin()
Obtain the clip min value.
Definition: NoiseSource.h:94
unsigned long getFixedValueRemainingUses()
Obtain the remaining uses of current fixed value.
Definition: NoiseSource.h:179
NoiseSource & setClipMin(RealType clipMin)
Set the clip min value.
Definition: NoiseSource.h:102
NoiseSource & setClipMax(RealType clipMax)
Set the clip max value.
Definition: NoiseSource.h:117
RealType clipMax
All noise values which are greater than clipMax will be clipped to clipMaxx if clipping is enabled...
Definition: NoiseSource.h:33
NoiseSource & fixedRenew()
Forces a renewal of fixed value and its remaining uses.
Definition: NoiseSource.h:248
NoiseSource & setClipEnabled(bool clipEnabled)
Enable clipping by setting it to true or disable it by setting to false.
Definition: NoiseSource.h:132
bool clipEnabled
True when clipping is enabled, False otherwise.
Definition: NoiseSource.h:37
unsigned long getFixedLifespan()
Obtain the fixed value lifespan.
Definition: NoiseSource.h:158
NoiseSource & setFixedValueRemainingUses(unsigned long remainingUses)
Update remaining uses count for current fixed value.
Definition: NoiseSource.h:186
unsigned long fixedRemainingUses
How many remaining uses the fixed value has.
Definition: NoiseSource.h:71
RealType fixedValue
The fixed value.
Definition: NoiseSource.h:77
Class to handle a noise source.
Definition: NoiseSource.h:17
bool isFixedValueEnabled()
Check if fixed value usage is enabled or not.
Definition: NoiseSource.h:151
unsigned long fixedLifespan
Specify the how many times a fixed value can be used before being renewed.
Definition: NoiseSource.h:65
double getClipMax()
Obtain the clip max value.
Definition: NoiseSource.h:109
NoiseSource & setFixedLifespan(unsigned long fixedLifespan)
Set the fixed value lifespan.
Definition: NoiseSource.h:168
RealType clip(RealType v)
If clipping is enabled, it will clip received value. If clipping is not enabled, received value will ...
Definition: NoiseSource.h:236
RealType clipMin
All noise values which are less than clipMin will be clipped to clipMin if clipping is enabled...
Definition: NoiseSource.h:28
bool isClipEnabled()
Check if clipping is enabled or not.
Definition: NoiseSource.h:124
void build()
Common behavior for all NoiseSource constructors.
Definition: NoiseSource.h:85
virtual RealType noiseFunction()=0
Function which computes noise values.
RealType next()
Obtain the next default noise value.
Definition: NoiseSource.h:258
friend std::ostream & operator<<(std::ostream &out, NoiseSource< _RealType > const &ns)
Output stream behavior.