Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / nel / tools / 3d / object_viewer / graph.h
blob010891adda51a3238c8e30c3e4d0695609e0809b
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef GRAPH_H
18 #define GRAPH_H
20 #include "nel/misc/types_nl.h"
22 #include <nel/misc/rgba.h>
23 #include <nel/misc/time_nl.h>
25 #include <deque>
26 #include <string>
30 /**
31 * Graph class for network statistics
32 * \author Vianney Lecroart, Olivier Cado
33 * \author Nevrax France
34 * \date 2002
36 class CGraph
38 public:
39 std::string Name;
40 float X, Y, Width, Height;
41 NLMISC::CRGBA BackColor;
42 float MaxValue;
43 float Peak;
44 bool LineMode;
45 float PrevY;
47 std::deque<float> Values;
49 NLMISC::TTime Quantum;
51 NLMISC::TTime CurrentQuantumStart;
55 /// release material
56 ~CGraph()
61 /// Constructor (CGraph::init() must have been called before)
62 CGraph (std::string name,
63 float x, float y, float width, float height,
64 NLMISC::CRGBA backColor,
65 NLMISC::TTime quantum,
66 float maxValue,
67 bool lineMode = false)
68 : Name(name), X(x), Y(y), Width(width), Height(height), BackColor(backColor), Quantum(quantum),
69 MaxValue(maxValue), Peak(0.0f), LineMode(lineMode), PrevY(y)
71 CurrentQuantumStart = (uint64) (1000 * NLMISC::CTime::ticksToSecond(NLMISC::CTime::getPerformanceTime()));
74 /// Add one value
75 void addOneValue (float value = 0.0f);
77 /// Add value
78 void addValue (float value);
80 static bool DisplayAverageValue;
81 static bool Display;
83 void renderGraph ();
85 private:
93 #endif // GRAPH_H
95 /* End of graph.h */