From 79e9634cae46c133f871da2f4f770a130e98a8c0 Mon Sep 17 00:00:00 2001 From: chenzh <3045316072@qq.com> Date: Tue, 2 Jul 2024 15:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=AF=BC=E5=85=A5=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialogimportmodeldataset.cpp | 40 +++++ .../dialogimportmodeldataset.h | 49 ++++++ .../dialogimportmodeldataset.ui | 165 ++++++++++++++++++ .../meshDataExchangePlugin.cpp | 24 ++- .../meshDataExchangePlugin.h | 6 + 5 files changed, 281 insertions(+), 3 deletions(-) create mode 100644 src/PluginMeshDataExchange/dialogimportmodeldataset.cpp create mode 100644 src/PluginMeshDataExchange/dialogimportmodeldataset.h create mode 100644 src/PluginMeshDataExchange/dialogimportmodeldataset.ui diff --git a/src/PluginMeshDataExchange/dialogimportmodeldataset.cpp b/src/PluginMeshDataExchange/dialogimportmodeldataset.cpp new file mode 100644 index 0000000..b59e80a --- /dev/null +++ b/src/PluginMeshDataExchange/dialogimportmodeldataset.cpp @@ -0,0 +1,40 @@ +/** + * @file dialogimportmodeldataset.cpp + * @brief None + * @author 陈增辉 (3045316072@qq.com) + * @version 2.5.0 + * @date 24-6-25 + * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved. + */ + +// You may need to build the project (run Qt uic code generator) to get +// "ui_DialogImportModelDataset.h" resolved + +#include "dialogimportmodeldataset.h" +#include "ui_DialogImportModelDataset.h" +#include "MainWindow/MainWindow.h" +#include "Settings/BusAPI.h" + +namespace WBFZ { + DialogImportModelDataset::DialogImportModelDataset(GUI::MainWindow* _mainwindow,QWidget* parent) + : QDialog(parent) + ,_mainwindow(_mainwindow) + , ui(new Ui::DialogImportModelDataset) + { + ui->setupUi(this); + this->initLibrary(); + } + DialogImportModelDataset::~DialogImportModelDataset() + { + delete ui; + } + // 初始化模型库 + void DialogImportModelDataset::initLibrary() { + Setting::BusAPI* busapi=Setting::BusAPI::instance(); // 指针调用 -> ,类::静态方法 + // QString executablePath = QApplication::applicationDirPath(); // exe 路径 + } + // 模型筛选 + void DialogImportModelDataset::filterModel(QString filterStr) + { + } +} // namespace WBFZ diff --git a/src/PluginMeshDataExchange/dialogimportmodeldataset.h b/src/PluginMeshDataExchange/dialogimportmodeldataset.h new file mode 100644 index 0000000..24f26c4 --- /dev/null +++ b/src/PluginMeshDataExchange/dialogimportmodeldataset.h @@ -0,0 +1,49 @@ +/** + * @file dialogimportmodeldataset.h + * @brief None + * @author 陈增辉 (3045316072@qq.com) + * @version 2.5.0 + * @date 24-6-25 + * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved. + */ + +#ifndef LAMPCAE_DIALOGIMPORTMODELDATASET_H +#define LAMPCAE_DIALOGIMPORTMODELDATASET_H + +#include +#include "ModuleBase/graph3DWindow.h" +#include + + + +namespace GUI { + class MainWindow; +} + + +namespace WBFZ { + QT_BEGIN_NAMESPACE + namespace Ui { + class DialogImportModelDataset; + } + + QT_END_NAMESPACE + + class DialogImportModelDataset : public QDialog { + Q_OBJECT + + public: + explicit DialogImportModelDataset(GUI::MainWindow* _mainwindow,QWidget* parent = nullptr); + ~DialogImportModelDataset() override; + + public: + void initLibrary(); + void filterModel(QString filterStr);// 根据条件筛选 + private: + GUI::MainWindow* _mainwindow; + Ui::DialogImportModelDataset* ui; + QString _librarySettingPath; // ini 配置环境地址 + }; +} // namespace WBFZ + +#endif // LAMPCAE_DIALOGIMPORTMODELDATASET_H diff --git a/src/PluginMeshDataExchange/dialogimportmodeldataset.ui b/src/PluginMeshDataExchange/dialogimportmodeldataset.ui new file mode 100644 index 0000000..39f5721 --- /dev/null +++ b/src/PluginMeshDataExchange/dialogimportmodeldataset.ui @@ -0,0 +1,165 @@ + + + WBFZ::DialogImportModelDataset + + + + 0 + 0 + 1003 + 805 + + + + DialogImportModelDataset + + + + + + + 350 + 0 + + + + + 350 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + 预制模型类型 + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 300 + 0 + + + + + 300 + 16777215 + + + + + 模型1 + + + + + 模型2 + + + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 600 + 600 + + + + + 1000 + 1000 + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + diff --git a/src/PluginMeshDataExchange/meshDataExchangePlugin.cpp b/src/PluginMeshDataExchange/meshDataExchangePlugin.cpp index 702f1c5..6fcc07b 100644 --- a/src/PluginMeshDataExchange/meshDataExchangePlugin.cpp +++ b/src/PluginMeshDataExchange/meshDataExchangePlugin.cpp @@ -8,6 +8,7 @@ #include "KEYdataExchange.h" #include "ModelData/modelDataBase.h" #include "ModuleBase/ThreadControl.h" +#include "dialogimportmodeldataset.h" #include "ModuleBase/ThreadTaskManager.h" #include "MSHdataExchange.h" #include "NEUdataExchange.h" @@ -28,6 +29,17 @@ namespace MeshData { _mainwindow = m; connect(_mainwindow, SIGNAL(on_actionvtkPointSamplorTriggleSIGNAL(GUI::MainWindow*)),this,SLOT(vtkPointSamplerDialog(GUI::MainWindow*))); + + // 添加 命令 + _toolboxMenu=new QMenu("ImportTestBar"); + // 增加菜单 + QAction* action_ModelFilterImport=_toolboxMenu->addAction("ModelFilterImport"); + + connect(action_ModelFilterImport, SIGNAL(triggered()),this, SLOT(on_TestLoadModelImport())); + + m->menuBar()->addMenu(_toolboxMenu); + + } bool MeshDataExchangePlugin::install() @@ -112,6 +124,15 @@ namespace MeshData { MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling* w = new MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling(m); w->show(); } + + + // 用户点击按钮,触达这个函数执行 + void MeshDataExchangePlugin::on_TestLoadModelImport() + { + WBFZ::DialogImportModelDataset* dialog=new WBFZ::DialogImportModelDataset(_mainwindow); + dialog->exec(); + } + } @@ -122,9 +143,6 @@ namespace MeshData { - - - void Register(GUI::MainWindow* m, QList* ps) { Plugins::PluginBase* p_meshdataExchangeplugin = new MeshData::MeshDataExchangePlugin(m); diff --git a/src/PluginMeshDataExchange/meshDataExchangePlugin.h b/src/PluginMeshDataExchange/meshDataExchangePlugin.h index 3d4f82a..a59b147 100644 --- a/src/PluginMeshDataExchange/meshDataExchangePlugin.h +++ b/src/PluginMeshDataExchange/meshDataExchangePlugin.h @@ -3,6 +3,8 @@ #include "meshDataExchangePluginAPI.h" #include "PluginManager/pluginBase.h" +#include +#include namespace MeshData { enum MeshOperation { MESH_NONE, MESH_READ, MESH_WRITE }; @@ -21,6 +23,10 @@ namespace MeshData { void vtkPointSamplerDialog(GUI::MainWindow* m); private: static GUI::MainWindow* _mainwindow; + QMenuBar* menuBar= nullptr; + QMenu* _toolboxMenu=nullptr; + public slots: + void on_TestLoadModelImport(); }; }