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

📄 command.h

📁 这是我写的数据结构的课设
💻 H
字号:
// Command.h: interface for the CCommand class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_COMMAD_H__5CA7A7E8_B327_41F2_988E_1666C8A1B779__INCLUDED_)
#define AFX_COMMAD_H__5CA7A7E8_B327_41F2_988E_1666C8A1B779__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000



class CCommand
{
protected:
	int		m_nStep ; // 命令操作步

public:
	CCommand() {}
	~CCommand() {}

	virtual int GetType() = 0;	// 返回命令类型 ECommandType
	virtual int OnLButtonDown(UINT nFlags, const CPoint center) = 0 ;
	virtual int OnMouseMove(UINT nFlags, const CPoint center) = 0 ;
	virtual int OnRButtonDown(UINT nFlags, const CPoint center) = 0 ;
	virtual int Cancel() = 0 ;
} ;


///////////////////////////////////////////////////////////////
/*	
 *	CInsertVertex
 */
class CInsertVertex : public CCommand
{
private:
	CPoint m_center;
public:
	CInsertVertex() ;
	~CInsertVertex() ;

	int		GetType();
	int		OnLButtonDown(UINT nFlags, const CPoint center) ;
	int		OnMouseMove(UINT nFlags, const CPoint center) ;
	int		OnRButtonDown(UINT nFlags, const CPoint center) ;

	int		Cancel() ;
} ;

///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
/*	
 *	CInsertPath
 */
class CInsertPath : public CCommand
{
private:
	CPoint m_center;
public:
	CInsertPath() ;
	~CInsertPath() ;

	int		GetType();
	int		OnLButtonDown(UINT nFlags, const CPoint center) ;
	int		OnMouseMove(UINT nFlags, const CPoint center) ;
	int		OnRButtonDown(UINT nFlags, const CPoint center) ;

	int		Cancel() ;
} ;
///////////////////////////////////////////////////////////////
/*	
 *	CDelete
 */
class CDelete : public CCommand
{
private:
	CPoint m_center;
public:
	CDelete() ;
	~CDelete() ;

	int		GetType();
	int		OnLButtonDown(UINT nFlags, const CPoint center) ;
	int		OnMouseMove(UINT nFlags, const CPoint center) ;
	int		OnRButtonDown(UINT nFlags, const CPoint center) ;

	int		Cancel() ;
} ;
///////////////////////////////////////////////////////////////
/*	
 *	CChange
 */
class CChange : public CCommand
{
private:
	CPoint m_center;
public:
	CChange() ;
	~CChange() ;

	int		GetType();
	int		OnLButtonDown(UINT nFlags, const CPoint center) ;
	int		OnMouseMove(UINT nFlags, const CPoint center) ;
	int		OnRButtonDown(UINT nFlags, const CPoint center) ;

	int		Cancel() ;
} ;
///////////////////////////////////////////////////////////////
/*	
 *	CInformation 
 */
class CInformation : public CCommand
{
private:
	CPoint m_center;
public:
	CInformation() ;
	~CInformation() ;

	int		GetType();
	int		OnLButtonDown(UINT nFlags, const CPoint center) ;
	int		OnMouseMove(UINT nFlags, const CPoint center) ;
	int		OnRButtonDown(UINT nFlags, const CPoint center) ;

	int		Cancel() ;
} ;
///////////////////////////////////////////////////////////////
/*	
 *	CShortestPath
 */
class CShortestPath : public CCommand
{
private:
	CPoint m_center;
public:
	CShortestPath() ;
	~CShortestPath() ;

	int		GetType();
	int		OnLButtonDown(UINT nFlags, const CPoint center) ;
	int		OnMouseMove(UINT nFlags, const CPoint center) ;
	int		OnRButtonDown(UINT nFlags, const CPoint center) ;

	int		Cancel() ;
} ;
///////////////////////////////////////////////////////////////
/*	
 *	CAllPaths
 */
class CAllPaths : public CCommand
{
private:
	CPoint m_center;
public:
	CAllPaths() ;
	~CAllPaths() ;

	int		GetType();
	int		OnLButtonDown(UINT nFlags, const CPoint center) ;
	int		OnMouseMove(UINT nFlags, const CPoint center) ;
	int		OnRButtonDown(UINT nFlags, const CPoint center) ;

	int		Cancel() ;
} ;

#endif // !defined(AFX_COMMAD_H__5CA7A7E8_B327_41F2_988E_1666C8A1B779__INCLUDED_)

⌨️ 快捷键说明

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