-
Notifications
You must be signed in to change notification settings - Fork 0
/
HGTReliefDlg.h
94 lines (80 loc) · 2.5 KB
/
HGTReliefDlg.h
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
93
94
// HGTReliefDlg.h : header file
//
#pragma once
#include "Legend.h"
#include "vector.h"//https://github.com/pelletier/vector3
struct CHGT
{
std::vector< std::vector<WORD> > Height;
};
// CHGTReliefDlg dialog
class CHGTReliefDlg : public CDialogEx
{
// Construction
public:
CHGTReliefDlg(CWnd* pParent = nullptr); // standard constructor
~CHGTReliefDlg();
CMFCEditBrowseCtrl m_LoadFileEdit;
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_HGTRELIEF_DIALOG };
#endif
CLegend m_Legend;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
CMFCColorPickerCtrl m_Color1;
CPalette m_palSys;
long m_nCurrentColorIndex;
long m_bSupressEditEvents;
void CalcHeightLabels();
void UpdateEditBoxes(COLORREF color);
void UpdateColorFromEditBoxes();
void DrawColor(UINT nCtrlID, COLORREF clr);
long m_selectedRadioButton;
bool RadioSelectionChanged(long m_nCurrentColorIndex);
void CreateMapImpl(CString strPath, bool bRelief);
void CreateMap( bool bRelief);
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
virtual BOOL OnInitDialog();
void ResetLegend();
void OnColorPalette();
afx_msg void OnBnClickedLegend1();
afx_msg void OnBnClickedLegend2();
afx_msg void OnBnClickedLegend3();
afx_msg void OnBnClickedLegend4();
afx_msg void OnBnClickedLegend5();
afx_msg void OnBnClickedLegend6();
afx_msg void OnBnClickedLegend7();
afx_msg void OnBnClickedLegend8();
afx_msg void OnBnClickedLegend9();
afx_msg void OnBnClickedLegend10();
afx_msg void OnBnClickedLegend11();
afx_msg void OnBnClickedLegend12();
afx_msg void OnBnClickedLegend13();
afx_msg void OnBnClickedLegend14();
afx_msg void OnBnClickedLegend15();
afx_msg void OnBnClickedReset();
afx_msg void OnEnChangeRed();
afx_msg void OnEnChangeGreen();
afx_msg void OnEnChangeBlue();
afx_msg void OnEnChangeHighest();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
CHGT m_HGT;
void DrawDEM(CHGT& hgt);
bool LoadHGT(CString strPath, CHGT& hgt);
bool SaveBitmapRGB(BYTE* Buffer, int width, int height, long paddedsize, LPCTSTR bmpfile);
int mixColors(int a, int b, float ratio);
Vector3 GetNormal(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z);
BYTE* m_pBMP;
void CalcMapImage(CString strInput, CString strOutput, bool bReliefMap);
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedCreateMap();
afx_msg void OnEnChangeEdit1();
afx_msg void OnBnClickedCreateMap2();
};