-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCardio.h
123 lines (113 loc) · 3.14 KB
/
Cardio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
** \file Cardio.h graphics
**/
#if !defined(AFX_VPCardio_H__6EB02697_C83D_479E_AA50_17B0C1528A06__INCLUDED_)
#define AFX_VPCardio_H__6EB02697_C83D_479E_AA50_17B0C1528A06__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "nv_ISvcUI.h"
#include "IWindowImplementation.h"
#pragma warning(disable : 4786)
#include <map>
/**
**/
class CCardio :
public IWindowImpl<CCardio>,
public CDialog,
public ICardio,
public PlugContainer//, public ISmartRef
{
IMPLSMARTREF();
BEGINQUERYINTERFACE();
QIMAPITF(ICardio)
QIMAPITF(IWindow)
ENDQUERYINTERFACE();
public:
/// \name Factory stuff
//@{
DECL_OBJECTDESC_VARIABLE();
static const void *NewObjectFunc(unsigned long lparam1, unsigned long lparam2); // DECL_NEWOBJECTFUNC(CCardio, ICardio);
//@}
CCardio();
CWnd *m_pwnd;
protected:
//-----> GDI objects
HFONT hfont;
HPEN hpen_tline;
HBRUSH hbrush_bgnd;
//-----> Bitmaps that contains the rendered graphics
HBITMAP hbitmap[2]; // area of work
int bmpW, bmpH; // size of this area
HDC bmpDC[2]; // Compatible Device context used to draw
HDC *lpbmpDC[2];
//-----> Backup of previous stuff (SelectObject())
HGDIOBJ oldbrush;
HGDIOBJ oldpen;
HGDIOBJ oldbmp[2];
HGDIOBJ oldfont;
//----->
int m_ForceRefresh;
float m_XFreq; ///< frequency used to translate the bitmap.
float m_YMin, m_YMax, m_YScale, m_YOffset;
typedef struct
{
float y, prevy;
COLORREF color;
} s_pencil;
typedef std::map<int,s_pencil> t_pencils;
t_pencils m_pencils;
public:
// Dialog Data
//{{AFX_DATA(CCardio)
enum { IDD = IDD_CARDIO };
//}}AFX_DATA
/// \name MFC Wizard created
//@{
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCardio)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
//@}
// Implementation
public:
virtual ~CCardio();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
DECLARE_IWINDOW_IMPL(CCardio)
// Generated message map functions
protected:
void DrawScene();
void RefreshRect(RECT *rc=NULL);
void ResizeBitmap(int w, int h);
/// \name MFC Wizard created messages
//@{
//{{AFX_MSG(CCardio)
afx_msg void OnFileClose();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnPaint();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnClose();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
//@}
DECLARE_MESSAGE_MAP()
/// \name From the interface ICardio
//@{
virtual void SetPencil(int id, float y, unsigned long color);
virtual void DelPencil(int id);
virtual void Update(float dt);
virtual void SetYBounds(float ymin, float ymax);
virtual void *GetPlug(int n) { return NULL; }
//@}
virtual bool plug_IncomingData(IPlug *lpFrom, IPlug *lpTo, bool bSendEvent); // from PlugContainer
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VPTLineFrm_H__6EB02697_C83D_479E_AA50_17B0C1528A06__INCLUDED_)