Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
RenderObservationInfo.h
Go to the documentation of this file.
1#pragma once
2
3#include <Common/assertion.h>
4
5#include <cstddef>
6#include <string>
7#include <vector>
8
9namespace ph
10{
11
15{
16public:
17 void setProgressTimeMeasurement(const std::string& measurement);
18 void setLayer(std::size_t index, const std::string& name);
19 void setIntegerStat(std::size_t index, const std::string& name);
20 void setRealStat(std::size_t index, const std::string& name);
21
22 std::string getProgressTimeMeasurement() const;
23 std::string getLayerName(std::size_t index) const;
24 std::string getIntegerStatName(std::size_t index) const;
25 std::string getRealStatName(std::size_t index) const;
26 std::size_t numLayers() const;
27 std::size_t numIntegerStats() const;
28 std::size_t numRealStats() const;
29
30private:
31 std::string m_progressTimeMeasurement;
32 std::vector<std::string> m_layerNames;
33 std::vector<std::string> m_integerStatNames;
34 std::vector<std::string> m_realStatNames;
35};
36
37// In-header Implementations:
38
39inline void RenderObservationInfo::setProgressTimeMeasurement(const std::string& measurement)
40{
41 m_progressTimeMeasurement = measurement;
42}
43
44inline void RenderObservationInfo::setLayer(const std::size_t index, const std::string& name)
45{
46 if(index >= m_layerNames.size())
47 {
48 m_layerNames.resize(index + 1);
49 }
50
51 PH_ASSERT_LT(index, m_layerNames.size());
52 m_layerNames[index] = name;
53}
54
55inline void RenderObservationInfo::setIntegerStat(const std::size_t index, const std::string& name)
56{
57 if(index >= m_integerStatNames.size())
58 {
59 m_integerStatNames.resize(index + 1);
60 }
61
62 PH_ASSERT_LT(index, m_integerStatNames.size());
63 m_integerStatNames[index] = name;
64}
65
66inline void RenderObservationInfo::setRealStat(const std::size_t index, const std::string& name)
67{
68 if(index >= m_realStatNames.size())
69 {
70 m_realStatNames.resize(index + 1);
71 }
72
73 PH_ASSERT_LT(index, m_realStatNames.size());
74 m_realStatNames[index] = name;
75}
76
78{
79 return m_progressTimeMeasurement;
80}
81
82inline std::string RenderObservationInfo::getLayerName(const std::size_t index) const
83{
84 PH_ASSERT_LT(index, m_layerNames.size());
85 return m_layerNames[index];
86}
87
88inline std::string RenderObservationInfo::getIntegerStatName(const std::size_t index) const
89{
90 PH_ASSERT_LT(index, m_integerStatNames.size());
91 return m_integerStatNames[index];
92}
93
94inline std::string RenderObservationInfo::getRealStatName(const std::size_t index) const
95{
96 PH_ASSERT_LT(index, m_realStatNames.size());
97 return m_realStatNames[index];
98}
99
100inline std::size_t RenderObservationInfo::numLayers() const
101{
102 return m_layerNames.size();
103}
104
106{
107 return m_integerStatNames.size();
108}
109
110inline std::size_t RenderObservationInfo::numRealStats() const
111{
112 return m_realStatNames.size();
113}
114
115}// end namespace ph
Meta information for data related to ongoing render operation.
Definition RenderObservationInfo.h:15
std::string getProgressTimeMeasurement() const
Definition RenderObservationInfo.h:77
void setRealStat(std::size_t index, const std::string &name)
Definition RenderObservationInfo.h:66
std::string getRealStatName(std::size_t index) const
Definition RenderObservationInfo.h:94
void setProgressTimeMeasurement(const std::string &measurement)
Definition RenderObservationInfo.h:39
void setIntegerStat(std::size_t index, const std::string &name)
Definition RenderObservationInfo.h:55
std::size_t numRealStats() const
Definition RenderObservationInfo.h:110
std::size_t numIntegerStats() const
Definition RenderObservationInfo.h:105
std::size_t numLayers() const
Definition RenderObservationInfo.h:100
void setLayer(std::size_t index, const std::string &name)
Definition RenderObservationInfo.h:44
std::string getLayerName(std::size_t index) const
Definition RenderObservationInfo.h:82
std::string getIntegerStatName(std::size_t index) const
Definition RenderObservationInfo.h:88
The root for all renderer implementations.
Definition EEngineProject.h:6