Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://astro.uni-altai.ru/~aw/stellarium/api/classStelRendererStatistics.html
Дата изменения: Unknown Дата индексирования: Fri Feb 28 07:50:42 2014 Кодировка: Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п |
Stellarium 0.12.3
|
Stores and provides access to statistics about a StelRenderer backend. More...
#include <StelRendererStatistics.hpp>
Public Member Functions | |
StelRendererStatistics () | |
Construct an empty StelRendererStatistics object. More... | |
bool | getNext (const char *&name, double &value) |
Get next statistic name and value. More... | |
void | resetIteration () |
Reset iteration to the beginning. More... | |
double & | operator[] (int index) |
Access statistic with specified index to modify it. More... | |
int | addStatistic (const char *name, const StatisticSwapMode swapMode=StatisticSwapMode_DoNothing) |
Add a statistic with specified name. More... | |
void | swap () |
Called at the end of frame - changes current statistics to previous statistics. More... | |
Stores and provides access to statistics about a StelRenderer backend.
This acts as a map of stings (const char*) and doubles.
Two sets of statistics are stored: current (this frame, currently recorded) and previous (previous frame, currently readable.)
To read statistics (from previous frame), they can be iterated like this:
To record statistics, the [] operator is used, modifying the current frame's statistics. The index is an integer previously returned by the addStatistic() member function:
The resetIteration() member fuction can be used to reset iteration to start.
Definition at line 58 of file StelRendererStatistics.hpp.
|
inline |
Construct an empty StelRendererStatistics object.
Definition at line 63 of file StelRendererStatistics.hpp.
|
inline |
Add a statistic with specified name.
Also returns the index of the statistic. Index will be 0 for the first statistic added, 1 for the second and so on.
name | Name of the statistic. This MUST exist as long as the statistics exist. The best way to ensure this is to use a string literal. |
swapMode | Specifies what to do when when the swap() function is called (at the end of a frame). Used for statistics that are recorded separately each frame and need to be zeroed out. |
Definition at line 126 of file StelRendererStatistics.hpp.
|
inline |
Get next statistic name and value.
name | Name of the statistic will be stored here (only a pointer to it). |
value | Value of the statistic will be stored here. |
Definition at line 80 of file StelRendererStatistics.hpp.
|
inline |
Access statistic with specified index to modify it.
Statistics are accessed by integer indices. A clean way to do this is to use an enum with name corresponding to the name of the statistic.
Definition at line 107 of file StelRendererStatistics.hpp.
|
inline |
Reset iteration to the beginning.
Definition at line 97 of file StelRendererStatistics.hpp.
|
inline |
Called at the end of frame - changes current statistics to previous statistics.
Also handles StatisticSwapMode logic, e.g. zeroing out statistics that have StatisticSwapMode_SetToZero.
Definition at line 140 of file StelRendererStatistics.hpp.