graphview.cpp
来自「实现了无线传感器网络中的一个路由协议算法。」· C++ 代码 · 共 66 行
CPP
66 行
// GraphView.cpp : implementation file
//
#include "stdafx.h"
#include "GlobalClass.h"
#include "SimSensor.h"
#include "GraphView.h"
#include "Draw.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CDraw Draw;
/////////////////////////////////////////////////////////////////////////////
// CGraphView
IMPLEMENT_DYNCREATE(CGraphView, CView)
CGraphView::CGraphView()
{
}
CGraphView::~CGraphView()
{
}
BEGIN_MESSAGE_MAP(CGraphView, CView)
//{{AFX_MSG_MAP(CGraphView)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGraphView drawing
void CGraphView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
LPRECT ViewRect = new RECT;
GetWindowRect(ViewRect);
g_GraphViewCenterY = (double)(ViewRect->bottom / 2 - ViewRect->top / 2 );
g_GraphViewCenterX = (double)(ViewRect->right / 2 - ViewRect->left / 2 );
if (g_NodeSet) {
Draw.DrawGraph(this,pDC);
}
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CGraphView diagnostics
#ifdef _DEBUG
void CGraphView::AssertValid() const
{
CView::AssertValid();
}
void CGraphView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?