1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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/>.
20 // comment this define if you don't want 3d output
33 #include <nel/misc/rgba.h>
34 #include <nel/misc/time_nl.h>
36 #include <nel/3d/u_driver.h>
37 #include <nel/3d/u_text_context.h>
47 float X
, Y
, Width
, Height
;
48 NLMISC::CRGBA BackColor
;
52 std::deque
<float> Values
;
54 NLMISC::TTime Quantum
;
56 NLMISC::TTime CurrentQuantumStart
;
58 CGraph (std::string name
, float x
, float y
, float width
, float height
, NLMISC::CRGBA backColor
, NLMISC::TTime quantum
, float maxValue
)
59 : Name(name
), X(x
), Y(y
), Width(width
), Height(height
), BackColor(backColor
), MaxValue(maxValue
), Peak(0.0f
), Quantum(quantum
),
60 CurrentQuantumStart(NLMISC::CTime::getLocalTime())
64 _Graphs
= new std::vector
<CGraph
*>;
67 _Graphs
->push_back (this);
70 void addOneValue (float value
= 0.0f
);
71 void addValue (float value
);
73 static void render (NL3D::UDriver
&driver
, NL3D::UTextContext
&tc
);
76 static bool DisplayAverageValue
;
80 static std::vector
<CGraph
*> *_Graphs
;
82 void render (NL3D::UDriver
*Driver
, NL3D::UTextContext
*TextContext
);