#include <hudstatistics.h>
Inherits Callbackable.
Inheritance diagram for HUDStatisticsManager:
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 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 |
Classes | |
class | WindowStatistic |
Nested class WindowStatistic, which puts the measure and the graphics text together. More... |
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:
HUDStatisticsManager | ( | osg::Geode * | geode, | |
osgText::Font * | font | |||
) |
creates the HUDStatisticsManager, normally done by class Base.
geode | this is the graphical node at wich the text objects are hooked in. |
virtual ~HUDStatisticsManager | ( | ) | [inline, virtual] |
double & addMeasure | ( | AbstractMeasure * | measure | ) | [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
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
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. |
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.
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.
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.
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.
step | number of steps (normally simsteps) to wait for beginning the measures |
void doOnCallBack | ( | BackCaller * | source, | |
BackCaller::CallbackableType | type = BackCaller::DEFAULT_CALLBACKABLE_TYPE | |||
) | [virtual] |
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
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. |
virtual StatisticTools* getStatisticTools | ( | ) | [inline, virtual] |
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] |
osgText::Font* font [protected] |
int fontsize [protected] |
osg::Geode* geode [protected] |
StatisticTools* statTool [protected] |
std::list<WindowStatistic*> windowStatisticList [protected] |
the struct list which holds the measures and the appropiate text
float xInitPosition [protected] |
float yInitPosition [protected] |
float yOffset [protected] |
float zInitPosition [protected] |