📄 quakeview.h
字号:
//////////////////////////////////////////////////////////////////////
// QuakeView.h: interface for the CQuakeView class.
// Files for Quake Demo Project
// 2005.1.8
// If this code works, it was written by TY.
// If not, I don't know who wrote it.
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_QUAKEVIEW_H__9ED4FAEA_B8C2_4551_AD7C_CC95A8CCECC7__INCLUDED_)
#define AFX_QUAKEVIEW_H__9ED4FAEA_B8C2_4551_AD7C_CC95A8CCECC7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// QuakeView.h : header file
#include "BaseView.h"
/////////////////////////////////////////////////////////////////////////////
//
// 震动模拟显示视图类
//
/////////////////////////////////////////////////////////////////////////////
#define SPACE_Height 1
typedef enum _DrawType{DT_Userdefined = 1, DT_Auto}DrawType;
//CQuakeView view//////////////////////////////////////////////////////////////
class CQuakeView : public CBaseView
{
protected:
CQuakeView();
virtual ~CQuakeView();
DECLARE_DYNCREATE(CQuakeView)
void SetDrawType(DrawType type = DT_Userdefined); //设置绘图模式
DrawType GetDrawType() const; //获得绘图模式
void SetRate(double rate); //设置倍率
//数据处理
BOOL Process(int index, const int &MaxDrawDisp,int &drawdisp);
private:
double m_MaxDataDisp; //文件数据的最大偏移量
double m_CurRate; //当前绘图比率
DrawType m_DrawType; //绘图比率的处理方式
public://偏移量数据函数
void SetFileManager(CQuakeFileManager* pFileManager); //设置数据源
void SetDrawManager(CQuakeDrawManager* pDrawManager); //绘制绘图数据源
void TimeProc(); //震动绘图主函数
int GetFloorSize()const; //获得楼层数
void GetBufferAt(int index, DispStruct &dispitem)const; //获得指定层数的结构体
void GetMaxDisp(int index, DispStruct &dispitem);
void UpdateView(); //更新视图
void ClearView(); //清除视图
//警告操作函数
void SetRedMark(int index); //设置红色标志
void SetYellowMark(int index); //设置黄色标志
void ResetMark(); //清除所有标志
void ShowMark(); //更新标志显示
private:
BOOL m_bModify; //警告指示是否改变
HICON m_YellowMark;
HICON m_RedMark;
int m_nFloorSize;
//默认绘图类函数变量
void DrawLogo(CDC* pDC, LPCRECT drect);
CPicture m_LogoPic; //初始图像对象
CString m_LogoPicPN; //初始图像路径名称
//关于区域的函数和变量
void CalcDrawRect(const CRect &MemRect); //计算绘图区域
void CalcPicRect(BOOL bKScale = TRUE); //图片显示区域
void CreateMemPic(CDC* pDC); //重新生成内存图像
CRect m_MemRect; //双缓冲显示区域
CRect m_QuakeRect; //震动显示区域
CRect m_PicRect; //图片显示区域
double m_XPicRate; //图片显示区域大小比例
double m_YPicRate; //图片显示区域大小比例
unsigned int m_PicSpace; //图片上下间的距离
COLORREF m_MemBKCor; //内存绘图区域背景颜色
DrawItemArray *m_pDIArray; //绘图对象列表
DrawItemArray *m_pTempSave;
CWarnArray *m_pWarnList; //保存警示数据链表
DispArray m_DispBuffer; //数据临时保存区
DispArray m_MaxDispArray; //最大位移保存链表
CQuakeFileManager* m_pFileManager;
CQuakeDrawManager* m_pDrawManager;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CQuakeView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CQuakeView)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_QUAKEVIEW_H__9ED4FAEA_B8C2_4551_AD7C_CC95A8CCECC7__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -