Menge
Modular Pedestrian Simulation Framework for Research and Development
|
Generates a 2D float value uniformly distributed in an oriented box (OB). More...
#include <RandGenerator.h>
Public Member Functions | |
OBBUniformPosGenerator (const Vector2 &minPt, const Vector2 &size, float theta, int seed=0) | |
Constructor. More... | |
OBBUniformPosGenerator (const OBBUniformPosGenerator &obbGen) | |
Copy constructor. More... | |
virtual Vector2 | getValue () const |
Return a value based on the 2D float generation rules. More... | |
virtual Vector2 | getValueConcurrent () const |
Return a value based on the 2D float generation rules - performed in a thread-safe manner. More... | |
virtual void | print (Logger &out) const |
Function for converting the generator to a string on a output stream. More... | |
virtual Vec2DGenerator * | copy () const |
Create a copy of itself. More... | |
Public Member Functions inherited from Menge::Math::Vec2DGenerator | |
Vec2DGenerator () | |
Constructor. | |
virtual | ~Vec2DGenerator () |
Virtual destructor. | |
Protected Attributes | |
UniformFloatGenerator | _xRand |
The random selector for the position of the return value along the width of the OB. | |
UniformFloatGenerator | _yRand |
The random selector for the position of the return value along the height of the OB. | |
Vector2 | _minPt |
The anchor point of the OB. | |
float | _cosTheta |
The cosine of the OB's rotation. | |
float | _sinTheta |
The sine of the OB's rotation. | |
SimpleLock | _lock |
The lock for guaranteeing threadsafe random number generation. | |
Friends | |
Logger & | operator<< (Logger &out, const OBBUniformPosGenerator &gen) |
Friend function for writing string representation to an output stream. More... | |
Generates a 2D float value uniformly distributed in an oriented box (OB).
Menge::Math::OBBUniformPosGenerator::OBBUniformPosGenerator | ( | const Vector2 & | minPt, |
const Vector2 & | size, | ||
float | theta, | ||
int | seed = 0 |
||
) |
Constructor.
minPt | The anchor point of the OB. |
size | The size of the OB. |
theta | The rotation around the achor point (in degrees) of the OB. |
seed | If the seed is zero, the global seed will be used otherwise the particular seed will be used. |
Menge::Math::OBBUniformPosGenerator::OBBUniformPosGenerator | ( | const OBBUniformPosGenerator & | obbGen | ) |
Copy constructor.
obbGen | The generator to copy its values from. |
|
virtual |
Create a copy of itself.
Implements Menge::Math::Vec2DGenerator.
|
virtual |
Return a value based on the 2D float generation rules.
Implements Menge::Math::Vec2DGenerator.
|
virtual |
Return a value based on the 2D float generation rules - performed in a thread-safe manner.
This is the basic functionality that must be overwridden by derived classes.
Implements Menge::Math::Vec2DGenerator.
|
virtual |
Function for converting the generator to a string on a output stream.
out | The output stream to write the string representation to. |
Implements Menge::Math::Vec2DGenerator.
|
friend |
Friend function for writing string representation to an output stream.
out | The output stream. |
gen | An instance of the generator to represent as a string. |