Repository navigation
Expand file tree
/
Copy pathusefulView.h
More file actions
93 lines (76 loc) · 1.92 KB
/
Copy pathusefulView.h
File metadata and controls
93 lines (76 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// usefulView.h : CusefulView 类的接口
//
#pragma once
#include "shpEngine/MapControl.h"
#include "shpEngine/DataSet.h"
#include <vector>
using namespace std;
struct TRIANGLE
{
int paivertix[3];
int piffacest[3];
};
struct TriVERTIX
{
double padivertixX;
double padivertixY;
};
struct GridVERTIX
{
double grid_x;
double grid_y;
double grid_value;
};
typedef vector<TRIANGLE> tagTIN;
typedef vector<TriVERTIX> tagVEX;
typedef vector<GridVERTIX> tagGRID;
class CusefulDoc;
class CusefulView : public CView
{
protected: // 仅从序列化创建
CusefulView();
DECLARE_DYNCREATE(CusefulView)
// 特性
public:
CusefulDoc* GetDocument() const;
// 操作
public:
// 重写
public:
virtual void OnDraw(CDC* pDC); // 重写以绘制该视图
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);
//从文件中导入三角形,绘制三角形代码
void draw_triangle(tagTIN tinNet,tagVEX triVex,CDC* pDC);
void draw_grid(tagGRID grid,CDC *pDC);
MapControl *m_pMapControl;
BOOL m_is_show_SHP;
MapControl& CusefulView::GetMapControl();
// 实现
public:
virtual ~CusefulView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// 生成的消息映射函数
protected:
afx_msg void OnFilePrintPreview();
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
DECLARE_MESSAGE_MAP()
public:
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 OnShpFileOpen();
virtual void OnInitialUpdate();
};
#ifndef _DEBUG // usefulView.cpp 中的调试版本
inline CusefulDoc* CusefulView::GetDocument() const
{ return reinterpret_cast<CusefulDoc*>(m_pDocument); }
#endif