添加项目文件。
This commit is contained in:
		
							
								
								
									
										22
									
								
								LandslidePredict.sln
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								LandslidePredict.sln
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					Microsoft Visual Studio Solution File, Format Version 12.00
 | 
				
			||||||
 | 
					# Visual Studio Version 16
 | 
				
			||||||
 | 
					VisualStudioVersion = 16.0.32630.194
 | 
				
			||||||
 | 
					MinimumVisualStudioVersion = 10.0.40219.1
 | 
				
			||||||
 | 
					Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LandslidePredict", "LandslidePredict\LandslidePredict.vcxproj", "{ABE55CAB-C9A0-4D11-AF67-DEFEF07F3DA5}"
 | 
				
			||||||
 | 
					EndProject
 | 
				
			||||||
 | 
					Global
 | 
				
			||||||
 | 
						GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
				
			||||||
 | 
							Release|x64 = Release|x64
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
						GlobalSection(ProjectConfigurationPlatforms) = postSolution
 | 
				
			||||||
 | 
							{ABE55CAB-C9A0-4D11-AF67-DEFEF07F3DA5}.Release|x64.ActiveCfg = Release|x64
 | 
				
			||||||
 | 
							{ABE55CAB-C9A0-4D11-AF67-DEFEF07F3DA5}.Release|x64.Build.0 = Release|x64
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
						GlobalSection(SolutionProperties) = preSolution
 | 
				
			||||||
 | 
							HideSolutionNode = FALSE
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
						GlobalSection(ExtensibilityGlobals) = postSolution
 | 
				
			||||||
 | 
							SolutionGuid = {A9D5438D-7ABE-4CBF-BEAE-6F3FE0CBEB3F}
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
					EndGlobal
 | 
				
			||||||
							
								
								
									
										98
									
								
								LandslidePredict/CProcessBase.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								LandslidePredict/CProcessBase.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,98 @@
 | 
				
			|||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* <20>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڣ<D3BF><DAA3><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3>ǰ<EFBFBD>㷨<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>ֵ
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					//Դ<>룺class IMGALG_API CProcessBase
 | 
				
			||||||
 | 
					class CProcessBase
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD>캯<EFBFBD><ECBAAF>
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						CProcessBase()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							m_dPosition = 0.0;
 | 
				
			||||||
 | 
							m_iStepCount = 100;
 | 
				
			||||||
 | 
							m_iCurStep = 0;
 | 
				
			||||||
 | 
							m_bIsContinue = true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						virtual ~CProcessBase() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
						* @param pszMsg			<09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						virtual void SetMessage(const char* pszMsg) = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						* @param dPosition		<09><><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						* @return <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>״̬<D7B4><CCAC>trueΪ<65><CEAA>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>falseΪȡ<CEAA><C8A1>
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						virtual bool SetPosition(double dPosition) = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>true<75><65>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>false<73><65>ʾȡ<CABE><C8A1>
 | 
				
			||||||
 | 
						* @return <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>״̬<D7B4><CCAC>trueΪ<65><CEAA>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>falseΪȡ<CEAA><C8A1>
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						virtual bool StepIt() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD>ý<EFBFBD><C3BD>ȸ<EFBFBD><C8B8><EFBFBD>
 | 
				
			||||||
 | 
						* @param iStepCount		<09><><EFBFBD>ȸ<EFBFBD><C8B8><EFBFBD>
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						virtual void SetStepCount(int iStepCount)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							ReSetProcess();
 | 
				
			||||||
 | 
							m_iStepCount = iStepCount;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
						* @return <20><><EFBFBD>ص<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						string GetMessage()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return m_strMessage;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						* @return <20><><EFBFBD>ص<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						double GetPosition()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return m_dPosition;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						void ReSetProcess()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							m_dPosition = 0.0;
 | 
				
			||||||
 | 
							m_iStepCount = 100;
 | 
				
			||||||
 | 
							m_iCurStep = 0;
 | 
				
			||||||
 | 
							m_bIsContinue = true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ */
 | 
				
			||||||
 | 
						string m_strMessage;
 | 
				
			||||||
 | 
						/*! <20><><EFBFBD><EFBFBD>ֵ */
 | 
				
			||||||
 | 
						double m_dPosition;
 | 
				
			||||||
 | 
						/*! <20><><EFBFBD>ȸ<EFBFBD><C8B8><EFBFBD> */
 | 
				
			||||||
 | 
						int m_iStepCount;
 | 
				
			||||||
 | 
						/*! <20><><EFBFBD>ȵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD> */
 | 
				
			||||||
 | 
						int m_iCurStep;
 | 
				
			||||||
 | 
						/*! <20>Ƿ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ֵΪfalseʱ<65><CAB1>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1> */
 | 
				
			||||||
 | 
						bool m_bIsContinue;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										383
									
								
								LandslidePredict/LandslidePredict.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										383
									
								
								LandslidePredict/LandslidePredict.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,383 @@
 | 
				
			|||||||
 | 
					#include "LandslidePredict.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <qgsrasterlayer.h>
 | 
				
			||||||
 | 
					#include <qgsvectorlayer.h>
 | 
				
			||||||
 | 
					#include <qgsmapcanvas.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LandslidePredict::LandslidePredict()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						//ui.setupUi(this);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString LandslidePredict::PannelName()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD>");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString LandslidePredict::CategoryName()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD>");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString LandslidePredict::EnglishName()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return QString::fromLocal8Bit("LandslidePredict");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString LandslidePredict::ChineseName()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD>");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString LandslidePredict::Information()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD>");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString LandslidePredict::IconPath()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return QString(":/LandslidePredict/resources/landslide.svg");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QWidget* LandslidePredict::CenterWidget()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QString gdal_path = qApp->applicationDirPath().toLocal8Bit() + "/share/gdal";
 | 
				
			||||||
 | 
						QString pro_lib_path = qApp->applicationDirPath().toLocal8Bit() + "/share/proj";
 | 
				
			||||||
 | 
						qputenv("GDAL_DATA", gdal_path.toLocal8Bit());
 | 
				
			||||||
 | 
						qputenv("PROJ_LIB", pro_lib_path.toLocal8Bit());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						bool showWin = false;
 | 
				
			||||||
 | 
						if (myWidget == nullptr)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							myWidget = new QDialog();
 | 
				
			||||||
 | 
							showWin = true;
 | 
				
			||||||
 | 
							qDebug() << "new QDialog()";
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							qDebug() << "already have myWidget";
 | 
				
			||||||
 | 
							//<2F><><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
							myWidget->activateWindow();
 | 
				
			||||||
 | 
							myWidget->raise();
 | 
				
			||||||
 | 
							return myWidget;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						ui.setupUi(myWidget);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						myWidget->setWindowTitle(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD>"));
 | 
				
			||||||
 | 
						myWidget->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
 | 
				
			||||||
 | 
						myWidget->setWindowIcon(QIcon(":/LandslidePredict/resources/landslide.svg"));
 | 
				
			||||||
 | 
						myWidget->setAttribute(Qt::WA_QuitOnClose, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						myWidget->setAttribute(Qt::WA_DeleteOnClose);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						connect(myWidget, &QDialog::destroyed, this, [=]() {
 | 
				
			||||||
 | 
							qDebug() << "----Landslide Predict window close----";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							QDir pluginsDir = QDir(qApp->applicationDirPath());
 | 
				
			||||||
 | 
							if (pluginsDir.cd("srsplugins\\SldModel"))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								QString strConfigPath = pluginsDir.absoluteFilePath("sld_config.ini");
 | 
				
			||||||
 | 
								QFile f(strConfigPath);
 | 
				
			||||||
 | 
								if (f.exists())
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									WriteConfigPaths(strConfigPath);
 | 
				
			||||||
 | 
									f.close();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (mWorkThread != nullptr)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								mWorkThread->requestInterruption();//<2F><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3>ж<EFBFBD>
 | 
				
			||||||
 | 
								mWorkThread->quit();
 | 
				
			||||||
 | 
								mWorkThread->wait();//<2F><><EFBFBD><EFBFBD>wait<69><74><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD>finished<65>źŶ<C5BA>Ӧ<EFBFBD>IJۺ<C4B2><DBBA><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
								mWorkObject->on_cancel();
 | 
				
			||||||
 | 
								mWorkThread = nullptr;//mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫdelete
 | 
				
			||||||
 | 
								mWorkObject = nullptr;//mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							myWidget->close();
 | 
				
			||||||
 | 
							myWidget = nullptr;
 | 
				
			||||||
 | 
							qDebug() << "--destroyed";
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
						connect(ui.pbtInModel, &QPushButton::clicked, this, &LandslidePredict::chooseInModel);
 | 
				
			||||||
 | 
						connect(ui.pbtInDataset, &QPushButton::clicked, this, &LandslidePredict::chooseInDataset);
 | 
				
			||||||
 | 
						connect(ui.pbtPreResult, &QPushButton::clicked, this, &LandslidePredict::chooseResultPath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						connect(ui.pushButton_ok, &QPushButton::clicked, this, &LandslidePredict::readAndStart);
 | 
				
			||||||
 | 
						connect(ui.pushButton_cancel, &QPushButton::clicked, this, &LandslidePredict::pbCancel);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ui.pbtInModel->setFocus();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ui.progressBar->setTextVisible(true);
 | 
				
			||||||
 | 
						ui.progressBar->setRange(0, 100);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QFile qssFile(":/LandslidePredict/LandslidePredict.qss");
 | 
				
			||||||
 | 
						qssFile.open(QFile::ReadOnly); //<2F><>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						if (qssFile.isOpen())
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QString qss = QLatin1String(qssFile.readAll());
 | 
				
			||||||
 | 
							myWidget->setStyleSheet(qss);
 | 
				
			||||||
 | 
							qssFile.close();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							qDebug() << "no qssFile";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QDir pluginsDir = QDir(qApp->applicationDirPath());
 | 
				
			||||||
 | 
						if (pluginsDir.cd("srsplugins\\SldModel"))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QString strConfigPath = pluginsDir.absoluteFilePath("sld_config.ini");
 | 
				
			||||||
 | 
							QFile f(strConfigPath);
 | 
				
			||||||
 | 
							if (f.exists())
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								ReadConfigHistoryPaths(strConfigPath);
 | 
				
			||||||
 | 
								f.close();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (showWin)
 | 
				
			||||||
 | 
							myWidget->show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return myWidget;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::startWorkThread()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (mWorkObject != nullptr)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						mWorkThread = new QThread();
 | 
				
			||||||
 | 
						mWorkObject = new WorkObject();
 | 
				
			||||||
 | 
						mWorkObject->moveToThread(mWorkThread);
 | 
				
			||||||
 | 
						connect(mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater);
 | 
				
			||||||
 | 
						connect(mWorkThread, &QThread::finished, mWorkObject, &QObject::deleteLater);
 | 
				
			||||||
 | 
						connect(mWorkObject, &WorkObject::progress, myWidget, [=](int value) {ui.progressBar->setValue(value); });
 | 
				
			||||||
 | 
						connect(mWorkObject, &WorkObject::preFinished, this, &LandslidePredict::finished);
 | 
				
			||||||
 | 
						connect(mWorkObject, &WorkObject::addShpDataToMap, this, &LandslidePredict::openResultData);
 | 
				
			||||||
 | 
						connect(this, &LandslidePredict::startTiffToShp, mWorkObject, &WorkObject::runFormatConvert);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						connect(this, &LandslidePredict::start, mWorkObject, &WorkObject::runPredictWork);
 | 
				
			||||||
 | 
						mWorkThread->start();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::ReadConfigHistoryPaths(QString strPath)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QSettings configIni(strPath, QSettings::IniFormat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//<2F><EFBFBD><F2BFAAB1><EFBFBD>Ϊ<EFBFBD><CEAA>[SldPredict] <20><><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						configIni.beginGroup("SldPredict");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ui.lineInDataset->setText(configIni.value("SrcDom").toString());
 | 
				
			||||||
 | 
						ui.linePreResult->setText(configIni.value("PredictResult").toString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						configIni.endGroup();//<2F>ر<EFBFBD><D8B1><EFBFBD>
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::WriteConfigPaths(QString strPath)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QSettings configIni(strPath, QSettings::IniFormat);
 | 
				
			||||||
 | 
						configIni.setIniCodec("utf-8");
 | 
				
			||||||
 | 
						//<2F><EFBFBD><F2BFAAB1><EFBFBD>Ϊ<EFBFBD><CEAA>[SldPredict] <20><><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						configIni.beginGroup("SldPredict");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DOM·<4D><C2B7>
 | 
				
			||||||
 | 
						QString temp = ui.lineInDataset->text();
 | 
				
			||||||
 | 
						if (temp != "")
 | 
				
			||||||
 | 
							configIni.setValue("SrcDom", temp);
 | 
				
			||||||
 | 
						//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
 | 
				
			||||||
 | 
						temp = ui.linePreResult->text();
 | 
				
			||||||
 | 
						if (temp != "")
 | 
				
			||||||
 | 
							configIni.setValue("PredictResult", temp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						configIni.endGroup();//<2F>ر<EFBFBD><D8B1><EFBFBD>
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::openResultData(QStringList string_list)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (string_list.isEmpty())
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						QgsRasterLayer* rastLayer;
 | 
				
			||||||
 | 
						QgsVectorLayer* vecLayer;
 | 
				
			||||||
 | 
						for each (QString layerPath in string_list)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QFileInfo fileInfo(layerPath);
 | 
				
			||||||
 | 
							QString layerBaseName = fileInfo.baseName(); // ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
							if ("tif" == fileInfo.suffix() || "tiff" == fileInfo.suffix())
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								rastLayer = new QgsRasterLayer(fileInfo.filePath(), layerPath, "gdal");
 | 
				
			||||||
 | 
								if (!rastLayer)
 | 
				
			||||||
 | 
									return;
 | 
				
			||||||
 | 
								QgsMapLayer* mapLayer = rastLayer;
 | 
				
			||||||
 | 
								QgsRectangle myRectangle;
 | 
				
			||||||
 | 
								rastLayer->setContrastEnhancement(QgsContrastEnhancement::StretchToMinimumMaximum
 | 
				
			||||||
 | 
									, QgsRasterMinMaxOrigin::StdDev, myRectangle);
 | 
				
			||||||
 | 
								QList<QgsMapLayer*> mapLayers;
 | 
				
			||||||
 | 
								mapLayers << mapLayer;
 | 
				
			||||||
 | 
								QgsProject::instance()->addMapLayers(mapLayers);
 | 
				
			||||||
 | 
								//zoomToSelectedLayer(mapLayer);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else if ("shp" == fileInfo.suffix())
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								vecLayer = new QgsVectorLayer(fileInfo.filePath(), layerPath);
 | 
				
			||||||
 | 
								if (!vecLayer)
 | 
				
			||||||
 | 
									return;
 | 
				
			||||||
 | 
								QgsMapLayer* mapLayer = vecLayer;
 | 
				
			||||||
 | 
								QList<QgsMapLayer*> mapLayers;
 | 
				
			||||||
 | 
								mapLayers << mapLayer;
 | 
				
			||||||
 | 
								QgsProject::instance()->addMapLayers(mapLayers);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::readAndStart()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QString dirModel = ui.lineInModel->text();
 | 
				
			||||||
 | 
						QString dirDataset = ui.lineInDataset->text();
 | 
				
			||||||
 | 
						QString dirPRE = ui.linePreResult->text();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ui.progressBar->setValue(0);
 | 
				
			||||||
 | 
						if (dirModel == "" || dirDataset == "" || dirPRE == "")
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QMessageBox mess(QMessageBox::NoIcon, QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>"));
 | 
				
			||||||
 | 
							mess.setWindowFlags(Qt::Drawer);
 | 
				
			||||||
 | 
							int result = mess.exec();
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if (mWorkThread == nullptr)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							qDebug() << "--startThread";
 | 
				
			||||||
 | 
							startWorkThread();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ui.label_progress->setText(QString::fromLocal8Bit("Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"));
 | 
				
			||||||
 | 
						emit start(dirModel, dirDataset, dirPRE);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::pbCancel()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						qDebug() << "--pbtCancel";
 | 
				
			||||||
 | 
						delete myWidget;//<2F><><EFBFBD><EFBFBD>&QDialog::destroyed
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::chooseInModel()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QString dirModel = QFileDialog::getOpenFileName(ui.pbtInModel, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), "", "*.pth");
 | 
				
			||||||
 | 
						if (dirModel != "")
 | 
				
			||||||
 | 
							ui.lineInModel->setText(dirModel);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::chooseInDataset()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QString dirInDataset = QFileDialog::getExistingDirectory(ui.pbtInDataset, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>"), "");
 | 
				
			||||||
 | 
						if (dirInDataset != "")
 | 
				
			||||||
 | 
							ui.lineInDataset->setText(dirInDataset);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void LandslidePredict::chooseResultPath()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QString dirPre = QFileDialog::getExistingDirectory(ui.pbtPreResult, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD>"), "");
 | 
				
			||||||
 | 
						if (dirPre != "")
 | 
				
			||||||
 | 
							ui.linePreResult->setText(dirPre);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תʸ<D7AA><CAB8>
 | 
				
			||||||
 | 
					void LandslidePredict::finished()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QMessageBox mess(QMessageBox::NoIcon,
 | 
				
			||||||
 | 
							QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
 | 
				
			||||||
 | 
							QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n") + ui.linePreResult->text(),
 | 
				
			||||||
 | 
							QMessageBox::Ok, NULL);
 | 
				
			||||||
 | 
						mess.setWindowFlags(Qt::Drawer);
 | 
				
			||||||
 | 
						mess.setButtonText(QMessageBox::Ok, QString::fromLocal8Bit("ȷ<EFBFBD><EFBFBD>"));
 | 
				
			||||||
 | 
						int result = mess.exec();
 | 
				
			||||||
 | 
						switch (result)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
						case QMessageBox::Ok:
 | 
				
			||||||
 | 
							emit startTiffToShp(ui.linePreResult->text(), ui.lineInDataset->text());
 | 
				
			||||||
 | 
							ui.label_progress->setText(QString::fromLocal8Bit("תʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"));
 | 
				
			||||||
 | 
							ui.progressBar->setValue(0);
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void WorkObject::runPredictWork(QString inModel, QString inDataset, QString outPre)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QDir pluginsDir = QDir(qApp->applicationDirPath());
 | 
				
			||||||
 | 
						if (!pluginsDir.cd("models\\envs"))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							qDebug() << "no folder models\\envs";
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						QString exeDirName = pluginsDir.absoluteFilePath("predict_3c_landslide.exe");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QString strModel = " --model_path " + inModel;
 | 
				
			||||||
 | 
						QString strData = " --dom_path " + inDataset + "/";
 | 
				
			||||||
 | 
						QString strPre = " --pre_path " + outPre + "/";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QString ss = exeDirName + strModel + strData + strPre;
 | 
				
			||||||
 | 
						qDebug() << ss;
 | 
				
			||||||
 | 
						QProcess* pProces = new QProcess(this);
 | 
				
			||||||
 | 
						connect(pProces, SIGNAL(readyReadStandardOutput()), this, SLOT(on_read()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pProces->start(ss);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void WorkObject::on_read()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						mProcess = (QProcess*)sender();
 | 
				
			||||||
 | 
						QString output = QString::fromLocal8Bit(mProcess->readAllStandardOutput());
 | 
				
			||||||
 | 
						if (output.toFloat() > 0)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							qDebug() << "exe out:" << output.toFloat();
 | 
				
			||||||
 | 
							emit progress(output.toFloat());
 | 
				
			||||||
 | 
							if (output.toFloat() == 100)
 | 
				
			||||||
 | 
								emit preFinished();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							qDebug() << "Unresolved exe out:" << output;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void WorkObject::on_cancel()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (mProcess == nullptr)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							qDebug() << "--mProces  null";
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QString KillStr = "taskkill /f /im predict_3c_landslide.exe";
 | 
				
			||||||
 | 
							mProcess->startDetached(KillStr);
 | 
				
			||||||
 | 
							qDebug() << "--kill Proces";
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void WorkObject::runFormatConvert(QString pre, QString dataset)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QDir dir(pre);
 | 
				
			||||||
 | 
						QStringList nameFilters;
 | 
				
			||||||
 | 
						nameFilters << "*.tif" << "*.tiff";
 | 
				
			||||||
 | 
						QStringList pre_tiff_files = dir.entryList(nameFilters, QDir::Files | QDir::Readable, QDir::Name);
 | 
				
			||||||
 | 
						int list_len = pre_tiff_files.size();
 | 
				
			||||||
 | 
						for (int i = 0; i < list_len; i++)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							emit progress(float(i) / float(list_len) * 95);
 | 
				
			||||||
 | 
							qDebug() << "TiffToShp progress:" << float(i) / float(list_len) * 100;
 | 
				
			||||||
 | 
							QString file_path = pre + "\\" + pre_tiff_files[i];
 | 
				
			||||||
 | 
							QString dsm_path = dataset + "\\" + pre_tiff_files[i];
 | 
				
			||||||
 | 
							string path_preTiff = file_path.toStdString();
 | 
				
			||||||
 | 
							string pathPureName = path_preTiff.substr(0, path_preTiff.rfind("."));
 | 
				
			||||||
 | 
							string shp_path = pathPureName + ".shp";
 | 
				
			||||||
 | 
							//<2F><><EFBFBD><EFBFBD>դ<EFBFBD><D5A4>תʸ<D7AA><CAB8>
 | 
				
			||||||
 | 
							img2shp cc;
 | 
				
			||||||
 | 
							QtGDALProcessBar* gb = new QtGDALProcessBar();
 | 
				
			||||||
 | 
							bool returnval = cc.ImagePolygonize(path_preTiff.c_str(), shp_path.c_str(), "ESRI Shapefile", 1, gb, gb);
 | 
				
			||||||
 | 
							if (returnval == true)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								QStringList list;
 | 
				
			||||||
 | 
								list << dsm_path << QString::fromStdString(shp_path);
 | 
				
			||||||
 | 
								emit addShpDataToMap(list);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								qDebug() << "ImagePolygonize fail";
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						emit progress(100);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										94
									
								
								LandslidePredict/LandslidePredict.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										94
									
								
								LandslidePredict/LandslidePredict.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,94 @@
 | 
				
			|||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <QtWidgets/QDialog>
 | 
				
			||||||
 | 
					#include "ui_LandslidePredict.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <QProcess>
 | 
				
			||||||
 | 
					#include <QThread>
 | 
				
			||||||
 | 
					#include <QFile>
 | 
				
			||||||
 | 
					#include <QIcon>
 | 
				
			||||||
 | 
					#include <QDebug>
 | 
				
			||||||
 | 
					#include <QMessageBox>
 | 
				
			||||||
 | 
					#include <QFileDialog>
 | 
				
			||||||
 | 
					#include <QStringList>
 | 
				
			||||||
 | 
					#include <QIntValidator>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "SrsMainPluginInterFace.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <string>
 | 
				
			||||||
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "im2shp.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class WorkObject :public QObject
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						Q_OBJECT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public slots:
 | 
				
			||||||
 | 
						void runPredictWork(QString inModel, QString inDataset, QString outPre);
 | 
				
			||||||
 | 
						void on_read();
 | 
				
			||||||
 | 
						void on_cancel();
 | 
				
			||||||
 | 
						void runFormatConvert(QString pre, QString dataset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					signals:
 | 
				
			||||||
 | 
						void progress(int value);
 | 
				
			||||||
 | 
						void preFinished();
 | 
				
			||||||
 | 
						void addShpDataToMap(QStringList list);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
						QProcess* mProcess = nullptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class LandslidePredict : public SrsMainInterface
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    Q_OBJECT
 | 
				
			||||||
 | 
					        Q_INTERFACES(SrsMainInterface)
 | 
				
			||||||
 | 
					        Q_PLUGIN_METADATA(IID MainInterface_iid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
					    LandslidePredict();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						virtual QString PannelName() override;
 | 
				
			||||||
 | 
						virtual QString CategoryName() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						virtual QString EnglishName() override;
 | 
				
			||||||
 | 
						virtual QString ChineseName() override;
 | 
				
			||||||
 | 
						virtual QString Information() override;
 | 
				
			||||||
 | 
						virtual QString IconPath() override;
 | 
				
			||||||
 | 
						virtual QWidget* CenterWidget() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void startWorkThread();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//<2F><>json<6F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ʷ<EFBFBD>洢<EFBFBD><E6B4A2>·<EFBFBD><C2B7>
 | 
				
			||||||
 | 
						void ReadConfigHistoryPaths(QString strPath);
 | 
				
			||||||
 | 
						//<2F><><EFBFBD>汾<EFBFBD>δ<CEB4>·<EFBFBD><C2B7><EFBFBD><EFBFBD>json<6F>ļ<EFBFBD>
 | 
				
			||||||
 | 
						void WriteConfigPaths(QString strPath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void openResultData(QStringList string_list);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public slots:
 | 
				
			||||||
 | 
						void readAndStart();
 | 
				
			||||||
 | 
						void pbCancel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void chooseInModel();
 | 
				
			||||||
 | 
						void chooseInDataset();
 | 
				
			||||||
 | 
						void chooseResultPath();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void finished();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					signals:
 | 
				
			||||||
 | 
						void start(QString inModel, QString inDataset, QString outPre);
 | 
				
			||||||
 | 
						void startTiffToShp(QString pre, QString dataset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
					    Ui::LandslidePredictClass ui;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QDialog* myWidget = nullptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QThread* mWorkThread = nullptr;
 | 
				
			||||||
 | 
						WorkObject* mWorkObject = nullptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										6
									
								
								LandslidePredict/LandslidePredict.qrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								LandslidePredict/LandslidePredict.qrc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					<RCC>
 | 
				
			||||||
 | 
					    <qresource prefix="/LandslidePredict">
 | 
				
			||||||
 | 
					        <file>resources/landslide.svg</file>
 | 
				
			||||||
 | 
					        <file>LandslidePredict.qss</file>
 | 
				
			||||||
 | 
					    </qresource>
 | 
				
			||||||
 | 
					</RCC>
 | 
				
			||||||
							
								
								
									
										68
									
								
								LandslidePredict/LandslidePredict.qss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								LandslidePredict/LandslidePredict.qss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,68 @@
 | 
				
			|||||||
 | 
					QProgressBar#progressBar {
 | 
				
			||||||
 | 
						border:0px solid white;
 | 
				
			||||||
 | 
						text-align:center;
 | 
				
			||||||
 | 
						color:black;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					QProgressBar#progressBar:chunk {
 | 
				
			||||||
 | 
						background-color:#3FABBA;
 | 
				
			||||||
 | 
						width:20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					QProgressBar#progressBar QLineEdit {
 | 
				
			||||||
 | 
						border:none;
 | 
				
			||||||
 | 
						color:black;
 | 
				
			||||||
 | 
						padding-left:5px;
 | 
				
			||||||
 | 
						font-size:16px;
 | 
				
			||||||
 | 
						background-color:transparent;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QLabel{
 | 
				
			||||||
 | 
						color:black;
 | 
				
			||||||
 | 
						font-family:'Microsoft YaHei';
 | 
				
			||||||
 | 
						font-size:12px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*----QPushButton<6F><6E>ʽ<EFBFBD><CABD>*/
 | 
				
			||||||
 | 
					#pushButton_ok, #pushButton_cancel, #pbtInModel, #pbtInDataset , #pbtPreResult{
 | 
				
			||||||
 | 
						font-family:'Microsoft YaHei';
 | 
				
			||||||
 | 
						font-size:12px;
 | 
				
			||||||
 | 
						background-color: #ffffff;
 | 
				
			||||||
 | 
						border: 1px solid #dcdfe6;
 | 
				
			||||||
 | 
						padding: 2px;
 | 
				
			||||||
 | 
						border-radius: 5px;
 | 
				
			||||||
 | 
						max-height:20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#pushButton_ok, #pushButton_cancel{
 | 
				
			||||||
 | 
						min-width:36px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#pushButton_ok:hover, #pushButton_cancel:hover, #pbtInModel:hover, #pbtInDataset:hover,#pbtPreResult:hover{
 | 
				
			||||||
 | 
						background-color: #ecf5ff;
 | 
				
			||||||
 | 
						color: #409eff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#pushButton_ok:pressed, #pushButton_cancel:pressed, #pbtInModel:pressed, #pbtInDataset:pressed,#pbtPreResult:pressed{
 | 
				
			||||||
 | 
						border: 1px solid #3a8ee6;
 | 
				
			||||||
 | 
						color: #409eff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#pushButton_ok:checked, #pushButton_cancel:checked, #pbtInModel:checked, #pbtInDataset:checked,#pbtPreResult:checked{
 | 
				
			||||||
 | 
						border: 1px solid #3a8ee6;
 | 
				
			||||||
 | 
						color: #409eff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#pushButton_ok:focus, #pushButton_cancel:focus, #pbtInModel:focus, #pbtInDataset:focus,#pbtPreResult:focus{
 | 
				
			||||||
 | 
						border: 1px solid #3a8ee6;
 | 
				
			||||||
 | 
						color: #409eff;
 | 
				
			||||||
 | 
						outline: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*----QLineEdit<69><74>ʽ*/
 | 
				
			||||||
 | 
					#lineInModel, #lineInDataset, #linePreResult{
 | 
				
			||||||
 | 
						border:0px;
 | 
				
			||||||
 | 
						border-bottom: 1px solid #B3B3B3;
 | 
				
			||||||
 | 
						font-family:'Microsoft YaHei';
 | 
				
			||||||
 | 
						font-size:12px;
 | 
				
			||||||
 | 
						background-color:transparent;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#lineInModel:hover, #lineInDataset:hover, #linePreResult:hover{
 | 
				
			||||||
 | 
						border-bottom: 2px solid #66A3FF;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#lineInModel:focus, #lineInDataset:focus, #linePreResult:focus{
 | 
				
			||||||
 | 
						border-bottom: 2px solid #7666FF;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										216
									
								
								LandslidePredict/LandslidePredict.ui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										216
									
								
								LandslidePredict/LandslidePredict.ui
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,216 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<ui version="4.0">
 | 
				
			||||||
 | 
					 <class>LandslidePredictClass</class>
 | 
				
			||||||
 | 
					 <widget class="QDialog" name="LandslidePredictClass">
 | 
				
			||||||
 | 
					  <property name="geometry">
 | 
				
			||||||
 | 
					   <rect>
 | 
				
			||||||
 | 
					    <x>0</x>
 | 
				
			||||||
 | 
					    <y>0</y>
 | 
				
			||||||
 | 
					    <width>460</width>
 | 
				
			||||||
 | 
					    <height>270</height>
 | 
				
			||||||
 | 
					   </rect>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
 | 
					  <property name="minimumSize">
 | 
				
			||||||
 | 
					   <size>
 | 
				
			||||||
 | 
					    <width>460</width>
 | 
				
			||||||
 | 
					    <height>270</height>
 | 
				
			||||||
 | 
					   </size>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
 | 
					  <property name="maximumSize">
 | 
				
			||||||
 | 
					   <size>
 | 
				
			||||||
 | 
					    <width>460</width>
 | 
				
			||||||
 | 
					    <height>270</height>
 | 
				
			||||||
 | 
					   </size>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
 | 
					  <property name="windowTitle">
 | 
				
			||||||
 | 
					   <string>LandslidePredict</string>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
 | 
					  <layout class="QGridLayout" name="gridLayout_2">
 | 
				
			||||||
 | 
					   <item row="2" column="1">
 | 
				
			||||||
 | 
					    <widget class="QProgressBar" name="progressBar">
 | 
				
			||||||
 | 
					     <property name="value">
 | 
				
			||||||
 | 
					      <number>0</number>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					    </widget>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
 | 
					   <item row="2" column="0">
 | 
				
			||||||
 | 
					    <widget class="QLabel" name="label_progress">
 | 
				
			||||||
 | 
					     <property name="text">
 | 
				
			||||||
 | 
					      <string>进度:</string>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					    </widget>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
 | 
					   <item row="1" column="0" colspan="2">
 | 
				
			||||||
 | 
					    <layout class="QHBoxLayout" name="horizontalLayout">
 | 
				
			||||||
 | 
					     <item>
 | 
				
			||||||
 | 
					      <spacer name="horizontalSpacer_2">
 | 
				
			||||||
 | 
					       <property name="orientation">
 | 
				
			||||||
 | 
					        <enum>Qt::Horizontal</enum>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="sizeHint" stdset="0">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>40</width>
 | 
				
			||||||
 | 
					         <height>20</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </spacer>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item>
 | 
				
			||||||
 | 
					      <widget class="QPushButton" name="pushButton_ok">
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>确认</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item>
 | 
				
			||||||
 | 
					      <spacer name="horizontalSpacer">
 | 
				
			||||||
 | 
					       <property name="orientation">
 | 
				
			||||||
 | 
					        <enum>Qt::Horizontal</enum>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="sizeType">
 | 
				
			||||||
 | 
					        <enum>QSizePolicy::Fixed</enum>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="sizeHint" stdset="0">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>10</width>
 | 
				
			||||||
 | 
					         <height>20</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </spacer>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item>
 | 
				
			||||||
 | 
					      <widget class="QPushButton" name="pushButton_cancel">
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>取消</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					    </layout>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
 | 
					   <item row="0" column="0" colspan="2">
 | 
				
			||||||
 | 
					    <layout class="QGridLayout" name="gridLayout">
 | 
				
			||||||
 | 
					     <item row="0" column="0">
 | 
				
			||||||
 | 
					      <widget class="QLabel" name="label">
 | 
				
			||||||
 | 
					       <property name="sizePolicy">
 | 
				
			||||||
 | 
					        <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
 | 
				
			||||||
 | 
					         <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					         <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					        </sizepolicy>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>输入模型文件路径</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="0" column="1">
 | 
				
			||||||
 | 
					      <widget class="QLineEdit" name="lineInModel"/>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="0" column="2">
 | 
				
			||||||
 | 
					      <widget class="QPushButton" name="pbtInModel">
 | 
				
			||||||
 | 
					       <property name="minimumSize">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>75</width>
 | 
				
			||||||
 | 
					         <height>0</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="maximumSize">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>75</width>
 | 
				
			||||||
 | 
					         <height>16777215</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>打开文件</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="1" column="0">
 | 
				
			||||||
 | 
					      <widget class="QLabel" name="label_2">
 | 
				
			||||||
 | 
					       <property name="sizePolicy">
 | 
				
			||||||
 | 
					        <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
 | 
				
			||||||
 | 
					         <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					         <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					        </sizepolicy>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>输入预测数据路径</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="1" column="1">
 | 
				
			||||||
 | 
					      <widget class="QLineEdit" name="lineInDataset"/>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="1" column="2">
 | 
				
			||||||
 | 
					      <widget class="QPushButton" name="pbtInDataset">
 | 
				
			||||||
 | 
					       <property name="minimumSize">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>75</width>
 | 
				
			||||||
 | 
					         <height>0</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="maximumSize">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>75</width>
 | 
				
			||||||
 | 
					         <height>16777215</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>打开文件夹</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="2" column="0">
 | 
				
			||||||
 | 
					      <widget class="QLabel" name="label_3">
 | 
				
			||||||
 | 
					       <property name="sizePolicy">
 | 
				
			||||||
 | 
					        <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
 | 
				
			||||||
 | 
					         <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					         <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					        </sizepolicy>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>预测结果文件路径</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="2" column="1">
 | 
				
			||||||
 | 
					      <widget class="QLineEdit" name="linePreResult"/>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="2" column="2">
 | 
				
			||||||
 | 
					      <widget class="QPushButton" name="pbtPreResult">
 | 
				
			||||||
 | 
					       <property name="minimumSize">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>75</width>
 | 
				
			||||||
 | 
					         <height>0</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="maximumSize">
 | 
				
			||||||
 | 
					        <size>
 | 
				
			||||||
 | 
					         <width>75</width>
 | 
				
			||||||
 | 
					         <height>16777215</height>
 | 
				
			||||||
 | 
					        </size>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>打开文件夹</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					    </layout>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
 | 
					  </layout>
 | 
				
			||||||
 | 
					 </widget>
 | 
				
			||||||
 | 
					 <layoutdefault spacing="6" margin="11"/>
 | 
				
			||||||
 | 
					 <tabstops>
 | 
				
			||||||
 | 
					  <tabstop>lineInModel</tabstop>
 | 
				
			||||||
 | 
					  <tabstop>pbtInModel</tabstop>
 | 
				
			||||||
 | 
					  <tabstop>lineInDataset</tabstop>
 | 
				
			||||||
 | 
					  <tabstop>pbtInDataset</tabstop>
 | 
				
			||||||
 | 
					  <tabstop>linePreResult</tabstop>
 | 
				
			||||||
 | 
					  <tabstop>pbtPreResult</tabstop>
 | 
				
			||||||
 | 
					  <tabstop>pushButton_ok</tabstop>
 | 
				
			||||||
 | 
					  <tabstop>pushButton_cancel</tabstop>
 | 
				
			||||||
 | 
					 </tabstops>
 | 
				
			||||||
 | 
					 <resources>
 | 
				
			||||||
 | 
					  <include location="LandslidePredict.qrc"/>
 | 
				
			||||||
 | 
					 </resources>
 | 
				
			||||||
 | 
					 <connections/>
 | 
				
			||||||
 | 
					</ui>
 | 
				
			||||||
							
								
								
									
										89
									
								
								LandslidePredict/LandslidePredict.vcxproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								LandslidePredict/LandslidePredict.vcxproj
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,89 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
 | 
					<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
				
			||||||
 | 
					  <ItemGroup Label="ProjectConfigurations">
 | 
				
			||||||
 | 
					    <ProjectConfiguration Include="Release|x64">
 | 
				
			||||||
 | 
					      <Configuration>Release</Configuration>
 | 
				
			||||||
 | 
					      <Platform>x64</Platform>
 | 
				
			||||||
 | 
					    </ProjectConfiguration>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <PropertyGroup Label="Globals">
 | 
				
			||||||
 | 
					    <ProjectGuid>{ABE55CAB-C9A0-4D11-AF67-DEFEF07F3DA5}</ProjectGuid>
 | 
				
			||||||
 | 
					    <Keyword>QtVS_v304</Keyword>
 | 
				
			||||||
 | 
					    <WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
 | 
				
			||||||
 | 
					    <QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 | 
				
			||||||
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
 | 
				
			||||||
 | 
					    <ConfigurationType>DynamicLibrary</ConfigurationType>
 | 
				
			||||||
 | 
					    <PlatformToolset>v142</PlatformToolset>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 | 
				
			||||||
 | 
					  <ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
 | 
				
			||||||
 | 
					    <Import Project="$(QtMsBuild)\qt_defaults.props" />
 | 
				
			||||||
 | 
					  </ImportGroup>
 | 
				
			||||||
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
 | 
				
			||||||
 | 
					    <QtInstall>QtQgis</QtInstall>
 | 
				
			||||||
 | 
					    <QtModules>core;gui;widgets</QtModules>
 | 
				
			||||||
 | 
					    <QtBuildConfig>release</QtBuildConfig>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
 | 
				
			||||||
 | 
					    <Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
 | 
				
			||||||
 | 
					  </Target>
 | 
				
			||||||
 | 
					  <ImportGroup Label="ExtensionSettings" />
 | 
				
			||||||
 | 
					  <ImportGroup Label="Shared" />
 | 
				
			||||||
 | 
					  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
 | 
				
			||||||
 | 
					    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
				
			||||||
 | 
					    <Import Project="$(QtMsBuild)\Qt.props" />
 | 
				
			||||||
 | 
					  </ImportGroup>
 | 
				
			||||||
 | 
					  <PropertyGroup Label="UserMacros" />
 | 
				
			||||||
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
 | 
				
			||||||
 | 
					    <IncludePath>D:\qgis\osgeo4w\include;D:\qgis\osgeo4w\apps\qgis_build_sdk\include;D:\qgis\osgeo4w\apps\Qt5\include;D:\qgis\osgeo4w\apps\Qt5\include\QtXml;$(IncludePath)</IncludePath>
 | 
				
			||||||
 | 
					    <LibraryPath>D:\qgis\osgeo4w\lib;D:\qgis\osgeo4w\apps\qgis_build_sdk\lib;D:\qgis\osgeo4w\apps\Qt5\lib;$(LibraryPath)</LibraryPath>
 | 
				
			||||||
 | 
					    <TargetName>landslide3_pre</TargetName>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 | 
				
			||||||
 | 
					    <Link>
 | 
				
			||||||
 | 
					      <AdditionalDependencies>gdal_i.lib;qgis_gui.lib;qgis_analysis.lib;qgis_core.lib;qgis_native.lib;%(AdditionalDependencies)</AdditionalDependencies>
 | 
				
			||||||
 | 
					    </Link>
 | 
				
			||||||
 | 
					  </ItemDefinitionGroup>
 | 
				
			||||||
 | 
					  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
 | 
				
			||||||
 | 
					    <ClCompile>
 | 
				
			||||||
 | 
					      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
 | 
				
			||||||
 | 
					      <MultiProcessorCompilation>true</MultiProcessorCompilation>
 | 
				
			||||||
 | 
					      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
 | 
				
			||||||
 | 
					      <Optimization>Disabled</Optimization>
 | 
				
			||||||
 | 
					      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
 | 
				
			||||||
 | 
					    </ClCompile>
 | 
				
			||||||
 | 
					    <Link>
 | 
				
			||||||
 | 
					      <SubSystem>Console</SubSystem>
 | 
				
			||||||
 | 
					      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
				
			||||||
 | 
					    </Link>
 | 
				
			||||||
 | 
					  </ItemDefinitionGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <ClCompile Include="QtGDALProcessBar.cpp" />
 | 
				
			||||||
 | 
					    <QtRcc Include="LandslidePredict.qrc" />
 | 
				
			||||||
 | 
					    <QtUic Include="LandslidePredict.ui" />
 | 
				
			||||||
 | 
					    <QtMoc Include="LandslidePredict.h" />
 | 
				
			||||||
 | 
					    <ClCompile Include="im2shp.cpp" />
 | 
				
			||||||
 | 
					    <ClCompile Include="LandslidePredict.cpp" />
 | 
				
			||||||
 | 
					    <ClCompile Include="main.cpp" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <QtMoc Include="SrsMainPluginInterFace.h" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <ClInclude Include="CProcessBase.h" />
 | 
				
			||||||
 | 
					    <ClInclude Include="im2shp.h" />
 | 
				
			||||||
 | 
					    <QtMoc Include="QtGDALProcessBar.h" />
 | 
				
			||||||
 | 
					    <ClInclude Include="x64\Release\uic\ui_LandslidePredict.h" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <None Include="LandslidePredict.qss" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
 | 
				
			||||||
 | 
					  <ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
 | 
				
			||||||
 | 
					    <Import Project="$(QtMsBuild)\qt.targets" />
 | 
				
			||||||
 | 
					  </ImportGroup>
 | 
				
			||||||
 | 
					  <ImportGroup Label="ExtensionTargets">
 | 
				
			||||||
 | 
					  </ImportGroup>
 | 
				
			||||||
 | 
					</Project>
 | 
				
			||||||
							
								
								
									
										74
									
								
								LandslidePredict/LandslidePredict.vcxproj.filters
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								LandslidePredict/LandslidePredict.vcxproj.filters
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
 | 
					<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <Filter Include="Source Files">
 | 
				
			||||||
 | 
					      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
 | 
				
			||||||
 | 
					      <Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
 | 
				
			||||||
 | 
					    </Filter>
 | 
				
			||||||
 | 
					    <Filter Include="Header Files">
 | 
				
			||||||
 | 
					      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
 | 
				
			||||||
 | 
					      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
 | 
				
			||||||
 | 
					    </Filter>
 | 
				
			||||||
 | 
					    <Filter Include="Resource Files">
 | 
				
			||||||
 | 
					      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
 | 
				
			||||||
 | 
					      <Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
 | 
				
			||||||
 | 
					    </Filter>
 | 
				
			||||||
 | 
					    <Filter Include="Form Files">
 | 
				
			||||||
 | 
					      <UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
 | 
				
			||||||
 | 
					      <Extensions>ui</Extensions>
 | 
				
			||||||
 | 
					    </Filter>
 | 
				
			||||||
 | 
					    <Filter Include="Translation Files">
 | 
				
			||||||
 | 
					      <UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
 | 
				
			||||||
 | 
					      <Extensions>ts</Extensions>
 | 
				
			||||||
 | 
					    </Filter>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <QtRcc Include="LandslidePredict.qrc">
 | 
				
			||||||
 | 
					      <Filter>Resource Files</Filter>
 | 
				
			||||||
 | 
					    </QtRcc>
 | 
				
			||||||
 | 
					    <QtUic Include="LandslidePredict.ui">
 | 
				
			||||||
 | 
					      <Filter>Form Files</Filter>
 | 
				
			||||||
 | 
					    </QtUic>
 | 
				
			||||||
 | 
					    <QtMoc Include="LandslidePredict.h">
 | 
				
			||||||
 | 
					      <Filter>Header Files</Filter>
 | 
				
			||||||
 | 
					    </QtMoc>
 | 
				
			||||||
 | 
					    <ClCompile Include="LandslidePredict.cpp">
 | 
				
			||||||
 | 
					      <Filter>Source Files</Filter>
 | 
				
			||||||
 | 
					    </ClCompile>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <ClCompile Include="main.cpp">
 | 
				
			||||||
 | 
					      <Filter>Source Files</Filter>
 | 
				
			||||||
 | 
					    </ClCompile>
 | 
				
			||||||
 | 
					    <ClCompile Include="im2shp.cpp">
 | 
				
			||||||
 | 
					      <Filter>Source Files</Filter>
 | 
				
			||||||
 | 
					    </ClCompile>
 | 
				
			||||||
 | 
					    <ClCompile Include="QtGDALProcessBar.cpp">
 | 
				
			||||||
 | 
					      <Filter>Source Files</Filter>
 | 
				
			||||||
 | 
					    </ClCompile>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <QtMoc Include="SrsMainPluginInterFace.h">
 | 
				
			||||||
 | 
					      <Filter>Header Files</Filter>
 | 
				
			||||||
 | 
					    </QtMoc>
 | 
				
			||||||
 | 
					    <QtMoc Include="QtGDALProcessBar.h">
 | 
				
			||||||
 | 
					      <Filter>Header Files</Filter>
 | 
				
			||||||
 | 
					    </QtMoc>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <ClInclude Include="x64\Release\uic\ui_LandslidePredict.h">
 | 
				
			||||||
 | 
					      <Filter>Form Files</Filter>
 | 
				
			||||||
 | 
					    </ClInclude>
 | 
				
			||||||
 | 
					    <ClInclude Include="CProcessBase.h">
 | 
				
			||||||
 | 
					      <Filter>Header Files</Filter>
 | 
				
			||||||
 | 
					    </ClInclude>
 | 
				
			||||||
 | 
					    <ClInclude Include="im2shp.h">
 | 
				
			||||||
 | 
					      <Filter>Header Files</Filter>
 | 
				
			||||||
 | 
					    </ClInclude>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <None Include="LandslidePredict.qss">
 | 
				
			||||||
 | 
					      <Filter>Resource Files</Filter>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					</Project>
 | 
				
			||||||
							
								
								
									
										100
									
								
								LandslidePredict/QtGDALProcessBar.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								LandslidePredict/QtGDALProcessBar.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,100 @@
 | 
				
			|||||||
 | 
					#include "QtGDALProcessBar.h"
 | 
				
			||||||
 | 
					#include <QCoreApplication>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QtGDALProcessBar::QtGDALProcessBar(QWidget *parent)
 | 
				
			||||||
 | 
						: QProgressBar(parent)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						//ui.setupUi(this);
 | 
				
			||||||
 | 
						this->setTextVisible(true);
 | 
				
			||||||
 | 
						m_dPosition = 0.0;
 | 
				
			||||||
 | 
						m_iStepCount = 100;
 | 
				
			||||||
 | 
						m_iCurStep = 0;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QtGDALProcessBar::~QtGDALProcessBar()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					* @brief <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
					* @param pszMsg			<09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					void QtGDALProcessBar::SetMessage(const char* pszMsg)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (pszMsg != NULL)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							m_strMessage = pszMsg;
 | 
				
			||||||
 | 
							//setLabelText(QString(pszMsg));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					* @brief <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>ֵ
 | 
				
			||||||
 | 
					* @param dPosition		<09><><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					bool QtGDALProcessBar::SetPosition(double dPosition)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						m_dPosition = dPosition;
 | 
				
			||||||
 | 
						//cout << "m_dPosition   " << m_dPosition << endl;
 | 
				
			||||||
 | 
						//current_value = value();
 | 
				
			||||||
 | 
						int temp_value = int(m_start_value +std::min(100u, (uint)(m_dPosition * 100.0 )) * m_scale);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						setValue(temp_value);
 | 
				
			||||||
 | 
						//setFormat(tr("%1%").arg(temp_value));
 | 
				
			||||||
 | 
						//cout << "StepIt   " << temp_value << "\t" << "current_value" << int(m_start_value + temp_value * m_scale) << endl;
 | 
				
			||||||
 | 
						//QCoreApplication::instance()->processEvents();
 | 
				
			||||||
 | 
						//this->update();
 | 
				
			||||||
 | 
						//if (this->wasCanceled())
 | 
				
			||||||
 | 
						//	return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return true;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool QtGDALProcessBar::SetStartEndValue(int i_start_value, int i_end_value)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (i_end_value< i_start_value )
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							m_start_value = i_start_value;
 | 
				
			||||||
 | 
							m_end_value = i_end_value;
 | 
				
			||||||
 | 
							m_scale = (m_end_value - m_start_value) / 100.0;
 | 
				
			||||||
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>һ<EFBFBD><D2BB>,<2C><><EFBFBD><EFBFBD>false<73><65>ʾ<EFBFBD><CABE>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					bool QtGDALProcessBar::StepIt()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						m_iCurStep++;
 | 
				
			||||||
 | 
						m_dPosition = m_iCurStep * 1.0 / m_iStepCount;
 | 
				
			||||||
 | 
						//current_value = value();
 | 
				
			||||||
 | 
						int temp_value = std::min(100u, (uint)(m_dPosition * 100.0));
 | 
				
			||||||
 | 
						setValue(int(m_start_value + temp_value * m_scale));
 | 
				
			||||||
 | 
						//setFormat(QString("<22><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>%1%").arg(temp_value));
 | 
				
			||||||
 | 
						//cout << "StepIt   " << temp_value <<"\t"<<"current_value"<< current_value << endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//QCoreApplication::instance()->processEvents();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//if (this->wasCanceled())
 | 
				
			||||||
 | 
						//	return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return true;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void QtGDALProcessBar::updateProgress(int step)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						this->setValue(step);
 | 
				
			||||||
 | 
						//this->update();
 | 
				
			||||||
 | 
						//cout << "updateProgress   " << step << endl;
 | 
				
			||||||
 | 
						//QCoreApplication::instance()->processEvents();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										62
									
								
								LandslidePredict/QtGDALProcessBar.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								LandslidePredict/QtGDALProcessBar.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <QProgressBar>
 | 
				
			||||||
 | 
					#include "CProcessBase.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class QtGDALProcessBar : public QProgressBar,public CProcessBase
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						Q_OBJECT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
						QtGDALProcessBar(QWidget *parent = Q_NULLPTR);
 | 
				
			||||||
 | 
						~QtGDALProcessBar();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
							* @brief <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
							* @param pszMsg			<09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
						void SetMessage(const char* pszMsg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						* @param dPosition		<09><><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						bool SetPosition(double dPosition);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						/// <param name="i_start_value"></param>
 | 
				
			||||||
 | 
						/// <returns></returns>
 | 
				
			||||||
 | 
						bool SetStartEndValue(int i_start_value,int i_end_value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>һ<EFBFBD><D2BB>
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						bool StepIt();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						int current_value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public slots:
 | 
				
			||||||
 | 
						void updateProgress(int);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼֵ
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						int m_start_value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						int m_end_value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						float m_scale;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										58
									
								
								LandslidePredict/SrsMainPluginInterFace.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								LandslidePredict/SrsMainPluginInterFace.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
				
			|||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					//#if _MSC_VER >=1600  // MSVC2015>1899, msvc_ver=14.0
 | 
				
			||||||
 | 
					//#pragma execution_character_set("utf-8")
 | 
				
			||||||
 | 
					//#endif
 | 
				
			||||||
 | 
					//#include "qtclasslibrary1_global.h"
 | 
				
			||||||
 | 
					#include <qstring.h>
 | 
				
			||||||
 | 
					#include <QtPlugin>
 | 
				
			||||||
 | 
					#include <QVector>
 | 
				
			||||||
 | 
					#include <QObject>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct SPluginMetaData
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						QVector<QString> qvsReturnFilePaths;
 | 
				
			||||||
 | 
						QVector<QString> qvsSendFilePaths;
 | 
				
			||||||
 | 
						bool isAdd2Map;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					class  SrsMainInterface : public QObject
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						Q_OBJECT
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
						virtual ~SrsMainInterface() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><><EFBFBD><EFBFBD>pannel<65><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						virtual QString PannelName() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><><EFBFBD><EFBFBD>Category<72><79><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						/// <returns></returns>
 | 
				
			||||||
 | 
						virtual QString CategoryName() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						/// <returns></returns>
 | 
				
			||||||
 | 
						virtual QString EnglishName() = 0;
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// <20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						/// <returns></returns>
 | 
				
			||||||
 | 
						virtual QString ChineseName() = 0;
 | 
				
			||||||
 | 
						virtual QString Information() = 0;
 | 
				
			||||||
 | 
						virtual QString IconPath() = 0;
 | 
				
			||||||
 | 
						virtual QWidget* CenterWidget() = 0;
 | 
				
			||||||
 | 
						//
 | 
				
			||||||
 | 
						//public slots:
 | 
				
			||||||
 | 
						//	virtual void test(QWidget* parent) = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					signals:
 | 
				
			||||||
 | 
						void AddDataToMap(QStringList string_list);
 | 
				
			||||||
 | 
						//void addDataToCanvas(QStringList string_list);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MainInterface_iid "com.Srs.MainInterface"
 | 
				
			||||||
 | 
					Q_DECLARE_INTERFACE(SrsMainInterface, MainInterface_iid)
 | 
				
			||||||
							
								
								
									
										154
									
								
								LandslidePredict/im2shp.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										154
									
								
								LandslidePredict/im2shp.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,154 @@
 | 
				
			|||||||
 | 
					#include "im2shp.h"
 | 
				
			||||||
 | 
					#include <ogrsf_frmts.h>
 | 
				
			||||||
 | 
					#include "CProcessBase.h"
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					* \brief <20><><EFBFBD><EFBFBD>GDAL<41><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* <20>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD>GDAL<41>㷨<EFBFBD>еĽ<D0B5><C4BD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CProcessBase<73><65><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* @param dfComplete	<09><><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>ȡֵΪ 0.0 <20><> 1.0 ֮<><D6AE>
 | 
				
			||||||
 | 
					* @param pszMessage	<09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
					* @param pProgressArg   CProcessBase<73><65>ָ<EFBFBD><D6B8>
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* @return <20><><EFBFBD><EFBFBD>TRUE<55><45>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣬<EFBFBD><E3A3AC><EFBFBD><EFBFBD>Ϊȡ<CEAA><C8A1>
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					int STD_API ALGTermProgress(double dfComplete, const char* pszMessage, void* pProgressArg)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (pProgressArg != NULL)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QtGDALProcessBar* pProcess = (QtGDALProcessBar*)pProgressArg;
 | 
				
			||||||
 | 
							pProcess->m_bIsContinue = pProcess->SetPosition(dfComplete);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (pProcess->m_bIsContinue)
 | 
				
			||||||
 | 
								return TRUE;
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return FALSE;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							return TRUE;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int img2shp::ImagePolygonize(const char* pszSrcFile, const char* pszDstFile, const char* pszFormat, int BandNum,
 | 
				
			||||||
 | 
						QtGDALProcessBar* probar, QProgressBar* progressBar)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (NULL == pszSrcFile || NULL == pszDstFile)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>");
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (GDALGetDriverCount() == 0)
 | 
				
			||||||
 | 
							GDALAllRegister();
 | 
				
			||||||
 | 
						OGRRegisterAll();
 | 
				
			||||||
 | 
						CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "NO");
 | 
				
			||||||
 | 
						CPLSetConfigOption("SHAPE_ENCODING", "gb2312");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><F1A3ACB2>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						GDALDataset* poSrcDS = (GDALDataset*)GDALOpen(pszSrcFile, GA_ReadOnly);
 | 
				
			||||||
 | 
						if (NULL == poSrcDS)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>");
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//<2F><><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>ͼ<EFBFBD><CDBC>
 | 
				
			||||||
 | 
						GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);
 | 
				
			||||||
 | 
						if (NULL == poDriver)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							printf("<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
 | 
				
			||||||
 | 
							GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
						*Create<74><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>դ<EFBFBD><D5A4><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>nXSize<7A><65>nYSize<7A><65>nBands<64><73><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD>դ<EFBFBD><D5A4><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>**<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>Ĭ<EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>**
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GDALDataset* poDstDs = poDriver->Create(pszDstFile, 0, 0, 0, GDT_Unknown, NULL);
 | 
				
			||||||
 | 
						if (NULL == poDstDs)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							printf("<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>");
 | 
				
			||||||
 | 
							GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						OGRSpatialReference* poSpatialRef = new OGRSpatialReference(poSrcDS->GetProjectionRef());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						OGRLayer* poLayer = poDstDs->CreateLayer("Target", poSpatialRef, wkbPolygon, NULL);
 | 
				
			||||||
 | 
						if (NULL == poLayer)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
 | 
				
			||||||
 | 
							GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
							GDALClose(poDstDs);
 | 
				
			||||||
 | 
							poSpatialRef = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						OGRFieldDefn ofieldDef("value", OFTInteger);
 | 
				
			||||||
 | 
						if (OGRERR_NONE != poLayer->CreateField(&ofieldDef))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
 | 
				
			||||||
 | 
							GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
							GDALClose(poDstDs);
 | 
				
			||||||
 | 
							poSpatialRef = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//<2F><>ȡͼ<C8A1><CDBC><EFBFBD>Ķ<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>
 | 
				
			||||||
 | 
						GDALRasterBandH hSrcBand = (GDALRasterBandH)poSrcDS->GetRasterBand(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GDALRasterBand* rasterband = poSrcDS->GetRasterBand(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GDALProgressFunc pfnProgress = ALGTermProgress;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!probar->SetStartEndValue(0, 100))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							cout << "<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << endl;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//if (GDALPolygonize(hSrcBand, NULL, (OGRLayerH)poLayer, 0, NULL, pfnProgress, probar) != CE_None)
 | 
				
			||||||
 | 
						//if (GDALPolygonize(hSrcBand, NULL, (OGRLayerH)poLayer, 0, NULL, GDALTermProgress, NULL) != CE_None)
 | 
				
			||||||
 | 
						//qDebug() << rasterband->GetNoDataValue() << endl;
 | 
				
			||||||
 | 
						//if (0.0 == poSrcDS->GetRasterBand(1)->GetNoDataValue())
 | 
				
			||||||
 | 
						//{
 | 
				
			||||||
 | 
						//	if (CE_None != GDALPolygonize(hSrcBand, hSrcBand, (OGRLayerH)poLayer, 0, NULL, pfnProgress, probar))
 | 
				
			||||||
 | 
						//	{
 | 
				
			||||||
 | 
						//		GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
						//		GDALClose(poDstDs);
 | 
				
			||||||
 | 
						//		delete poSpatialRef;
 | 
				
			||||||
 | 
						//		poSpatialRef = NULL;
 | 
				
			||||||
 | 
						//		return 0;
 | 
				
			||||||
 | 
						//	}
 | 
				
			||||||
 | 
						//}
 | 
				
			||||||
 | 
						//else
 | 
				
			||||||
 | 
						//{
 | 
				
			||||||
 | 
						//	if (CE_None != GDALPolygonize(hSrcBand, NULL, (OGRLayerH)poLayer, 0, NULL, pfnProgress, probar))
 | 
				
			||||||
 | 
						//	{
 | 
				
			||||||
 | 
						//		GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
						//		GDALClose(poDstDs);
 | 
				
			||||||
 | 
						//		delete poSpatialRef;
 | 
				
			||||||
 | 
						//		poSpatialRef = NULL;
 | 
				
			||||||
 | 
						//		return 0;
 | 
				
			||||||
 | 
						//	}
 | 
				
			||||||
 | 
						//}
 | 
				
			||||||
 | 
						if (CE_None != GDALPolygonize(hSrcBand, hSrcBand, (OGRLayerH)poLayer, 0, NULL, pfnProgress, probar))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
							GDALClose(poDstDs);
 | 
				
			||||||
 | 
							delete poSpatialRef;
 | 
				
			||||||
 | 
							poSpatialRef = NULL;
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GDALClose((GDALDatasetH)poSrcDS);
 | 
				
			||||||
 | 
						GDALClose(poDstDs);
 | 
				
			||||||
 | 
						poSpatialRef = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return true;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										35
									
								
								LandslidePredict/im2shp.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								LandslidePredict/im2shp.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					#include "gdal_priv.h"
 | 
				
			||||||
 | 
					#include "ogrsf_frmts.h" //for ogr
 | 
				
			||||||
 | 
					#include "gdal_alg.h"  //for GDALPolygonize
 | 
				
			||||||
 | 
					#include "cpl_conv.h" //for CPLMalloc() 
 | 
				
			||||||
 | 
					#include "QtGDALProcessBar.h"
 | 
				
			||||||
 | 
					#include <QDebug>
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					#ifndef STD_API
 | 
				
			||||||
 | 
					#define STD_API __stdcall
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					* \brief <20><><EFBFBD><EFBFBD>GDAL<41><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* <20>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD>GDAL<41>㷨<EFBFBD>еĽ<D0B5><C4BD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CProcessBase<73><65><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* @param dfComplete	<09><><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>ȡֵΪ 0.0 <20><> 1.0 ֮<><D6AE>
 | 
				
			||||||
 | 
					* @param pszMessage	<09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
 | 
				
			||||||
 | 
					* @param pProgressArg   CProcessBase<73><65>ָ<EFBFBD><D6B8>
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* @return <20><><EFBFBD><EFBFBD>TRUE<55><45>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣬<EFBFBD><E3A3AC><EFBFBD><EFBFBD>Ϊȡ<CEAA><C8A1>
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					int STD_API ALGTermProgress(double dfComplete, const char* pszMessage, void* pProgressArg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class img2shp
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
						int ImagePolygonize(const char* pszSrcFile, const char* pszDstFile, const char* pszFormat, int BandNum, QtGDALProcessBar* probar, QProgressBar* progressBar);
 | 
				
			||||||
 | 
						bool createChineseStringProperty(OGRLayer* poLayer, const char* filterFieldName, const char* createFieldName, vector<string> nameVal, float min, QProgressBar* progressBar);
 | 
				
			||||||
 | 
					protected:
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										10
									
								
								LandslidePredict/main.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								LandslidePredict/main.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					#include "LandslidePredict.h"
 | 
				
			||||||
 | 
					#include <QtWidgets/QApplication>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main(int argc, char *argv[])
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    QApplication a(argc, argv);
 | 
				
			||||||
 | 
					    LandslidePredict w;
 | 
				
			||||||
 | 
					    w.CenterWidget()->show();
 | 
				
			||||||
 | 
					    return a.exec();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										1
									
								
								LandslidePredict/resources/landslide.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								LandslidePredict/resources/landslide.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32" fill="none"><g opacity="1" transform="translate(0 0)  rotate(0 16 16)"><path id="路径 1 (轮廓)" fill-rule="evenodd" style="fill:#2C2C2C" transform="translate(0 1.5374328853267798)  rotate(0 15.99999999999979 14.46256711467357)" opacity="1" d="M17.11 8.78L19.6 20.62L29.27 24.69L32 28.93L0 28.93L0 14.53L6.07 1.45L6.29 0.99L14.08 0L17.11 8.78ZM7.53 2.69L1.84 14.94L1.84 27.08L28.62 27.08L28.03 26.16L17.99 21.94L15.33 9.27L12.82 2.02L7.53 2.69Z" /><path id="路径 2" fill-rule="evenodd" style="fill:#2C2C2C" transform="translate(18.9798339264529 9.916436213707748)  rotate(0 5.021363830056714 7.462944407974411)" opacity="1" d="M1.75,11.42L10.04,14.93L7.09,6.73L0.18,0L0,0.28L1.75,11.42Z " /><path id="路径 3" fill-rule="evenodd" style="fill:#2C2C2C" transform="translate(26.07423786983578 13.693975975768783)  rotate(0 1.4741618583652738 1.3820267422174524)" opacity="1" d="M0.53,0.2C0.46,0.17 0.37,0.19 0.32,0.26C0.27,0.32 0.27,0.41 0.31,0.47L1.66,2.53C1.7,2.59 1.75,2.62 1.82,2.62C1.88,2.62 1.93,2.59 1.97,2.54L2.82,1.3C2.85,1.25 2.86,1.19 2.84,1.14C2.82,1.09 2.78,1.04 2.73,1.02L0.53,0.2Z " /><path id="路径 4" fill-rule="evenodd" style="fill:#2C2C2C" transform="translate(21.28321183014864 9.640030865264256)  rotate(0 1.8427023229565922 1.5662969745131128)" opacity="1" d="M3.66,0.65C3.67,0.6 3.65,0.55 3.62,0.51C3.59,0.47 3.55,0.45 3.5,0.44L0.56,0.07C0.48,0.06 0.41,0.1 0.37,0.18C0.34,0.25 0.36,0.34 0.41,0.39L3.08,2.89C3.13,2.93 3.2,2.95 3.27,2.93C3.33,2.9 3.38,2.84 3.39,2.78L3.66,0.65Z " /></g></svg>
 | 
				
			||||||
| 
		 After Width: | Height: | Size: 1.6 KiB  | 
		Reference in New Issue
	
	Block a user