PageRenderTime 17ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llui/llstatgraph.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 70 lines | 34 code | 11 blank | 25 comment | 0 complexity | c2a45bb6af7066e76ea02bb5d79e1763 MD5 | raw file
 1/** 
 2 * @file llstatgraph.h
 3 * @brief Simpler compact stat graph with tooltip
 4 *
 5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLSTATGRAPH_H
28#define LL_LLSTATGRAPH_H
29
30#include "llview.h"
31#include "llframetimer.h"
32#include "v4color.h"
33
34class LLStat;
35
36class LLStatGraph : public LLView
37{
38public:
39	LLStatGraph(const LLView::Params&);
40
41	virtual void draw();
42
43	void setLabel(const std::string& label);
44	void setUnits(const std::string& units);
45	void setPrecision(const S32 precision);
46	void setStat(LLStat *statp);
47	void setThreshold(const S32 i, F32 value);
48	void setMin(const F32 min);
49	void setMax(const F32 max);
50
51	/*virtual*/ void setValue(const LLSD& value);
52	
53	LLStat *mStatp;
54	BOOL mPerSec;
55private:
56	F32 mValue;
57
58	F32 mMin;
59	F32 mMax;
60	LLFrameTimer mUpdateTimer;
61	std::string mLabel;
62	std::string mUnits;
63	S32 mPrecision; // Num of digits of precision after dot
64
65	S32 mNumThresholds;
66	F32 mThresholds[4];
67	LLColor4 mThresholdColors[4];
68};
69
70#endif  // LL_LLSTATGRAPH_H