-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChildView.h
More file actions
70 lines (54 loc) · 1.66 KB
/
ChildView.h
File metadata and controls
70 lines (54 loc) · 1.66 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
// ChildView.h: CChildView 클래스의 인터페이스
//
#pragma once
struct HitNode {
int id; // 노드 ID
CPoint pt; // 선택 된 노드 좌표
};
// CChildView 창
class CChildView : public CWnd
{
// 생성입니다.
public:
CChildView();
// 특성입니다.
public:
CBitmap m_bgBitmap; // 지도 사진 출력 데이터
struct Node { // 노드 구조체
CPoint p_node; // 클릭 좌표
int id; // 노드 ID
int selected = 0; // 선택 여부 0(검정), 1(파랑), 2(빨강)
};
CList<Node, Node&> m_nodes; // 노드 리스트
struct Edge { // 간선 구조체
int s_node; // 시작 노드 ID
int e_node; // 끝 노드 ID
double length; // 간선 길이
};
CList<Edge, Edge&> m_edges; // 간선 리스트
int m_selectedNode[2]; // 선택된 노드 ID
int m_selectedCount; // 선택된 노드 수
CList<Edge, Edge&> m_shortCutEdges; // 최단 경로 간선 리스트
int m_shortSelectedNode[2]; // 최단 경로 노드 ID
int m_shortSelectedCount; // 최단 경로 노드 수
// 작업입니다.
public:
HitNode CheckHitNode(CPoint p_hit); // 노드 클릭 체크 함수
void AddLine(int id1, int id2); // 간선 추가 함수
void FindShortestPath(int startID, int endID); // 최단 경로 계산 함수
// 재정의입니다.
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// 구현입니다.
public:
virtual ~CChildView();
// 생성된 메시지 맵 함수
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
public:
// afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
};