📄 pathview.h
字号:
// PathView.h : interface of the CPathView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_PATHVIEW_H__42466631_8E24_493C_804C_6DCBEE698F9B__INCLUDED_)
#define AFX_PATHVIEW_H__42466631_8E24_493C_804C_6DCBEE698F9B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CPathView : public CView
{
protected: // create from serialization only
CPathView();
DECLARE_DYNCREATE(CPathView)
// Attributes
public:
CPathDoc* GetDocument();
// Operations
public:
void DrawRectangle(int, int, CDC *, COLORREF);
void GoAlongWall(CPoint now);//沿墙走函数
bool flagUp ,flagDown ,flagLeft ,flagRight;
void CheckUpDown(CPoint now);
void CheckRightLeft(CPoint now);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPathView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CPathView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
bool m_bDragging;//鼠标拖放
UINT m_uBrushType;//画刷颜色控制
CPoint m_cStart,m_cEnd;//寻径所需点信息
CPoint m_cNow;
//***** 局部稳定点问题 ******
int m_iCount;//在局部区域徘徊7次,说明陷入局部稳定状态
CPoint m_cBefore;
CPoint m_cMiddle;//存储网格坐标,用于沿墙走的计算
//***************************
//***** 内部操作函数 *****
void MouseToPoint(CPoint, UINT);
void DrawRoute(CDC *);
void DrawCircle(int, int, CDC *, COLORREF,int radius);
//************************
// Generated message map functions
protected:
//{{AFX_MSG(CPathView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
afx_msg void OnBrushType(UINT);
afx_msg void OnUpdateUIBrushType(CCmdUI *);
afx_msg void OnPathSearch();
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in PathView.cpp
inline CPathDoc* CPathView::GetDocument()
{ return (CPathDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PATHVIEW_H__42466631_8E24_493C_804C_6DCBEE698F9B__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -