From b163a03dc93d6fbde230568665317d1a6c5743ad Mon Sep 17 00:00:00 2001 From: keyeslll Date: Mon, 13 Mar 2023 16:22:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEM_Fill.sln | 22 ++ DEM_Fill/DEM_Fill.cpp | 364 ++++++++++++++++++++++++++++++ DEM_Fill/DEM_Fill.h | 92 ++++++++ DEM_Fill/DEM_Fill.qrc | 6 + DEM_Fill/DEM_Fill.qss | 68 ++++++ DEM_Fill/DEM_Fill.ui | 236 +++++++++++++++++++ DEM_Fill/DEM_Fill.vcxproj | 84 +++++++ DEM_Fill/DEM_Fill.vcxproj.filters | 59 +++++ DEM_Fill/SrsMainPluginInterFace.h | 58 +++++ DEM_Fill/main.cpp | 10 + DEM_Fill/resources/fill.svg | 1 + 11 files changed, 1000 insertions(+) create mode 100644 DEM_Fill.sln create mode 100644 DEM_Fill/DEM_Fill.cpp create mode 100644 DEM_Fill/DEM_Fill.h create mode 100644 DEM_Fill/DEM_Fill.qrc create mode 100644 DEM_Fill/DEM_Fill.qss create mode 100644 DEM_Fill/DEM_Fill.ui create mode 100644 DEM_Fill/DEM_Fill.vcxproj create mode 100644 DEM_Fill/DEM_Fill.vcxproj.filters create mode 100644 DEM_Fill/SrsMainPluginInterFace.h create mode 100644 DEM_Fill/main.cpp create mode 100644 DEM_Fill/resources/fill.svg diff --git a/DEM_Fill.sln b/DEM_Fill.sln new file mode 100644 index 0000000..7da4548 --- /dev/null +++ b/DEM_Fill.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32126.315 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DEM_Fill", "DEM_Fill\DEM_Fill.vcxproj", "{32F04C81-EC93-432F-9B60-0B92B5FCC5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {32F04C81-EC93-432F-9B60-0B92B5FCC5C5}.Release|x64.ActiveCfg = Release|x64 + {32F04C81-EC93-432F-9B60-0B92B5FCC5C5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D6C86E29-E4F8-449B-838C-C7B217220096} + EndGlobalSection +EndGlobal diff --git a/DEM_Fill/DEM_Fill.cpp b/DEM_Fill/DEM_Fill.cpp new file mode 100644 index 0000000..070daf9 --- /dev/null +++ b/DEM_Fill/DEM_Fill.cpp @@ -0,0 +1,364 @@ +#include "DEM_Fill.h" + +#include +#include +#include + +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); + //ȡִйе + while (fgets(MsgBuff, MsgLen, fp) != NULL) + { + printf("MsgBuff: %s\n", MsgBuff); + QString qStr = QString(MsgBuff); + if (qStr.toDouble() != 0.0) + emit process(qStr.toDouble()); + } + //رִеĽ + 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ģ"); +} + +QString DataFilling::EnglishName() +{ + return QString::fromLocal8Bit("DEM_Module"); +} + +QString DataFilling::ChineseName() +{ + return QString::fromLocal8Bit(""); +} + +QString DataFilling::Information() +{ + return ""; +} + +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("")); + 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();//waitȵfinishedźŶӦIJۺִɺ + mWorkThread = nullptr;//mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLaterҪ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); //ֻʽ + if (qssFile.isOpen()) + { + QString qss = QLatin1String(qssFile.readAll()); + myWidget->setStyleSheet(qss); + qssFile.close(); + } + else + qDebug() << "޷ļ"; + + 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(""), + QString::fromLocal8Bit("ļ:\n") + outPath); + mess.setWindowFlags(Qt::Drawer); + mess.setStandardButtons(QMessageBox::Yes); + mess.button(QMessageBox::StandardButton::Yes)->setText(QString::fromLocal8Bit("ȷ")); + //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("ѡüDEMļ"), ""); + if (dirDom != "") + ui.lineMasked->setText(dirDom); +} +void DataFilling::chooseOutFill() +{ + QString dirDom = QFileDialog::getExistingDirectory(ui.pbtOutFill, QString::fromLocal8Bit("ѡļ"), ""); + 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(""), QString::fromLocal8Bit("·")); + 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); + + //򿪱Ϊ[DemFill] + configIni.beginGroup("DemFill"); + + ui.lineMasked->setText(configIni.value("MaskedFiles").toString()); + ui.lineOutFill->setText(configIni.value("FilledFiles").toString()); + + configIni.endGroup();//ر +} +void DataFilling::WriteConfigPaths(QString strPath) +{ + QSettings configIni(strPath, QSettings::IniFormat); + configIni.setIniCodec("utf-8"); + //򿪱Ϊ[DemFill] + configIni.beginGroup("DemFill"); + + //ģ· + QString temp = ui.lineMasked->text(); + if (temp != "") + configIni.setValue("MaskedFiles", temp); + //DOM· + temp = ui.lineOutFill->text(); + if (temp != "") + configIni.setValue("FilledFiles", temp); + + configIni.endGroup();//ر +} + +void DataFilling::pbCancel() +{ + delete myWidget;//&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(); // ͼ + 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 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 mapLayers; + mapLayers << mapLayer; + QgsProject::instance()->addMapLayers(mapLayers); + } + } +} diff --git a/DEM_Fill/DEM_Fill.h b/DEM_Fill/DEM_Fill.h new file mode 100644 index 0000000..3fdf644 --- /dev/null +++ b/DEM_Fill/DEM_Fill.h @@ -0,0 +1,92 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SrsMainPluginInterFace.h" + +#include "ui_DEM_Fill.h" + +#include +#include + +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(); + + //jsonļȡʷ洢· + void ReadConfigHistoryPaths(QString strPath); + //汾δ򿪵·jsonļ + 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; +}; diff --git a/DEM_Fill/DEM_Fill.qrc b/DEM_Fill/DEM_Fill.qrc new file mode 100644 index 0000000..3fa999f --- /dev/null +++ b/DEM_Fill/DEM_Fill.qrc @@ -0,0 +1,6 @@ + + + resources/fill.svg + DEM_Fill.qss + + diff --git a/DEM_Fill/DEM_Fill.qss b/DEM_Fill/DEM_Fill.qss new file mode 100644 index 0000000..08fd470 --- /dev/null +++ b/DEM_Fill/DEM_Fill.qss @@ -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ʽ*/ +#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ʽ*/ +#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; +} diff --git a/DEM_Fill/DEM_Fill.ui b/DEM_Fill/DEM_Fill.ui new file mode 100644 index 0000000..e4c205d --- /dev/null +++ b/DEM_Fill/DEM_Fill.ui @@ -0,0 +1,236 @@ + + + DEM_FillClass + + + + 0 + 0 + 400 + 250 + + + + + 400 + 250 + + + + + 400 + 250 + + + + DEM_Fill + + + + :/DEM_Fill/resources/fill.svg:/DEM_Fill/resources/fill.svg + + + + + + + + + 0 + 0 + + + + 输入裁剪后的DEM文件 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + 选择文件夹 + + + + + + + + 0 + 0 + + + + 输出数据填补结果文件 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + 选择文件夹 + + + + + + + 12 + + + 12 + + + + + 外接矩形外扩比例 + + + + + + + + + + 空洞外扩像素 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 81 + 20 + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + 确定 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + 取消 + + + + + + + + + 0 + + + + + + + + lineMasked + pbtMasked + lineOutFill + pbtOutFill + lineRectangleScale + lineExpandSize + pushButton_ok + pushButton_cancel + + + + + + diff --git a/DEM_Fill/DEM_Fill.vcxproj b/DEM_Fill/DEM_Fill.vcxproj new file mode 100644 index 0000000..8978bb9 --- /dev/null +++ b/DEM_Fill/DEM_Fill.vcxproj @@ -0,0 +1,84 @@ + + + + + Release + x64 + + + + {32F04C81-EC93-432F-9B60-0B92B5FCC5C5} + QtVS_v304 + 10.0.19041.0 + $(MSBuildProjectDirectory)\QtMsBuild + + + + DynamicLibrary + v142 + + + + + + + qt5.11.2 + core;gui;widgets + release + + + + + + + + + + + + + dem4-$(ProjectName) + 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) + D:\qgis\osgeo4w\lib;D:\qgis\osgeo4w\apps\Qt5\lib;D:\qgis\osgeo4w\apps\qgis_build_sdk\lib;$(LibraryPath) + + + + qgis_gui.lib;qgis_analysis.lib;qgis_core.lib;qgis_native.lib;%(AdditionalDependencies) + + + + + true + true + EditAndContinue + Disabled + MultiThreadedDLL + + + Windows + true + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DEM_Fill/DEM_Fill.vcxproj.filters b/DEM_Fill/DEM_Fill.vcxproj.filters new file mode 100644 index 0000000..3fb8bdd --- /dev/null +++ b/DEM_Fill/DEM_Fill.vcxproj.filters @@ -0,0 +1,59 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} + ts + + + + + Resource Files + + + Form Files + + + Header Files + + + Source Files + + + + + Source Files + + + + + Header Files + + + + + Form Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/DEM_Fill/SrsMainPluginInterFace.h b/DEM_Fill/SrsMainPluginInterFace.h new file mode 100644 index 0000000..9130479 --- /dev/null +++ b/DEM_Fill/SrsMainPluginInterFace.h @@ -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 +#include +#include +#include + +struct SPluginMetaData +{ + QVector qvsReturnFilePaths; + QVector qvsSendFilePaths; + bool isAdd2Map; + +}; +class SrsMainInterface : public QObject +{ + Q_OBJECT +public: + virtual ~SrsMainInterface() {} + + /// + /// pannel + /// + virtual QString PannelName() = 0; + + /// + /// Category + /// + /// + virtual QString CategoryName() = 0; + + /// + /// زӢ + /// + /// + virtual QString EnglishName() = 0; + /// + /// ز + /// + /// + 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) diff --git a/DEM_Fill/main.cpp b/DEM_Fill/main.cpp new file mode 100644 index 0000000..49c55c8 --- /dev/null +++ b/DEM_Fill/main.cpp @@ -0,0 +1,10 @@ +#include "DEM_Fill.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + DataFilling w; + w.CenterWidget()->show(); + return a.exec(); +} diff --git a/DEM_Fill/resources/fill.svg b/DEM_Fill/resources/fill.svg new file mode 100644 index 0000000..a14ae0b --- /dev/null +++ b/DEM_Fill/resources/fill.svg @@ -0,0 +1 @@ + \ No newline at end of file