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

RandomMotionGenerator Class Reference

An class for generating random motion vectors. More...

#include <RandomMotionGenerator.h>

Collaboration diagram for RandomMotionGenerator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RandomMotionGenerator (double minValue, double maxValue, double valueDx, double directionDx, ChangeType changeType, unsigned long n)
 Constructor.

PfVec getMotionVector ()
 Returns a random motion vector.


Private Member Functions

double computeDirection (double previousDirection) const
 Returns a direction.

double computeVecLength (double previousLength) const
 Returns a length.

double getRandomNumberBetween (double min, double max) const
 Returns a random number between two numbers.


Private Attributes

double minValue
 The minimum length of the random vector.

double maxValue
 The maximum length of the random vector.

double valueDx
 The maximum difference of the length of two successively generated vector.

double directionDx
 The maximum difference of the direction of two successively generated vector.

ChangeType changeType
 The unit of n.

unsigned long n
 The number of steps to wait until a new vector is generated.

PfVec lastVec
 The last generated vector.

double lastDirection
 The last generated direction.

unsigned long calls
 The number of calls since the last vector was generated.

unsigned long pointOfGenerationTime
 The point of time the last vector was generated.


Detailed Description

An class for generating random motion vectors.

Definition at line 22 of file RandomMotionGenerator.h.


Constructor & Destructor Documentation

RandomMotionGenerator::RandomMotionGenerator double  minValue,
double  maxValue,
double  valueDx,
double  directionDx,
ChangeType  changeType,
unsigned long  n
 

Constructor.

Parameters:
minValue See class members
maxValue See class members
valueDx See class members
directionDx See class members
changeType See class members
n See class members

Definition at line 16 of file RandomMotionGenerator.cpp.

References ChangeType, getSystemTime(), and pi.

Here is the call graph for this function:


Member Function Documentation

PfVec RandomMotionGenerator::getMotionVector  ) 
 

Returns a random motion vector.

Returns:
The vector

Definition at line 36 of file RandomMotionGenerator.cpp.

References CALLS, calls, computeDirection(), computeVecLength(), getSystemTime(), lastDirection, lastVec, PfVec::length(), MILLISECONDS, pointOfGenerationTime, and PfVec::rotate().

Referenced by Motionfield::getRandomVector().

Here is the call graph for this function:

double RandomMotionGenerator::computeDirection double  previousDirection  )  const [inline, private]
 

Returns a direction.

Parameters:
previousDirection The previous direction in radian
Returns:
A direction in radian

Definition at line 61 of file RandomMotionGenerator.cpp.

References getRandomNumberBetween(), pi, and pi2.

Referenced by getMotionVector().

Here is the call graph for this function:

double RandomMotionGenerator::computeVecLength double  previousLength  )  const [inline, private]
 

Returns a length.

Parameters:
previousLength The previous length
Returns:
A length

Definition at line 72 of file RandomMotionGenerator.cpp.

References getRandomNumberBetween().

Referenced by getMotionVector().

Here is the call graph for this function:

double RandomMotionGenerator::getRandomNumberBetween double  min,
double  max
const [inline, private]
 

Returns a random number between two numbers.

Parameters:
min The minimum value
max The maximum value
Returns:
A random number between min and max

Definition at line 89 of file RandomMotionGenerator.cpp.

References max, and min.

Referenced by computeDirection(), and computeVecLength().


Member Data Documentation

double RandomMotionGenerator::minValue [private]
 

The minimum length of the random vector.

Definition at line 43 of file RandomMotionGenerator.h.

double RandomMotionGenerator::maxValue [private]
 

The maximum length of the random vector.

Definition at line 45 of file RandomMotionGenerator.h.

double RandomMotionGenerator::valueDx [private]
 

The maximum difference of the length of two successively generated vector.

Definition at line 47 of file RandomMotionGenerator.h.

double RandomMotionGenerator::directionDx [private]
 

The maximum difference of the direction of two successively generated vector.

Definition at line 49 of file RandomMotionGenerator.h.

ChangeType RandomMotionGenerator::changeType [private]
 

The unit of n.

Definition at line 51 of file RandomMotionGenerator.h.

unsigned long RandomMotionGenerator::n [private]
 

The number of steps to wait until a new vector is generated.

Definition at line 53 of file RandomMotionGenerator.h.

PfVec RandomMotionGenerator::lastVec [private]
 

The last generated vector.

Definition at line 55 of file RandomMotionGenerator.h.

Referenced by getMotionVector().

double RandomMotionGenerator::lastDirection [private]
 

The last generated direction.

Definition at line 57 of file RandomMotionGenerator.h.

Referenced by getMotionVector().

unsigned long RandomMotionGenerator::calls [private]
 

The number of calls since the last vector was generated.

Definition at line 59 of file RandomMotionGenerator.h.

Referenced by getMotionVector().

unsigned long RandomMotionGenerator::pointOfGenerationTime [private]
 

The point of time the last vector was generated.

Definition at line 61 of file RandomMotionGenerator.h.

Referenced by getMotionVector().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:10:56 2004 for GT2004 by doxygen 1.3.6