代码拉取完成,页面将自动刷新
//========= Copyright ?1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef GRAPHPANEL_H
#define GRAPHPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "Panel.h"
#include <tier1/utllinkedlist.h>
#include <tier1/utlvector.h>
namespace vgui2
{
//-----------------------------------------------------------------------------
// Purpose: Holds and displays a chart
//-----------------------------------------------------------------------------
class GraphPanel : public Panel
{
DECLARE_CLASS_SIMPLE( GraphPanel, Panel );
public:
GraphPanel(Panel *parent, const char *name);
// domain settings (x-axis settings)
// sets the window of samples to display
void SetDisplayDomainSize(float size);
// sets the range of samples the graph should keep
// should be set to the max you would set the display domain size
void SetMaxDomainSize(float size);
// sets the minimum domain that will be displayed; used to collapse samples
void SetMinDomainSize(float size);
// range settings (y-axis settings)
void SetUseFixedRange(float lowRange, float highRange);
void SetUseDynamicRange(float *rangeList, int numRanges);
void GetDisplayedRange(float &lowRange, float &highRange);
// adds an item to the end of the list
// sampleEnd is assumed to be the trailing edge of the sample
// assumes that the samples are fairly evenly spaced (not much more work to do to fix this though)
void AddItem(float sampleEnd, float sampleValue);
protected:
virtual void Paint();
virtual void PerformLayout();
virtual void ApplySchemeSettings(IScheme *pScheme);
private:
int GetVisibleItemCount();
struct Sample_t
{
float sampleEnd;
float value;
};
CUtlLinkedList<Sample_t, int> m_Samples;
// the window to show
float m_flDomainSize;
float m_flMaxDomainSize, m_flMinDomainSize;
bool m_bMaxDomainSizeSet;
// range
float m_flLowRange, m_flHighRange;
bool m_bUseDynamicRange;
CUtlVector<float> m_RangeList;
// rendering
int m_iGraphBarWidth;
int m_iGraphBarGapWidth;
};
} // namespace vgui
#endif // GRAPHPANEL_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。