All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DebugStats.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IDebugStats.h"
6 #include "DebugDecl.h"
7 #include "Streaming.h"
8 #include "Camera.h"
9 #include "Location.h"
10 #include "LatLongAltitude.h"
11 #include "RenderCamera.h"
12 #include "CameraState.h"
13 
14 #include <vector>
15 #include <string>
16 
17 namespace Eegeo
18 {
19  namespace Debug
20  {
21 
22  class DebugStats : public IDebugStats
23  {
24  public:
25  DebugStats(
26  const IMemoryStats* pMemoryStats,
27  const Camera::CameraState& cameraState,
28  IFrameTimer* pFrameTimer,
29  Streaming::ResourceNodeCache* pResourceNodeCache);
30 
31  virtual float FramesPerSecond() const;
32  virtual float MaxFrameTimeMS() const;
33  virtual float LastFrameTimeMS() const;
34  virtual float AverageFramesPerSecond() const;
35 
36  virtual double CameraPositionLatitude() const;
37  virtual double CameraPositionLongitude() const;
38  virtual double CameraPositionAltitude() const;
39  virtual float CameraRotationFromNorth() const;
40  virtual double CameraDistanceToInterest() const;
41  virtual float CameraFoVDegrees() const;
42 
43  virtual double CameraInterestPointLatitude() const;
44  virtual double CameraInterestPointLongitude() const;
45  virtual double CameraInterestPointAltitude() const;
46 
47  virtual size_t MemoryUsed() const;
48  virtual size_t VirtualMemoryUsed() const;
49  virtual size_t FreeMemory() const;
50  virtual size_t GetPrivateDirtyByteCount() const;
51  virtual size_t GetHeapByteCount() const;
52 
53  virtual int ResourceNodeCacheAllocs() const;
54  virtual int ResourceNodeCacheMisses() const;
55  virtual int ResourceNodeCacheAdds() const;
56  virtual int ResourceNodeCacheDeletions() const;
57  virtual int ResourceNodeCacheSize() const;
58 
59  virtual int BitsPerSecond() const;
60  virtual int MaxBitsPerSecond() const;
62 
63  virtual int NumberOfStreams() const;
64  virtual const char* NameOfStream(int streamIndex) const;
65  virtual StreamStat StreamStatsForStream(int streamIndex) const;
66 
67  virtual int PolyCount() const;
68  virtual int DrawCalls() const;
69 
70  virtual void RegisterStream(Eegeo::Streaming::LoggingResourceStream* resourceStream,
71  Eegeo::Resources::IResourceBuilder* resourceBuilder,
72  const char*& resourceName);
73  virtual void Reset();
74 
75  virtual void SetCameraState(const Camera::CameraState& cameraState);
76 
77  private:
78  Space::LatLongAltitude CameraInterestPointLatLongAltitude() const;
79 
80  float GetCameraAbsoluteBearingRadians() const;
81  Camera::CameraState m_cameraState;
82 
83  const IMemoryStats* m_pMemoryStats;
84  IFrameTimer* m_pFrameTimer;
85 
86  Streaming::ResourceNodeCache* m_pResourceNodeCache;
87 
88  std::vector<Eegeo::Streaming::LoggingResourceStream*> m_resourceStreams;
89  std::vector<Eegeo::Resources::IResourceBuilder*> m_resourceBuilders;
90  std::vector<std::string> m_resourceStreamNames;
91  mutable int m_maxBitsPerSecond;
92  };
93  }
94 }