HUDStatisticsManager Class Reference
manages all the stuff displaying statistics on the graphics window.
More...
#include <hudstatistics.h>
Inherits Callbackable.
List of all members.
Classes |
class | WindowStatistic |
| Nested class WindowStatistic, which puts the measure and the graphics text together. More...
|
Public Member Functions |
| HUDStatisticsManager (osg::Geode *geode, osgText::Font *font) |
| creates the HUDStatisticsManager, normally done by class Base.
|
virtual | ~HUDStatisticsManager () |
virtual StatisticMeasure * | getMeasure (double &observedValue, const char *measureName, MeasureMode mode, long stepSpan, double additionalParam=0) |
| adds a variable to observe (on the window) and measure the value
|
virtual double & | addMeasure (double &observedValue, const char *measureName, MeasureMode mode, long stepSpan, double additionalParam=0) |
| adds a variable to observe (on the window) and measure the value
|
virtual double & | addMeasure (AbstractMeasure *measure) |
| You can add another abstract measure you like.
|
virtual double & | addMeasureList (std::list< AbstractMeasure * > measureList) |
| You can add another abstract measure you like.
|
virtual double & | addMeasureList (std::list< ComplexMeasure * > measureList) |
| You can add another abstract measure you like.
|
virtual double & | addMeasureList (std::list< StatisticMeasure * > measureList) |
| You can add another abstract measure you like.
|
virtual void | beginMeasureAt (long step) |
| starts the measure at a specific time.
|
virtual bool | measureStarted () |
| Tells you wether the measures have already been started.
|
virtual void | doOnCallBack (BackCaller *source, BackCaller::CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE) |
| CALLBACKABLE INTERFACE.
|
virtual StatisticTools * | getStatisticTools () |
virtual WindowStatistic * | getMeasureWS (const std::string &measureName) |
| searches for the measure with the given name and returns it windowstatistics (measure and graphics together)
|
virtual void | setColor (const Color &color) |
virtual void | setFontsize (int size) |
Protected Attributes |
std::list< WindowStatistic * > | windowStatisticList |
| the struct list which holds the measures and the appropiate text
|
StatisticTools * | statTool |
float | xInitPosition |
float | yInitPosition |
float | zInitPosition |
float | yOffset |
osg::Geode * | geode |
osgText::Font * | font |
Color | textColor |
int | fontsize |
Detailed Description
manages all the stuff displaying statistics on the graphics window.
This is a experimental version, so do not to be afraid changing this crazy code.
This class uses the implementation of the class StatisticTools, which is generalized to make nice statistics. Instead of passing the values to the guilogger (INSPECTABLE interface), we simply diplay this values on the graphics window.
So how it works:
- overwriting the method getMeasure gives us the ability to create the needed text object, then storing it in a class named WindowStatistic (which is stored in the windowStatisticList).
Constructor & Destructor Documentation
creates the HUDStatisticsManager, normally done by class Base.
- Parameters:
-
| geode | this is the graphical node at wich the text objects are hooked in. |
Member Function Documentation
You can add another abstract measure you like.
in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized
- Parameters:
-
| measure | the measure to add |
double & addMeasure |
( |
double & |
observedValue, |
|
|
const char * |
measureName, |
|
|
MeasureMode |
mode, |
|
|
long |
stepSpan, |
|
|
double |
additionalParam = 0 | |
|
) |
| | [virtual] |
adds a variable to observe (on the window) and measure the value
- Parameters:
-
| observedValue | the value to observe. |
| measureName | the name of the measured value |
| mode | the mode of measure |
| stepSpan | in most cases the stepSpan is important to get the measured value of a number of steps, like AVG: if stepSpan = 0, AVG is calculated over all steps if stepSpan = n, AVG is calculated over the LAST n steps The same counts for all the other MeasureModes. |
| additionalParam | is used for example for mode PEAK, the param is the limit value, all values minus limit are displayed, values below the limit are set to 0. In CONV mode (test the convergence), this value is the epsilon criteria. |
- Returns:
- the object StatisticMeasure. Use addMeasure(...) instead of getMeasure(...) to obtain the value adress of the calculated statistic.
- See also:
- StatisticTools
-
StatisticMeasure
double & addMeasureList |
( |
std::list< StatisticMeasure * > |
measureList |
) |
[virtual] |
You can add another abstract measure you like.
in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized With this method you can add a list of AbstractMeasures.
- Parameters:
-
| measureList | the list of measures to add |
double & addMeasureList |
( |
std::list< ComplexMeasure * > |
measureList |
) |
[virtual] |
You can add another abstract measure you like.
in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized With this method you can add a list of AbstractMeasures.
- Parameters:
-
| measureList | the list of measures to add |
double & addMeasureList |
( |
std::list< AbstractMeasure * > |
measureList |
) |
[virtual] |
You can add another abstract measure you like.
in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized With this method you can add a list of AbstractMeasures.
- Parameters:
-
| measureList | the list of measures to add |
virtual void beginMeasureAt |
( |
long |
step |
) |
[inline, virtual] |
starts the measure at a specific time.
This is useful if there are values that have to be ignored at simulation start.
- Parameters:
-
| step | number of steps (normally simsteps) to wait for beginning the measures |
CALLBACKABLE INTERFACE.
this method is invoked when a callback is done from the class where this class is for callback registered, it is overwritten
Implements Callbackable.
StatisticMeasure * getMeasure |
( |
double & |
observedValue, |
|
|
const char * |
measureName, |
|
|
MeasureMode |
mode, |
|
|
long |
stepSpan, |
|
|
double |
additionalParam = 0 | |
|
) |
| | [virtual] |
adds a variable to observe (on the window) and measure the value
- Parameters:
-
| observedValue | the value to observe. |
| measureName | the name of the measured value |
| mode | the mode of measure |
| stepSpan | in most cases the stepSpan is important to get the measured value of a number of steps, like AVG: if stepSpan = 0, AVG is calculated over all steps if stepSpan = n, AVG is calculated over the LAST n steps The same counts for all the other MeasureModes. |
| additionalParam | is used for example for mode PEAK, the param is the limit value, all values minus limit are displayed, values below the limit are set to 0. In CONV mode (test the convergence), this value is the epsilon criteria. |
- Returns:
- the object StatisticMeasure. Use addMeasure(...) instead of getMeasure(...) to obtain the value adress of the calculated statistic.
- See also:
- StatisticTools
-
StatisticMeasure
searches for the measure with the given name and returns it windowstatistics (measure and graphics together)
- Returns:
- 0 if not measure was found
virtual bool measureStarted |
( |
|
) |
[inline, virtual] |
Tells you wether the measures have already been started.
virtual void setColor |
( |
const Color & |
color |
) |
[inline, virtual] |
virtual void setFontsize |
( |
int |
size |
) |
[inline, virtual] |
Member Data Documentation
osgText::Font* font [protected] |
osg::Geode* geode [protected] |
the struct list which holds the measures and the appropiate text
The documentation for this class was generated from the following files: