⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphview.h

📁 演示了最小生成树的普林算法和克鲁斯卡尔算法得算法过程。
💻 H
字号:
// GraphView.h : interface of the CGraphView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_GRAPHVIEW_H__2A40FCB7_643B_44BE_9117_6F4AA4967223__INCLUDED_)
#define AFX_GRAPHVIEW_H__2A40FCB7_643B_44BE_9117_6F4AA4967223__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//我的定义
#include "Smalltree.h"
#define R 10;//半径
#define textR 5;
//定义结束
class CGraphView : public CView
{
protected: // create from serialization only
	CGraphView();
	DECLARE_DYNCREATE(CGraphView)

// Attributes
public:
	CGraphDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGraphView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CGraphView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	//我的定义
	void drawline(CDC* hdc,CPoint point1,CPoint point2,int weight);
	void drawmap(CDC* hdc,Smalltree& smalltree);
	void drawPnode(CDC* hdc,Smalltree& smalltree);
	void drawKnode(CDC* hdc,Smalltree& smalltree);
	int linewide;
	COLORREF linecol;
	int MapX;//各个图的相对原点的偏移量
	int MapY;
	int primeX;
	int primeY;
	int kX;
	int kY;
	Pos pvex[18];
	Pos kvex[18];
	bool primeif;
	bool kruscalif;
	//定义结束
protected:
	//{{AFX_MSG(CGraphView)
	afx_msg void OnPrime();
	afx_msg void OnKruscal();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in GraphView.cpp
inline CGraphDoc* CGraphView::GetDocument()
   { return (CGraphDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GRAPHVIEW_H__2A40FCB7_643B_44BE_9117_6F4AA4967223__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -