資源描述:
《數(shù)字高程模型作業(yè)_DEM編程.docx》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、此次作業(yè)主要采用C++語(yǔ)言編寫程序,同時(shí)利用了matlab進(jìn)行格網(wǎng)點(diǎn)以及DEM三維顯示。主要程序如下:#include"StdAfx.h"#include"IDW.h"#include"IDWDlg.h"#include"math.h"#ifdef_DEBUG#definenewDEBUG_NEW#undefTHIS_FILEstaticcharTHIS_FILE[]=__FILE__;#endif/***************************************************************/
2、/*CAboutDlgdialogusedforAppAbout*//**************************************************************/classCAboutDlg:publicCDialog{public:CAboutDlg();//DialogData//{{AFX_DATA(CAboutDlg)enum{IDD=IDD_ABOUTBOX};//}}AFX_DATA//ClassWizardgeneratedvirtualfunctionoverrides//{{
3、AFX_VIRTUAL(CAboutDlg)protected:virtualvoidDoDataExchange(CDataExchange*pDX);//DDX/DDVsupport//}}AFX_VIRTUAL//Implementationprotected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg():CDialog(CAboutDlg::IDD){//{{AFX_DATA_INIT(CAboutDlg)/
4、/}}AFX_DATA_INIT}voidCAboutDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CAboutDlg,CDialog)//{{AFX_MSG_MAP(CAboutDlg)//Nomessagehandlers//}}AFX_MSG_MAPEND_MESSAGE_MAP()/*************
5、************************************************//*CIDWDlgdialog*//*************************************************************/CIDWDlg::CIDWDlg(CWnd*pParent/*=NULL*/):CDialog(CIDWDlg::IDD,pParent){//{{AFX_DATA_INIT(CIDWDlg)m_strOpenFileName=_T("");m_strSaveFileNam
6、e=_T("");m_maxX=0;m_maxY=0;m_minX=0;m_minY=0;m_rad=100.0f;m_stepDis=100.0f;//}}AFX_DATA_INIT//NotethatLoadIcondoesnotrequireasubsequentDestroyIconinWin32m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);}voidCIDWDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExcha
7、nge(pDX);//{{AFX_DATA_MAP(CIDWDlg)DDX_Control(pDX,IDC_PROGRESS1,m_ctrProgress);DDX_Text(pDX,IDC_OPEN_FILE,m_strOpenFileName);DDX_Text(pDX,IDC_SAVE_FILE,m_strSaveFileName);DDX_Text(pDX,IDC_EDIT_MAX_X,m_maxX);DDX_Text(pDX,IDC_EDIT_MAX_Y,m_maxY);DDX_Text(pDX,IDC_EDIT_M
8、IN_X,m_minX);DDX_Text(pDX,IDC_EDIT_MIN_Y,m_minY);DDX_Text(pDX,IDC_EDIT_RAD,m_rad);DDX_Text(pDX,IDC_EDIT_STEP_DIS,m_stepDis);//}}AFX_DATA_M