VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgStatsHandler.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
16 
17 #include <osgViewer/ViewerEventHandlers>
18 #include <osg/Matrix>
19 
20 namespace osg
21 {
22  class Switch;
23  class Geode;
24 }
25 
26 namespace osgViewer
27 {
28  class View;
29 }
30 
31 namespace osgText
32 {
33  class Text;
34 }
35 
36 
37 namespace makVrv
38 {
39  class DtDe;
40  class DtBaseConnection;
41  class DtProfileNode;
42  class DtPerformanceStats;
43  class DtOsgProfilerStats;
44 
51  class DT_DLL_VRVOSG DtOsgStatsHandler : public osgViewer::StatsHandler
52  {
53  public: // public typedefs and enumerations
55  {
56  NO_PROFILER_STATS = 0,
58  FUNCTION_STATS = 2,
59  BOTH_STATS = 3,
60  LAST_PROFILER_STATS = 4
61  };
62 
63 
64  public: // public constructors and destructors
67  protected:
69  virtual ~DtOsgStatsHandler();
70  private:
72  DtOsgStatsHandler(const DtOsgStatsHandler& other) = delete;
74  DtOsgStatsHandler& operator=(const DtOsgStatsHandler& other) = delete;
75 
76  public:
77  //set the key toggle the Profiler Stats, default is F3
78  virtual void setKeyEventTogglesProfilerStats(int key);
79 
80  //get the key toggle the Profiler Stats, default is F3
81  virtual int getKeyEventTogglesProfilerStats(void);
82 
84  virtual DtPerformanceStats* performanceStats();
85 
87  virtual int osgStatsType() const;
88 
90  virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) override;
91  protected:
92 
93  //turn off the osg stats
94  virtual void turnOffOsgStats(osgViewer::View* view);
95 
96  //turn off the performance and profiler stats and stop profiling
97  virtual void turnOffBothProfilerStats(bool sendSettingsToGui);
98 
99  //This will create a instance of DtOsgPerformanceStats and connect the necessary signals
100  //only if the instance is 0,It will also start profiling
101  virtual void createPerformanceStats();
102 
103  //This will delete the instance of DtOsgPerformanceStats and disconnect the necessary signals
104  //It will also stop profilinng
105  virtual void deletePerformanceStats();
106 
107  //Send the performance stats to update the GUI
108  virtual void sendPerformanceStatsToGUI(unsigned int state);
109 
110  //turn off the performance stats
111  virtual void turnOffPerformanceStats(bool sendSettingsToGui);
112 
113  //Send the profiler stats to update the GUI
114  virtual void sendProfilerStatsToGUI(bool enabled);
115 
116  //toggle between the Performance stats and Function stats
117  virtual void updateProfilerStats(bool sendSettingsToGui);
118 
120  virtual void setPerformanceStatsOverlayEnabled(bool show, bool sendSettingsToGui = true);
121 
123  virtual bool performanceStatsOverlayEnabled() const;
124 
126  virtual void setProfilerOverlayEnabled(bool show, bool sendSettingsToGui = true);
127 
129  virtual bool profilerOverlayEnabled() const;
130 
132  virtual void slot_onPerformanceStatsOverlayOnChanged(bool mode);
133 
135  virtual void slot_onProfilerOverlayOnChanged(bool mode);
136 
137  protected:
139  osg::GraphicsContext* findValidContext(osg::GraphicsContext* context, osgViewer::View* view);
140 
141  protected:
143 
146 
148 
152  };
153 }
bool myNeedEnableOsgPerformanceInStartup
Definition: DtOsgStatsHandler.h:149
int myKeyEventTogglesProfilerStats
Definition: DtOsgStatsHandler.h:144
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
ProfilerStatsType
Definition: DtOsgStatsHandler.h:54
Contains makVrv::DtVirtualBaseClass class.
Definition: vrvControlToolkitDataTypes_v0.h:54
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
int myProfilerStatsType
Definition: DtOsgStatsHandler.h:145
DtDe & myDe
Definition: DtOsgStatsHandler.h:142
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
PPP: 10/2021:
Definition: DtOsgStatsHandler.h:51
Base class to provide boost signal/slot management.
const char int mode
Definition: ioapi.h:38
DtPerformanceStats * myPerformanceStats
Definition: DtOsgStatsHandler.h:147
Contains DLL export macros.
DtSignalConnectionManager myConnections
Definition: DtOsgStatsHandler.h:151
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
A stats which shows the IG&#39;s performance stats.
Definition: DtPerformanceStats.h:28
bool myStatsActive
Definition: DtOsgStatsHandler.h:150

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)