添加项目文件。
This commit is contained in:
		
							
								
								
									
										364
									
								
								DEM_Fill/DEM_Fill.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										364
									
								
								DEM_Fill/DEM_Fill.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,364 @@
 | 
			
		||||
#include "DEM_Fill.h"
 | 
			
		||||
 | 
			
		||||
#include <qgsrasterlayer.h>
 | 
			
		||||
#include <qgsvectorlayer.h>
 | 
			
		||||
#include <qgsmapcanvas.h>
 | 
			
		||||
 | 
			
		||||
void WorkThreadObject::runFillingWork(QString in_masked, QString out_filled, QString scale, QString size)
 | 
			
		||||
{
 | 
			
		||||
	QDir pyDir = QDir(qApp->applicationDirPath());
 | 
			
		||||
	if (!pyDir.cd("models\\mask_fill"))
 | 
			
		||||
	{
 | 
			
		||||
		qDebug() << "no folder models\\mask_fill";
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	QString pyFilePath = pyDir.absoluteFilePath("demFillHoles.py");
 | 
			
		||||
	if (pyFilePath == "")
 | 
			
		||||
	{
 | 
			
		||||
		qDebug() << "not find demFillHoles.py";
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	QDir datDir = QDir(qApp->applicationDirPath());
 | 
			
		||||
	if (!datDir.cd("QGIS_3.22.8\\bin"))
 | 
			
		||||
	{
 | 
			
		||||
		qDebug() << "no folder QGIS_3.22.8\\bin";
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	QString datPath = datDir.absoluteFilePath("python-qgis-ltr.bat");
 | 
			
		||||
	if (datPath == "")
 | 
			
		||||
	{
 | 
			
		||||
		qDebug() << "not find qgis env";
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	const char* cmd = (datPath + " " + pyFilePath + " --in_holedem " + in_masked + "/" + " --work_space " + out_filled + "/" +
 | 
			
		||||
		" --scale " + scale + " --win_size " + size).toStdString().c_str();
 | 
			
		||||
	cout << cmd << "\n";
 | 
			
		||||
	run_cmd(cmd);
 | 
			
		||||
	//QString cmd = datPath + " " + pyFilePath
 | 
			
		||||
	//	+ " --in_holedem " + in_masked + "/" + " --work_space " + out_filled + "/"
 | 
			
		||||
	//	+ " --scale " + scale + " --win_size " + size;
 | 
			
		||||
	//QProcess* pProces = new QProcess(this);
 | 
			
		||||
	//connect(pProces, SIGNAL(readyReadStandardOutput()), this, SLOT(readProcessStandardOutput()));
 | 
			
		||||
	//pProces->start(cmd);
 | 
			
		||||
	//emit process(2);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WorkThreadObject::readProcessStandardOutput()
 | 
			
		||||
{
 | 
			
		||||
	mProcess = (QProcess*)sender();
 | 
			
		||||
	QString output = QString::fromLocal8Bit(mProcess->readAllStandardOutput());
 | 
			
		||||
	output.chop(2);
 | 
			
		||||
	if (output.toFloat() != 0)
 | 
			
		||||
	{
 | 
			
		||||
		qDebug() << "process:" << output.toFloat();
 | 
			
		||||
		emit process(output.toFloat());
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		qDebug() << "unsolved exe out:" << output;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int WorkThreadObject::run_cmd(const char* cmd)
 | 
			
		||||
{
 | 
			
		||||
	char MsgBuff[1024];
 | 
			
		||||
	int MsgLen = 1020;
 | 
			
		||||
	FILE* fp;
 | 
			
		||||
	if (cmd == NULL)
 | 
			
		||||
		return -1;
 | 
			
		||||
	if ((fp = _popen(cmd, "r")) == NULL)
 | 
			
		||||
		return -2;
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		memset(MsgBuff, 0, MsgLen);
 | 
			
		||||
		//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ִ<EFBFBD>й<EFBFBD><D0B9><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
 | 
			
		||||
		while (fgets(MsgBuff, MsgLen, fp) != NULL)
 | 
			
		||||
		{
 | 
			
		||||
			printf("MsgBuff: %s\n", MsgBuff);
 | 
			
		||||
			QString qStr = QString(MsgBuff);
 | 
			
		||||
			if (qStr.toDouble() != 0.0)
 | 
			
		||||
				emit process(qStr.toDouble());
 | 
			
		||||
		}
 | 
			
		||||
		//<2F>ر<EFBFBD>ִ<EFBFBD>еĽ<D0B5><C4BD><EFBFBD>
 | 
			
		||||
		if (_pclose(fp) == -1)
 | 
			
		||||
			return -3;
 | 
			
		||||
	}
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
///////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
DataFilling::DataFilling()
 | 
			
		||||
{
 | 
			
		||||
	//ui.setupUi(this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString DataFilling::PannelName()
 | 
			
		||||
{
 | 
			
		||||
	return QString::fromLocal8Bit("");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString DataFilling::CategoryName()
 | 
			
		||||
{
 | 
			
		||||
	return QString::fromLocal8Bit("DEMģ<EFBFBD><EFBFBD>");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString DataFilling::EnglishName()
 | 
			
		||||
{
 | 
			
		||||
	return QString::fromLocal8Bit("DEM_Module");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString DataFilling::ChineseName()
 | 
			
		||||
{
 | 
			
		||||
	return QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString DataFilling::Information()
 | 
			
		||||
{
 | 
			
		||||
	return "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString DataFilling::IconPath()
 | 
			
		||||
{
 | 
			
		||||
	return ":/DEM_Fill/resources/fill.svg";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QWidget* DataFilling::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";
 | 
			
		||||
		myWidget->activateWindow();
 | 
			
		||||
		myWidget->raise();
 | 
			
		||||
		return myWidget;
 | 
			
		||||
	}
 | 
			
		||||
	ui.setupUi(myWidget);
 | 
			
		||||
 | 
			
		||||
	myWidget->setWindowTitle(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
 | 
			
		||||
	myWidget->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
 | 
			
		||||
	myWidget->setWindowIcon(QIcon(":/DEM_Fill/resources/fill.svg"));
 | 
			
		||||
	myWidget->setAttribute(Qt::WA_QuitOnClose, false);
 | 
			
		||||
 | 
			
		||||
	myWidget->setAttribute(Qt::WA_DeleteOnClose);
 | 
			
		||||
	connect(myWidget, &QDialog::destroyed, this, [=] {
 | 
			
		||||
		qDebug() << "----DEM Fill window close----";
 | 
			
		||||
 | 
			
		||||
		QDir pluginsDir = QDir(qApp->applicationDirPath());
 | 
			
		||||
		if (pluginsDir.cd("srsplugins\\DemModel"))
 | 
			
		||||
		{
 | 
			
		||||
			QString strConfigPath = pluginsDir.absoluteFilePath("dem_config.ini");
 | 
			
		||||
			QFile f(strConfigPath);
 | 
			
		||||
			if (f.exists())
 | 
			
		||||
			{
 | 
			
		||||
				WriteConfigPaths(strConfigPath);
 | 
			
		||||
				f.close();
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		myWidget->close();
 | 
			
		||||
		myWidget = nullptr;
 | 
			
		||||
		if (mWorkThread != nullptr)
 | 
			
		||||
		{
 | 
			
		||||
			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>
 | 
			
		||||
			mWorkThread = nullptr;//mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫdelete
 | 
			
		||||
			mWorker = nullptr;//mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater
 | 
			
		||||
		}
 | 
			
		||||
		});
 | 
			
		||||
	connect(ui.pbtMasked, &QPushButton::pressed, this, &DataFilling::chooseMaskedSlope);
 | 
			
		||||
	connect(ui.pbtOutFill, &QPushButton::pressed, this, &DataFilling::chooseOutFill);
 | 
			
		||||
 | 
			
		||||
	connect(ui.pushButton_ok, &QPushButton::pressed, this, &DataFilling::readAndStart);
 | 
			
		||||
	connect(ui.pushButton_cancel, &QPushButton::pressed, this, &DataFilling::pbCancel);
 | 
			
		||||
 | 
			
		||||
	ui.progressBar->setTextVisible(true);
 | 
			
		||||
	ui.progressBar->setRange(0, 100);
 | 
			
		||||
 | 
			
		||||
	ui.pbtMasked->setFocus();
 | 
			
		||||
 | 
			
		||||
	ui.lineRectangleScale->setValidator(new QRegExpValidator(QRegExp("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$")));
 | 
			
		||||
	ui.lineExpandSize->setValidator(new QIntValidator(0, 999, this));
 | 
			
		||||
	ui.lineRectangleScale->setText("0.1");
 | 
			
		||||
	ui.lineExpandSize->setText("3");
 | 
			
		||||
 | 
			
		||||
	QFile qssFile(":/DEM_Fill/DEM_Fill.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() << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>";
 | 
			
		||||
 | 
			
		||||
	QDir pluginsDir = QDir(qApp->applicationDirPath());
 | 
			
		||||
	if (pluginsDir.cd("srsplugins\\DemModel"))
 | 
			
		||||
	{
 | 
			
		||||
		QString strConfigPath = pluginsDir.absoluteFilePath("dem_config.ini");
 | 
			
		||||
		QFile f(strConfigPath);
 | 
			
		||||
		if (f.exists())
 | 
			
		||||
		{
 | 
			
		||||
			ReadConfigHistoryPaths(strConfigPath);
 | 
			
		||||
			f.close();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (showWin)
 | 
			
		||||
		myWidget->show();
 | 
			
		||||
 | 
			
		||||
	return myWidget;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DataFilling::startWorkThread()
 | 
			
		||||
{
 | 
			
		||||
	if (mWorker != nullptr)
 | 
			
		||||
	{
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	mWorkThread = new QThread();
 | 
			
		||||
	mWorker = new WorkThreadObject();
 | 
			
		||||
	mWorker->moveToThread(mWorkThread);
 | 
			
		||||
	connect(mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater);
 | 
			
		||||
	connect(mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater);
 | 
			
		||||
	connect(mWorker, &WorkThreadObject::sendMaskedTiff, this, &DataFilling::openResultData);
 | 
			
		||||
 | 
			
		||||
	connect(mWorker, &WorkThreadObject::process, myWidget, [=](int value) {
 | 
			
		||||
		ui.progressBar->setValue(value);
 | 
			
		||||
		if (value == 100)
 | 
			
		||||
		{
 | 
			
		||||
			QMessageBox mess(QMessageBox::Information,
 | 
			
		||||
				QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
 | 
			
		||||
				QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>:\n") + outPath);
 | 
			
		||||
			mess.setWindowFlags(Qt::Drawer);
 | 
			
		||||
			mess.setStandardButtons(QMessageBox::Yes);
 | 
			
		||||
			mess.button(QMessageBox::StandardButton::Yes)->setText(QString::fromLocal8Bit("ȷ<EFBFBD><EFBFBD>"));
 | 
			
		||||
			//mess.setTextInteractionFlags(Qt::TextSelectableByMouse);
 | 
			
		||||
			int result = mess.exec();
 | 
			
		||||
			pbCancel();
 | 
			
		||||
		}
 | 
			
		||||
		});
 | 
			
		||||
	connect(this, &DataFilling::startDataFill, mWorker, &WorkThreadObject::runFillingWork);
 | 
			
		||||
 | 
			
		||||
	mWorkThread->start();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DataFilling::chooseMaskedSlope()
 | 
			
		||||
{
 | 
			
		||||
	QString dirDom = QFileDialog::getExistingDirectory(ui.pbtMasked, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DEM<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>"), "");
 | 
			
		||||
	if (dirDom != "")
 | 
			
		||||
		ui.lineMasked->setText(dirDom);
 | 
			
		||||
}
 | 
			
		||||
void DataFilling::chooseOutFill()
 | 
			
		||||
{
 | 
			
		||||
	QString dirDom = QFileDialog::getExistingDirectory(ui.pbtOutFill, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>"), "");
 | 
			
		||||
	if (dirDom != "")
 | 
			
		||||
		ui.lineOutFill->setText(dirDom);
 | 
			
		||||
}
 | 
			
		||||
void DataFilling::readAndStart()
 | 
			
		||||
{
 | 
			
		||||
	QString in_masked = ui.lineMasked->text();
 | 
			
		||||
	QString out_filled = ui.lineOutFill->text();
 | 
			
		||||
	QString scale = ui.lineRectangleScale->text();
 | 
			
		||||
	QString size = ui.lineExpandSize->text();
 | 
			
		||||
	if (in_masked == "" || out_filled == "" || scale == "" || size == "")
 | 
			
		||||
	{
 | 
			
		||||
		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>"));
 | 
			
		||||
		mess.setWindowFlags(Qt::Drawer);
 | 
			
		||||
		int result = mess.exec();
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	outPath = out_filled;
 | 
			
		||||
 | 
			
		||||
	ui.progressBar->setValue(0);
 | 
			
		||||
 | 
			
		||||
	if (mWorkThread == nullptr)
 | 
			
		||||
	{
 | 
			
		||||
		qDebug() << "--startThread";
 | 
			
		||||
		startWorkThread();
 | 
			
		||||
	}
 | 
			
		||||
	emit startDataFill(in_masked, out_filled, scale, size);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DataFilling::ReadConfigHistoryPaths(QString strPath)
 | 
			
		||||
{
 | 
			
		||||
	QSettings configIni(strPath, QSettings::IniFormat);
 | 
			
		||||
 | 
			
		||||
	//<2F><EFBFBD><F2BFAAB1><EFBFBD>Ϊ<EFBFBD><CEAA>[DemFill] <20><><EFBFBD><EFBFBD>
 | 
			
		||||
	configIni.beginGroup("DemFill");
 | 
			
		||||
 | 
			
		||||
	ui.lineMasked->setText(configIni.value("MaskedFiles").toString());
 | 
			
		||||
	ui.lineOutFill->setText(configIni.value("FilledFiles").toString());
 | 
			
		||||
 | 
			
		||||
	configIni.endGroup();//<2F>ر<EFBFBD><D8B1><EFBFBD>
 | 
			
		||||
}
 | 
			
		||||
void DataFilling::WriteConfigPaths(QString strPath)
 | 
			
		||||
{
 | 
			
		||||
	QSettings configIni(strPath, QSettings::IniFormat);
 | 
			
		||||
	configIni.setIniCodec("utf-8");
 | 
			
		||||
	//<2F><EFBFBD><F2BFAAB1><EFBFBD>Ϊ<EFBFBD><CEAA>[DemFill] <20><><EFBFBD><EFBFBD>
 | 
			
		||||
	configIni.beginGroup("DemFill");
 | 
			
		||||
 | 
			
		||||
	//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>·<EFBFBD><C2B7>
 | 
			
		||||
	QString temp = ui.lineMasked->text();
 | 
			
		||||
	if (temp != "")
 | 
			
		||||
		configIni.setValue("MaskedFiles", temp);
 | 
			
		||||
	//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DOM·<4D><C2B7>
 | 
			
		||||
	temp = ui.lineOutFill->text();
 | 
			
		||||
	if (temp != "")
 | 
			
		||||
		configIni.setValue("FilledFiles", temp);
 | 
			
		||||
 | 
			
		||||
	configIni.endGroup();//<2F>ر<EFBFBD><D8B1><EFBFBD>
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DataFilling::pbCancel()
 | 
			
		||||
{
 | 
			
		||||
	delete myWidget;//<2F><><EFBFBD><EFBFBD>&QDialog::destroyed
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DataFilling::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);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										92
									
								
								DEM_Fill/DEM_Fill.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								DEM_Fill/DEM_Fill.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,92 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <QtWidgets/QDialog>
 | 
			
		||||
#include <QProcess>
 | 
			
		||||
#include <QThread>
 | 
			
		||||
#include <QFile>
 | 
			
		||||
#include <QDebug>
 | 
			
		||||
#include <QMessageBox>
 | 
			
		||||
#include <QFileDialog>
 | 
			
		||||
#include <QStringList>
 | 
			
		||||
#include <QIntValidator>
 | 
			
		||||
#include <QRegExpValidator>
 | 
			
		||||
 | 
			
		||||
#include "SrsMainPluginInterFace.h"
 | 
			
		||||
 | 
			
		||||
#include "ui_DEM_Fill.h"
 | 
			
		||||
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <iostream>
 | 
			
		||||
 | 
			
		||||
using namespace std;
 | 
			
		||||
 | 
			
		||||
class WorkThreadObject :public QObject
 | 
			
		||||
{
 | 
			
		||||
	Q_OBJECT
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	int run_cmd(const char* cmd);
 | 
			
		||||
 | 
			
		||||
signals:
 | 
			
		||||
	void process(int value);
 | 
			
		||||
	void sendMaskedTiff(QStringList maskedData);
 | 
			
		||||
 | 
			
		||||
public slots:
 | 
			
		||||
	void runFillingWork(QString in_masked, QString out_filled, QString scale, QString size);
 | 
			
		||||
	void readProcessStandardOutput();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	QProcess* mProcess = nullptr;
 | 
			
		||||
 | 
			
		||||
	QString outTiffPath, tifflinear, tiffcubic;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class DataFilling : public SrsMainInterface
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
        Q_INTERFACES(SrsMainInterface)
 | 
			
		||||
        Q_PLUGIN_METADATA(IID MainInterface_iid)
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    DataFilling();
 | 
			
		||||
 | 
			
		||||
	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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public slots:
 | 
			
		||||
	//pushbutton_OK
 | 
			
		||||
	void readAndStart();
 | 
			
		||||
	void pbCancel();
 | 
			
		||||
 | 
			
		||||
	void chooseMaskedSlope();
 | 
			
		||||
	void chooseOutFill();
 | 
			
		||||
 | 
			
		||||
	void openResultData(QStringList string_list);
 | 
			
		||||
 | 
			
		||||
signals:
 | 
			
		||||
	void startDataFill(QString in_masked, QString out_filled, QString scale, QString size);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    Ui::DEM_FillClass ui;
 | 
			
		||||
 | 
			
		||||
	QDialog* myWidget = nullptr;
 | 
			
		||||
 | 
			
		||||
	QThread* mWorkThread = nullptr;
 | 
			
		||||
	WorkThreadObject* mWorker = nullptr;
 | 
			
		||||
 | 
			
		||||
	QString outPath;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										6
									
								
								DEM_Fill/DEM_Fill.qrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								DEM_Fill/DEM_Fill.qrc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
<RCC>
 | 
			
		||||
    <qresource prefix="/DEM_Fill">
 | 
			
		||||
        <file>resources/fill.svg</file>
 | 
			
		||||
        <file>DEM_Fill.qss</file>
 | 
			
		||||
    </qresource>
 | 
			
		||||
</RCC>
 | 
			
		||||
							
								
								
									
										68
									
								
								DEM_Fill/DEM_Fill.qss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								DEM_Fill/DEM_Fill.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, #pbtMasked, #pbtOutFill{
 | 
			
		||||
	font-family:'Microsoft YaHei';
 | 
			
		||||
	font-size:12px;
 | 
			
		||||
	background-color: #ffffff;
 | 
			
		||||
	border: 1px solid #dcdfe6;
 | 
			
		||||
	padding: 2px;
 | 
			
		||||
	border-radius: 5px;
 | 
			
		||||
	max-height:20px;
 | 
			
		||||
}
 | 
			
		||||
#pushButton_ok:hover, #pushButton_cancel:hover, #pbtMasked:hover, #pbtOutFill:hover{
 | 
			
		||||
	background-color: #ecf5ff;
 | 
			
		||||
	color: #409eff;
 | 
			
		||||
}
 | 
			
		||||
#pushButton_ok:pressed, #pushButton_cancel:pressed, #pbtMasked:pressed, #pbtOutFill:pressed{
 | 
			
		||||
	border: 1px solid #3a8ee6;
 | 
			
		||||
	color: #409eff;
 | 
			
		||||
}
 | 
			
		||||
#pushButton_ok:checked, #pushButton_cancel:checked, #pbtMasked:checked, #pbtOutFill:checked{
 | 
			
		||||
	border: 1px solid #3a8ee6;
 | 
			
		||||
	color: #409eff;
 | 
			
		||||
}
 | 
			
		||||
#pushButton_ok:focus, #pushButton_cancel:focus, #pbtMasked:focus, #pbtOutFill:focus{
 | 
			
		||||
	border: 1px solid #3a8ee6;
 | 
			
		||||
	color: #409eff;
 | 
			
		||||
	outline: none;
 | 
			
		||||
}
 | 
			
		||||
#pushButton_ok, #pushButton_cancel{
 | 
			
		||||
	min-width:36px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*----QLineEdit<69><74>ʽ*/
 | 
			
		||||
#lineMasked, #lineOutFill,#lineRectangleScale,#lineExpandSize{
 | 
			
		||||
	border:0px;
 | 
			
		||||
	border-bottom: 1px solid #B3B3B3;
 | 
			
		||||
	font-family:'Microsoft YaHei';
 | 
			
		||||
	background-color:transparent;
 | 
			
		||||
}
 | 
			
		||||
#lineMasked:hover, #lineOutFill:hover,#lineRectangleScale:hover,#lineExpandSize:hover{
 | 
			
		||||
	border-bottom: 2px solid #66A3FF;
 | 
			
		||||
}
 | 
			
		||||
#lineMasked:focus, #lineOutFill:focus,#lineRectangleScale:focus,#lineExpandSize:focus{
 | 
			
		||||
	border-bottom: 2px solid #7666FF;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										236
									
								
								DEM_Fill/DEM_Fill.ui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										236
									
								
								DEM_Fill/DEM_Fill.ui
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,236 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<ui version="4.0">
 | 
			
		||||
 <class>DEM_FillClass</class>
 | 
			
		||||
 <widget class="QDialog" name="DEM_FillClass">
 | 
			
		||||
  <property name="geometry">
 | 
			
		||||
   <rect>
 | 
			
		||||
    <x>0</x>
 | 
			
		||||
    <y>0</y>
 | 
			
		||||
    <width>400</width>
 | 
			
		||||
    <height>250</height>
 | 
			
		||||
   </rect>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="minimumSize">
 | 
			
		||||
   <size>
 | 
			
		||||
    <width>400</width>
 | 
			
		||||
    <height>250</height>
 | 
			
		||||
   </size>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="maximumSize">
 | 
			
		||||
   <size>
 | 
			
		||||
    <width>400</width>
 | 
			
		||||
    <height>250</height>
 | 
			
		||||
   </size>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="windowTitle">
 | 
			
		||||
   <string>DEM_Fill</string>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="windowIcon">
 | 
			
		||||
   <iconset resource="DEM_Fill.qrc">
 | 
			
		||||
    <normaloff>:/DEM_Fill/resources/fill.svg</normaloff>:/DEM_Fill/resources/fill.svg</iconset>
 | 
			
		||||
  </property>
 | 
			
		||||
  <layout class="QGridLayout" name="gridLayout_2">
 | 
			
		||||
   <item row="0" column="0">
 | 
			
		||||
    <layout class="QGridLayout" name="gridLayout">
 | 
			
		||||
     <item row="0" column="0">
 | 
			
		||||
      <widget class="QLabel" name="label_2">
 | 
			
		||||
       <property name="sizePolicy">
 | 
			
		||||
        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
 | 
			
		||||
         <horstretch>0</horstretch>
 | 
			
		||||
         <verstretch>0</verstretch>
 | 
			
		||||
        </sizepolicy>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="text">
 | 
			
		||||
        <string>输入裁剪后的DEM文件</string>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="alignment">
 | 
			
		||||
        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
 | 
			
		||||
       </property>
 | 
			
		||||
      </widget>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item row="1" column="0">
 | 
			
		||||
      <widget class="QLineEdit" name="lineMasked"/>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item row="1" column="1">
 | 
			
		||||
      <widget class="QPushButton" name="pbtMasked">
 | 
			
		||||
       <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">
 | 
			
		||||
       <property name="sizePolicy">
 | 
			
		||||
        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
 | 
			
		||||
         <horstretch>0</horstretch>
 | 
			
		||||
         <verstretch>0</verstretch>
 | 
			
		||||
        </sizepolicy>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="text">
 | 
			
		||||
        <string>输出数据填补结果文件</string>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="alignment">
 | 
			
		||||
        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
 | 
			
		||||
       </property>
 | 
			
		||||
      </widget>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item row="3" column="0">
 | 
			
		||||
      <widget class="QLineEdit" name="lineOutFill"/>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item row="3" column="1">
 | 
			
		||||
      <widget class="QPushButton" name="pbtOutFill">
 | 
			
		||||
       <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="4" column="0" colspan="2">
 | 
			
		||||
      <layout class="QHBoxLayout" name="horizontalLayout_2">
 | 
			
		||||
       <property name="topMargin">
 | 
			
		||||
        <number>12</number>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="bottomMargin">
 | 
			
		||||
        <number>12</number>
 | 
			
		||||
       </property>
 | 
			
		||||
       <item>
 | 
			
		||||
        <widget class="QLabel" name="label_3">
 | 
			
		||||
         <property name="text">
 | 
			
		||||
          <string>外接矩形外扩比例</string>
 | 
			
		||||
         </property>
 | 
			
		||||
        </widget>
 | 
			
		||||
       </item>
 | 
			
		||||
       <item>
 | 
			
		||||
        <widget class="QLineEdit" name="lineRectangleScale"/>
 | 
			
		||||
       </item>
 | 
			
		||||
       <item>
 | 
			
		||||
        <widget class="QLabel" name="label_4">
 | 
			
		||||
         <property name="text">
 | 
			
		||||
          <string>空洞外扩像素</string>
 | 
			
		||||
         </property>
 | 
			
		||||
        </widget>
 | 
			
		||||
       </item>
 | 
			
		||||
       <item>
 | 
			
		||||
        <widget class="QLineEdit" name="lineExpandSize"/>
 | 
			
		||||
       </item>
 | 
			
		||||
       <item>
 | 
			
		||||
        <spacer name="horizontalSpacer_3">
 | 
			
		||||
         <property name="orientation">
 | 
			
		||||
          <enum>Qt::Horizontal</enum>
 | 
			
		||||
         </property>
 | 
			
		||||
         <property name="sizeType">
 | 
			
		||||
          <enum>QSizePolicy::Fixed</enum>
 | 
			
		||||
         </property>
 | 
			
		||||
         <property name="sizeHint" stdset="0">
 | 
			
		||||
          <size>
 | 
			
		||||
           <width>81</width>
 | 
			
		||||
           <height>20</height>
 | 
			
		||||
          </size>
 | 
			
		||||
         </property>
 | 
			
		||||
        </spacer>
 | 
			
		||||
       </item>
 | 
			
		||||
      </layout>
 | 
			
		||||
     </item>
 | 
			
		||||
    </layout>
 | 
			
		||||
   </item>
 | 
			
		||||
   <item row="1" column="0">
 | 
			
		||||
    <layout class="QHBoxLayout" name="horizontalLayout">
 | 
			
		||||
     <item>
 | 
			
		||||
      <spacer name="horizontalSpacer">
 | 
			
		||||
       <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="sizePolicy">
 | 
			
		||||
        <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
 | 
			
		||||
         <horstretch>0</horstretch>
 | 
			
		||||
         <verstretch>0</verstretch>
 | 
			
		||||
        </sizepolicy>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="text">
 | 
			
		||||
        <string>确定</string>
 | 
			
		||||
       </property>
 | 
			
		||||
      </widget>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item>
 | 
			
		||||
      <spacer name="horizontalSpacer_2">
 | 
			
		||||
       <property name="orientation">
 | 
			
		||||
        <enum>Qt::Horizontal</enum>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="sizeType">
 | 
			
		||||
        <enum>QSizePolicy::Fixed</enum>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="sizeHint" stdset="0">
 | 
			
		||||
        <size>
 | 
			
		||||
         <width>13</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="2" column="0">
 | 
			
		||||
    <widget class="QProgressBar" name="progressBar">
 | 
			
		||||
     <property name="value">
 | 
			
		||||
      <number>0</number>
 | 
			
		||||
     </property>
 | 
			
		||||
    </widget>
 | 
			
		||||
   </item>
 | 
			
		||||
  </layout>
 | 
			
		||||
 </widget>
 | 
			
		||||
 <layoutdefault spacing="6" margin="11"/>
 | 
			
		||||
 <tabstops>
 | 
			
		||||
  <tabstop>lineMasked</tabstop>
 | 
			
		||||
  <tabstop>pbtMasked</tabstop>
 | 
			
		||||
  <tabstop>lineOutFill</tabstop>
 | 
			
		||||
  <tabstop>pbtOutFill</tabstop>
 | 
			
		||||
  <tabstop>lineRectangleScale</tabstop>
 | 
			
		||||
  <tabstop>lineExpandSize</tabstop>
 | 
			
		||||
  <tabstop>pushButton_ok</tabstop>
 | 
			
		||||
  <tabstop>pushButton_cancel</tabstop>
 | 
			
		||||
 </tabstops>
 | 
			
		||||
 <resources>
 | 
			
		||||
  <include location="DEM_Fill.qrc"/>
 | 
			
		||||
 </resources>
 | 
			
		||||
 <connections/>
 | 
			
		||||
</ui>
 | 
			
		||||
							
								
								
									
										84
									
								
								DEM_Fill/DEM_Fill.vcxproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								DEM_Fill/DEM_Fill.vcxproj
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,84 @@
 | 
			
		||||
<?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>{32F04C81-EC93-432F-9B60-0B92B5FCC5C5}</ProjectGuid>
 | 
			
		||||
    <Keyword>QtVS_v304</Keyword>
 | 
			
		||||
    <WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0.19041.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>qt5.11.2</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'">
 | 
			
		||||
    <TargetName>dem4-$(ProjectName)</TargetName>
 | 
			
		||||
    <IncludePath>D:\qgis\osgeo4w\include;D:\qgis\osgeo4w\apps\Qt5\include;D:\qgis\osgeo4w\apps\qgis_build_sdk\include;D:\qgis\osgeo4w\apps\Qt5\include\QtXml;$(IncludePath)</IncludePath>
 | 
			
		||||
    <LibraryPath>D:\qgis\osgeo4w\lib;D:\qgis\osgeo4w\apps\Qt5\lib;D:\qgis\osgeo4w\apps\qgis_build_sdk\lib;$(LibraryPath)</LibraryPath>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 | 
			
		||||
    <Link>
 | 
			
		||||
      <AdditionalDependencies>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>Windows</SubSystem>
 | 
			
		||||
      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
			
		||||
    </Link>
 | 
			
		||||
  </ItemDefinitionGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <QtRcc Include="DEM_Fill.qrc" />
 | 
			
		||||
    <QtUic Include="DEM_Fill.ui" />
 | 
			
		||||
    <QtMoc Include="DEM_Fill.h" />
 | 
			
		||||
    <ClCompile Include="DEM_Fill.cpp" />
 | 
			
		||||
    <ClCompile Include="main.cpp" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <QtMoc Include="SrsMainPluginInterFace.h" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ClInclude Include="x64\Release\uic\ui_DEM_Fill.h" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <None Include="DEM_Fill.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>
 | 
			
		||||
							
								
								
									
										59
									
								
								DEM_Fill/DEM_Fill.vcxproj.filters
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								DEM_Fill/DEM_Fill.vcxproj.filters
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,59 @@
 | 
			
		||||
<?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>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="DEM_Fill.qrc">
 | 
			
		||||
      <Filter>Resource Files</Filter>
 | 
			
		||||
    </QtRcc>
 | 
			
		||||
    <QtUic Include="DEM_Fill.ui">
 | 
			
		||||
      <Filter>Form Files</Filter>
 | 
			
		||||
    </QtUic>
 | 
			
		||||
    <QtMoc Include="DEM_Fill.h">
 | 
			
		||||
      <Filter>Header Files</Filter>
 | 
			
		||||
    </QtMoc>
 | 
			
		||||
    <ClCompile Include="DEM_Fill.cpp">
 | 
			
		||||
      <Filter>Source Files</Filter>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ClCompile Include="main.cpp">
 | 
			
		||||
      <Filter>Source Files</Filter>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <QtMoc Include="SrsMainPluginInterFace.h">
 | 
			
		||||
      <Filter>Header Files</Filter>
 | 
			
		||||
    </QtMoc>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ClInclude Include="x64\Release\uic\ui_DEM_Fill.h">
 | 
			
		||||
      <Filter>Form Files</Filter>
 | 
			
		||||
    </ClInclude>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <None Include="DEM_Fill.qss">
 | 
			
		||||
      <Filter>Resource Files</Filter>
 | 
			
		||||
    </None>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
</Project>
 | 
			
		||||
							
								
								
									
										58
									
								
								DEM_Fill/SrsMainPluginInterFace.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								DEM_Fill/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)
 | 
			
		||||
							
								
								
									
										10
									
								
								DEM_Fill/main.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								DEM_Fill/main.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
#include "DEM_Fill.h"
 | 
			
		||||
#include <QtWidgets/QApplication>
 | 
			
		||||
 | 
			
		||||
int main(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
    QApplication a(argc, argv);
 | 
			
		||||
    DataFilling w;
 | 
			
		||||
    w.CenterWidget()->show();
 | 
			
		||||
    return a.exec();
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								DEM_Fill/resources/fill.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								DEM_Fill/resources/fill.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?><svg width="26" height="26" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="6" y="6" width="36" height="36" rx="3" fill="none" stroke="#2c2c2c" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round"/><rect x="14" y="14" width="20" height="20" fill="none" stroke="#2c2c2c" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round"/><path d="M34 23L23 34" stroke="#2c2c2c" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round"/><path d="M25 14L14 25" stroke="#2c2c2c" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round"/><path d="M34 14L14 34" stroke="#2c2c2c" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round"/><path d="M14 22V34H26" stroke="#2c2c2c" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round"/><path d="M22 14H34V26" stroke="#2c2c2c" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round"/></svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 936 B  | 
		Reference in New Issue
	
	Block a user