MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
SoShowFPS.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef SO_SHOW_FPS_H
14#define SO_SHOW_FPS_H
15
16
18
19#include "SoUtilsSystem.h"
20#include "mlTimeCounter.h"
21#include <Inventor/fields/SoSFInt32.h>
22#include <Inventor/fields/SoSFBool.h>
23#include <Inventor/fields/SoSFColor.h>
24#include <Inventor/fields/SoSFFloat.h>
25
26//=============================================================
28//=============================================================
29class SOUTILS_EXPORT SoShowFPS : public SoNode
30{
31
32 SO_NODE_HEADER(SoShowFPS);
33
34public:
35 // Constructor
37
39 static void initClass();
40
43
45 bool affectsState() const override
46 {
47 return false;
48 }
49
50
52
55
57
59
61
62protected:
63 ~SoShowFPS() override;
64
65private:
66 ml::TimeCounter _timer;
67 std::vector<float> _recentTimeSpent;
68
69 int _repaintCount;
70};
71
72#endif
#define SOUTILS_EXPORT
System dependent includes. Disables some compiler/linker warnings.
SoShowFPS renders the current frame rate onto the scene.
Definition SoShowFPS.h:30
SoSFBool drawFPS
Definition SoShowFPS.h:54
SoSFInt32 fontSize
Definition SoShowFPS.h:56
static void initClass()
inventor runtime system
void GLRender(SoGLRenderAction *action) override
derived render method that renders the FPS
SoSFFloat alpha
Definition SoShowFPS.h:60
~SoShowFPS() override
SoSFBool drawRepaintCount
Definition SoShowFPS.h:53
SoSFInt32 numAverageFrames
Definition SoShowFPS.h:51
SoSFColor color
Definition SoShowFPS.h:58
bool affectsState() const override
this node does not affect the state, so return false!
Definition SoShowFPS.h:45
Class to measure precise time intervals.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.