VR-Forces 4.8 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 /******************************************************************************
3 ** Copyright (c) 2017 MAK Technologies, Inc.
4 ** All rights reserved.
5 ******************************************************************************/
6 
10 
11 #pragma once
12 
13 #include <vrvOsg/vrvOsg.h>
14 
16 #include <boost/signals.hpp>
17 
18 #include <string>
19 #include <vector>
20 #include <map>
21 
22 #define MAX_FRAMES 60
23 
24 namespace makVrv
25 {
26  class DtKeyEvent;
30  {
31  public:
32  struct StatData
33  {
34  std::string name;
35  std::vector<DtProfileNode*> nodes;
36  double totals[MAX_FRAMES];
37  double totals_child[MAX_FRAMES];
38  };
39 
40  typedef std::vector<StatData*> StatList;
41  typedef std::map<std::string, StatList*> GroupMap;
42 
45 
46  virtual void reset();
47 
49  void addLabel(const std::string& group, const std::string& name);
50 
51  void removeLabel(const std::string& group, const std::string& name);
52 
54  virtual ~DtOsgPerformanceStats();
55 
57  virtual void updateCallback();
58 
60  virtual void handleKeyEvent(int key, int modifier);
61 
63  boost::signal<void(const std::string&)> signal_statsChanged;
64 
65  // accessor used by Imgui profiler
66  const GroupMap& groupData() { return myGroupData; }
67 
68  protected:
69  void updateGroupNodeList();
70  void updateFrameTimes();
72  void appendToString(const std::string& str);
73  bool findNodes(DtProfileNode* parent, const std::string& name, std::vector<DtProfileNode*>& found);
74 
76 
77 
79 
83 
84  std::string myStatsInString;
89  };
90 }
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:29
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
GroupMap myGroupData
Definition: DtOsgPerformanceStats.h:78
int myFramesRendered
Definition: DtOsgPerformanceStats.h:88
Definition: DtOsgPerformanceStats.h:32
int myFramesLowerThan60FPS
Definition: DtOsgPerformanceStats.h:87
int myCurrentFrameIndex
Definition: DtOsgPerformanceStats.h:80
std::vector< DtProfileNode * > nodes
Definition: DtOsgPerformanceStats.h:35
boost::signal< void(const std::string &)> signal_statsChanged
Signals when the stats string changed.
Definition: DtOsgPerformanceStats.h:63
int myPreviousEvictionMemory
Definition: DtOsgPerformanceStats.h:82
int myFramesLowerThan30FPS
Definition: DtOsgPerformanceStats.h:86
std::map< std::string, StatList * > GroupMap
Definition: DtOsgPerformanceStats.h:41
std::string name
Definition: DtOsgPerformanceStats.h:34
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:40
int myPrevousEvictionCount
Definition: DtOsgPerformanceStats.h:81
DtDe & myDe
Definition: DtOsgPerformanceStats.h:75
const GroupMap & groupData()
Definition: DtOsgPerformanceStats.h:66
std::string myStatsInString
Definition: DtOsgPerformanceStats.h:84
int myNumOfLines
Definition: DtOsgPerformanceStats.h:85

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)