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

📄 intersectionview.h

📁 实现画点画线功能以及二维空间的分析
💻 H
字号:
// IntersectionView.h : interface of the CIntersectionView class
//


#pragma once
typedef struct tagPoint   //定义点结构
{
	float x;
	float y;
}PNT_INFO;

typedef struct tagLine    //定义线结构
{
	PNT_INFO pnt[100];
	long num;
}LIN_INFO;


class CIntersectionView : public CView
{
protected: // create from serialization only
	CIntersectionView();
	DECLARE_DYNCREATE(CIntersectionView)

// Attributes
public:
	CIntersectionDoc* GetDocument() const;

// Operations
public:

// Overrides
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

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

protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()
public:
	short m_iDrawMode;            //画图模式(初始:0;  画点:1;  画线:2;  移点:3)
	long m_pointNum;              //点数
	long m_lineNum;               //线数
	long m_linepntNum;            //一条线上的点数
	int m_iNo;                    //移动点时,离鼠标最近距离点的点号(下标)
public:
	PNT_INFO m_point[100];       //点数组:装点的个数
	LIN_INFO m_line[100];        //线数组:装线的条数
	PNT_INFO m_linepnt[100];     //线点数组:一条线上的点数

public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
public:
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
public:
	afx_msg void OnDrawpoint();
	afx_msg void OnDrawline();
public:
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
};

#ifndef _DEBUG  // debug version in IntersectionView.cpp
inline CIntersectionDoc* CIntersectionView::GetDocument() const
   { return reinterpret_cast<CIntersectionDoc*>(m_pDocument); }
#endif

⌨️ 快捷键说明

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