VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgPerformanceStats.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 #include <vrvUtil/signalslib.h>
16 
17 #include <string>
18 #include <vector>
19 #include <map>
20 
21 #define MAX_FRAMES 60
22 
23 namespace makVrv
24 {
25  class DtKeyEvent;
29  {
30  public:
31  struct StatData
32  {
33  std::string name;
34  std::vector<DtProfileNode*> nodes;
35  double totals[MAX_FRAMES];
36  double totals_child[MAX_FRAMES];
37  };
38 
39  typedef std::vector<StatData*> StatList;
40  typedef std::map<std::string, StatList*> GroupMap;
41 
44 
45  virtual void reset();
46 
48  void addLabel(const std::string& group, const std::string& name);
49 
50  void removeLabel(const std::string& group, const std::string& name);
51 
53  virtual ~DtOsgPerformanceStats();
54 
56  virtual void updateCallback();
57 
59  virtual void handleKeyEvent(int key, int modifier);
60 
62  boost::signalslib::signal<void(const std::string&)> signal_statsChanged;
63 
64  // accessor used by Imgui profiler
65  const GroupMap& groupData() { return myGroupData; }
66 
67  protected:
68  void updateGroupNodeList();
69  void updateFrameTimes();
71  void appendToString(const std::string& str);
72  bool findNodes(DtProfileNode* parent, const std::string& name, std::vector<DtProfileNode*>& found);
73 
75 
76 
78 
82 
83  std::string myStatsInString;
87  };
88 }
Profile node class stores timing data for a profiled section.
Definition: DtProfileNode.h:22
A stats which shows the IG&#39;s performance stats.
Definition: DtOsgPerformanceStats.h:28
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
GroupMap myGroupData
Definition: DtOsgPerformanceStats.h:77
int myFramesRendered
Definition: DtOsgPerformanceStats.h:86
Definition: DtOsgPerformanceStats.h:31
int myFramesLowerThan60FPS
Definition: DtOsgPerformanceStats.h:85
int myCurrentFrameIndex
Definition: DtOsgPerformanceStats.h:79
#define MAX_FRAMES
Definition: DtOsgPerformanceStats.h:21
boost::signalslib::signal< void(const std::string &)> signal_statsChanged
Signals when the stats string changed.
Definition: DtOsgPerformanceStats.h:62
std::vector< DtProfileNode * > nodes
Definition: DtOsgPerformanceStats.h:34
int myPreviousEvictionMemory
Definition: DtOsgPerformanceStats.h:81
int myFramesLowerThan30FPS
Definition: DtOsgPerformanceStats.h:84
std::map< std::string, StatList * > GroupMap
Definition: DtOsgPerformanceStats.h:40
std::string name
Definition: DtOsgPerformanceStats.h:33
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
std::vector< StatData * > StatList
Definition: DtOsgPerformanceStats.h:39
int myPrevousEvictionCount
Definition: DtOsgPerformanceStats.h:80
DtDe & myDe
Definition: DtOsgPerformanceStats.h:74
const GroupMap & groupData()
Definition: DtOsgPerformanceStats.h:65
std::string myStatsInString
Definition: DtOsgPerformanceStats.h:83

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)