MeVisLabToolboxReference
|
00001 #ifndef __SoShowFPS_H 00002 #define __SoShowFPS_H 00003 //---------------------------------------------------------------------------------- 00004 // **InsertLicense** code 00005 //---------------------------------------------------------------------------------- 00007 00012 //---------------------------------------------------------------------------------- 00013 00014 #include "SoUtilsSystem.h" 00015 #include "mlTimeCounter.h" 00016 #include <Inventor/fields/SoSFInt32.h> 00017 #include <Inventor/fields/SoSFBool.h> 00018 #include <Inventor/fields/SoSFColor.h> 00019 #include <Inventor/fields/SoSFFloat.h> 00020 00021 //============================================================= 00023 //============================================================= 00024 class SOUTILS_EXPORT SoShowFPS : public SoNode { 00025 00026 SO_NODE_HEADER(SoShowFPS); 00027 00028 public: 00029 // Constructor 00030 SoShowFPS(); 00031 00033 static void initClass(); 00034 00036 virtual void GLRender(SoGLRenderAction *action); 00037 00038 00039 SoSFInt32 numAverageFrames; 00040 00041 SoSFBool drawRepaintCount; 00042 SoSFBool drawFPS; 00043 00044 SoSFInt32 fontSize; 00045 00046 SoSFColor color; 00047 00048 SoSFFloat alpha; 00049 00050 protected: 00051 virtual ~SoShowFPS(); 00052 00053 private: 00054 ml::TimeCounter _timer; 00055 std::vector<float> _recentTimeSpent; 00056 00057 int _repaintCount; 00058 }; 00059 00060 #endif