DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
graph.h
Go to the documentation of this file.
1
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2
/* If you are missing that file, acquire a complete release at teeworlds.com. */
3
4
#ifndef ENGINE_CLIENT_GRAPH_H
5
#define ENGINE_CLIENT_GRAPH_H
6
7
#include <
base/color.h
>
8
9
#include <
engine/shared/ringbuffer.h
>
10
11
#include <cstdint>
12
13
class
IGraphics
;
14
class
ITextRender
;
15
16
class
CGraph
17
{
18
private
:
19
class
CEntry
20
{
21
public
:
22
int64_t
m_Time
;
23
float
m_Value
;
24
ColorRGBA
m_Color
;
25
bool
m_ApplyColor
;
26
};
27
CEntry
*
m_pFirstScaled
=
nullptr
;
28
int64_t
m_RenderedTotalTime
= 0;
29
float
m_Average
;
30
float
m_MinAxis
,
m_MaxAxis
;
31
float
m_MinValue
,
m_MaxValue
;
32
float
m_MinRange
,
m_MaxRange
;
33
CDynamicRingBuffer<CEntry>
m_Entries
;
34
int
m_Precision
;
35
bool
m_SummaryStats
;
36
37
void
RenderDataLines
(
IGraphics
*pGraphics,
float
x,
float
y,
float
w,
float
h);
38
39
public
:
40
CGraph
(
int
MaxEntries,
int
Precision,
bool
SummaryStats);
41
42
void
Init
(
float
Min,
float
Max);
43
void
SetMin
(
float
Min);
44
void
SetMax
(
float
Max);
45
46
void
Scale
(int64_t WantedTotalTime);
47
void
Add
(
float
Value,
ColorRGBA
Color =
ColorRGBA
(1.0f, 1.0f, 1.0f, 0.75f));
48
void
InsertAt
(int64_t Time,
float
Value,
ColorRGBA
Color =
ColorRGBA
(1.0f, 1.0f, 1.0f, 0.75f));
49
void
Render
(
IGraphics
*pGraphics,
ITextRender
*pTextRender,
float
x,
float
y,
float
w,
float
h,
const
char
*pDescription);
50
};
51
52
#endif
CDynamicRingBuffer
Definition
ringbuffer.h:92
CGraph::CEntry
Definition
graph.h:20
CGraph::CEntry::m_Time
int64_t m_Time
Definition
graph.h:22
CGraph::CEntry::m_Color
ColorRGBA m_Color
Definition
graph.h:24
CGraph::CEntry::m_Value
float m_Value
Definition
graph.h:23
CGraph::CEntry::m_ApplyColor
bool m_ApplyColor
Definition
graph.h:25
CGraph::m_Average
float m_Average
Definition
graph.h:29
CGraph::InsertAt
void InsertAt(int64_t Time, float Value, ColorRGBA Color=ColorRGBA(1.0f, 1.0f, 1.0f, 0.75f))
Definition
graph.cpp:138
CGraph::m_RenderedTotalTime
int64_t m_RenderedTotalTime
Definition
graph.h:28
CGraph::m_pFirstScaled
CEntry * m_pFirstScaled
Definition
graph.h:27
CGraph::m_MaxRange
float m_MaxRange
Definition
graph.h:32
CGraph::m_MaxValue
float m_MaxValue
Definition
graph.h:31
CGraph::m_MinAxis
float m_MinAxis
Definition
graph.h:30
CGraph::m_SummaryStats
bool m_SummaryStats
Definition
graph.h:35
CGraph::m_MaxAxis
float m_MaxAxis
Definition
graph.h:30
CGraph::Render
void Render(IGraphics *pGraphics, ITextRender *pTextRender, float x, float y, float w, float h, const char *pDescription)
Definition
graph.cpp:210
CGraph::Init
void Init(float Min, float Max)
Definition
graph.cpp:21
CGraph::RenderDataLines
void RenderDataLines(IGraphics *pGraphics, float x, float y, float w, float h)
Definition
graph.cpp:166
CGraph::SetMin
void SetMin(float Min)
Definition
graph.cpp:31
CGraph::m_Entries
CDynamicRingBuffer< CEntry > m_Entries
Definition
graph.h:33
CGraph::Scale
void Scale(int64_t WantedTotalTime)
Definition
graph.cpp:41
CGraph::Add
void Add(float Value, ColorRGBA Color=ColorRGBA(1.0f, 1.0f, 1.0f, 0.75f))
Definition
graph.cpp:133
CGraph::m_MinRange
float m_MinRange
Definition
graph.h:32
CGraph::m_Precision
int m_Precision
Definition
graph.h:34
CGraph::SetMax
void SetMax(float Max)
Definition
graph.cpp:36
CGraph::CGraph
CGraph(int MaxEntries, int Precision, bool SummaryStats)
Definition
graph.cpp:14
CGraph::m_MinValue
float m_MinValue
Definition
graph.h:31
ColorRGBA
Definition
color.h:183
ColorRGBA::ColorRGBA
constexpr ColorRGBA()=default
IGraphics
Definition
graphics.h:240
ITextRender
Definition
textrender.h:194
color.h
ringbuffer.h
src
engine
client
graph.h
Generated by
1.18.0