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

📄 bufferview.h

📁 空间分析模型代码 实现缓冲分析和重叠分析下的集中情况
💻 H
字号:
// BufferView.h : interface of the CBufferView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_BUFFERVIEW_H__CFACD935_83C2_4548_88CD_C2552EE8A788__INCLUDED_)
#define AFX_BUFFERVIEW_H__CFACD935_83C2_4548_88CD_C2552EE8A788__INCLUDED_

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

//直线
struct LINE
{
	POINT pStart;
	POINT pEnd;

	
};

enum BUFFEROPERATION
{
	BufferPoint = 1,
	BufferLine = 2,
	BufferPolygon = 3

};
class CBufferView : public CScrollView
{
protected: // create from serialization only
	CBufferView();
	DECLARE_DYNCREATE(CBufferView)

// Attributes
public:
	CBufferDoc* GetDocument();
    BUFFEROPERATION m_BufferOperation;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBufferView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	//缓冲区分析中用到的变量
	double m_xielv;
 

	BOOL m_LBotton_point;  //进行点缓冲
    BOOL m_LBotton_line;   //进行线缓冲
	BOOL m_LBotton_polygon;  //进行面缓冲
	BOOL m_buffer;      // 进行缓冲区分析
	BOOL m_overlap;    // 进行叠置分析
    CPoint m_pIncert;  //两条线段的交点

    CArray<CPoint,CPoint&> m_points_point;   //存储点缓冲中的点
	//****************
	CArray<CPoint,CPoint&> m_points_line;    //存储线缓冲中的点
	//****************
    CArray<LINE,LINE&> m_bufferline;         //存储线缓冲中的线
    CArray<LINE,LINE&> m_bufferpolygon;      //存储线面缓冲中的面
    CPoint pStart;                           //每条线段和多边形起始的点

    int point_num;
    int i;                  //统计缓冲区分析中线段和多边形是否结束
	int buffer_rad; //缓冲区半径
    
    
	//叠置分析中用到的变量
    
	CArray<CPoint,CPoint&> m_overlap_ppoints; //存储点面叠置中的点
    CArray<CPoint,CPoint&> m_overlap_ppoly;  //存储点面叠置中组成面的点
    CArray<CPoint,CPoint&> m_overlap_polyA;   //存储面面叠置中polyA的点 
	CArray<CPoint,CPoint&> m_overlap_polyB;   //存储面面叠置中polyB的点
	CArray<CPoint,CPoint&> m_overlap_Lpoints; //存储线面叠置中构成线的点
	CArray<LINE,LINE&> m_line;  //存储线面叠置中的线
	CArray<LINE,LINE&> m_poly;  //存储线面叠置中组成面的线
    CArray<LINE,LINE&> m_line_result; //存储叠置后生成的线
	CArray<CPoint,CPoint&> m_points; //存储线面相交时的交点
	
	BOOL m_o_pDrawPoint;    //进行点叠置画点操作
    BOOL m_o_pDrawPoly;     //进行点叠置画面操作
	BOOL pp_created;        //进行点面叠置分析操作
    BOOL drawpolyA;        //进行面面叠置分析画面A操作         
	BOOL drawpolyB;        //进行面面叠置分析画面B操作
	BOOL over_union;        //进行面面叠置分析 并 操作
	BOOL over_insert;        //进行面面叠置分析 交 操作
	BOOL over_difference;    //进行面面叠置分析 补 操作
	BOOL drawline;        //进行线面叠置分析画线操作
	BOOL drawpoly;        //进行面面叠置分析画面操作
    BOOL line_poly; 
	
	int  m_lBDown;          //计算鼠标单击的次数
	int  over_ppoints;      //统计点面叠置中点的个数

	CRgn p_polygon;         //点面叠置中生成多边形区域 
    CRgn p_polyA;             //面面叠置中生成polyA的多边形区域
    CRgn p_polyB;           // 面面叠置中生成polyB的多边形区域

    void DrawBuffer(CDC *pDC,CPoint pt_f,CPoint pt_b,int r);
    void Line(CDC *pDC,CPoint pt_f,CPoint pt_b);
    void PointBuffer(CDC *pDC, POINT* lpPoints,int nCount,int r);
    void LineBuffer(CDC* pDC, POINT* lpPoints,const DWORD* lpPolyPoints, int nCount);
    void Line(CDC *pDC,LINE l);
	bool LineIncert(LINE l1,LINE l2);
	void Polygon(CDC* pDC, POINT* lpPoints,int nCount);
	void Polygon(CDC* pDC, LINE* lines,int nCount);
	void LineRgn(CDC *pDC,LINE line,LINE *poly,int nCount);
	void RemoveAllOverlap();
	void RemoveAllBuffer();

	virtual ~CBufferView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CBufferView)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnBufferPoint();
	afx_msg void OnBufferLine();
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnBufferPolygon();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnPbufferCreated();
	afx_msg void OnLbufferCreated();
	afx_msg void OnGbufferCreated();
	afx_msg void OnOverlapPoint();
	afx_msg void OnOVERLAPPPoly();
	afx_msg void OnOVERLAPPOverLap();
	afx_msg void OnOverlapDrawpoly1();
	afx_msg void OnOverlapDrawpoly2();
	afx_msg void OnOverlapUnion();
	afx_msg void OnOverlapInsert();
	afx_msg void OnOverlapDifference();
	afx_msg void OnOVERLAPLLine();
	afx_msg void OnOverlapLpoly();
	afx_msg void OnOVERLAPLOverLap();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in BufferView.cpp
inline CBufferDoc* CBufferView::GetDocument()
   { return (CBufferDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_BUFFERVIEW_H__CFACD935_83C2_4548_88CD_C2552EE8A788__INCLUDED_)

⌨️ 快捷键说明

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