1、完成中央布局的左侧的结构树的初步重写

2、完成结构树的求解分析标签的部分内容
feature/struct-menu-20241023
mzh 3 weeks ago
parent 9bf36406ba
commit 8af4d47713

@ -0,0 +1,111 @@
#include "CFDMainTreeWidget.h"
#include "GUIWidget/TreeWidget.h"
namespace GUI{
CFDMainTreeWidget::CFDMainTreeWidget(MainWindow *parent) : MainTreeWidget(parent)
{
// this->setWidget(_treeWidget);
init();
}
void CFDMainTreeWidget::init()
{
QTabWidget* tabWidget = new QTabWidget;
this->setWidget(tabWidget);
// tabWidget->addTab(_treeWidget,tr("Solution Analysis"));
addTreePreprocessing(tabWidget);
addTreeSolutionAnalysis(tabWidget);
addTreePostprocessing(tabWidget);
}
void CFDMainTreeWidget::addTreePreprocessing(QTabWidget *tabWidget)
{
_treePreprocessing = new TreeWidget(this);
tabWidget->addTab(_treePreprocessing,tr("Preprocessing"));
_treePreprocessing->updateTree();
}
void CFDMainTreeWidget::addTreeSolutionAnalysis(QTabWidget *tabWidget)
{
_treeSolutionAnalysis = new TreeWidget(this);
tabWidget->addTab(_treeSolutionAnalysis,tr("SolutionAnalysis"));
QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem();
GeometryAndMeshingItem->setText(0,tr("Geometry and Meshing"));
GeometryAndMeshingItem->setData(1,0,-1);
// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::MainTreeEnum::MainTree_Mesh));
_treeSolutionAnalysis->addTopLevelItem(GeometryAndMeshingItem);
QTreeWidgetItem* mesh = new QTreeWidgetItem();
mesh->setText(0,tr("Mesh001"));
mesh->setData(1,0,-1);
GeometryAndMeshingItem->addChild(mesh);
QTreeWidgetItem* ComputationalSetupItem = new QTreeWidgetItem();
ComputationalSetupItem->setText(0,tr("Computational Setup"));
ComputationalSetupItem->setData(1,0,-1);
_treeSolutionAnalysis->addTopLevelItem(ComputationalSetupItem);
QTreeWidgetItem* TimeModeItem = new QTreeWidgetItem();
TimeModeItem->setText(0,tr("Time Mode"));
TimeModeItem->setData(1,0,-1);
ComputationalSetupItem->addChild(TimeModeItem);
QTreeWidgetItem* ComputationalDomainItem = new QTreeWidgetItem();
ComputationalDomainItem->setText(0,tr("Computational Domain"));
ComputationalDomainItem->setData(1,0,-1);
ComputationalSetupItem->addChild(ComputationalDomainItem);
QTreeWidgetItem* SolverItem = new QTreeWidgetItem();
SolverItem->setText(0,tr("Solver"));
SolverItem->setData(1,0,-1);
ComputationalDomainItem->addChild(SolverItem);
QTreeWidgetItem* MotionPropertiesItem = new QTreeWidgetItem();
MotionPropertiesItem->setText(0,tr("Motion Properties"));
MotionPropertiesItem->setData(1,0,-1);
ComputationalDomainItem->addChild(MotionPropertiesItem);
QTreeWidgetItem* BoundaryConditionsItem = new QTreeWidgetItem();
BoundaryConditionsItem->setText(0,tr("Boundary Conditions"));
BoundaryConditionsItem->setData(1,0,-1);
ComputationalDomainItem->addChild(BoundaryConditionsItem);
QTreeWidgetItem* InitializationItem = new QTreeWidgetItem();
InitializationItem->setText(0,tr("Initialization"));
InitializationItem->setData(1,0,-1);
ComputationalDomainItem->addChild(InitializationItem);
QTreeWidgetItem* ComputationalControlItem = new QTreeWidgetItem();
ComputationalControlItem->setText(0,tr("Computational Control"));
ComputationalControlItem->setData(1,0,-1);
ComputationalDomainItem->addChild(ComputationalControlItem);
QTreeWidgetItem* MonitorsItem = new QTreeWidgetItem();
MonitorsItem->setText(0,tr("Monitors"));
MonitorsItem->setData(1,0,-1);
ComputationalDomainItem->addChild(MonitorsItem);
}
void CFDMainTreeWidget::addTreePostprocessing(QTabWidget *tabWidget)
{
_treePostprocessing = new TreeWidget(this);
tabWidget->addTab(_treePostprocessing,tr("Postprocessing"));
}
}

@ -0,0 +1,39 @@
#ifndef CFDMainTreeWidget_h
#define CFDMainTreeWidget_h
#include <QtCore/QtGlobal>
#include <QDebug>
#include <GUIFrame/MainTreeWidget.h>
#include <CFDStructGUIAPI.h>
class MainWindow;
class QTabWidget;
namespace GUI{
class CFDStructGUIAPI CFDMainTreeWidget : public MainTreeWidget{
Q_OBJECT
public:
CFDMainTreeWidget(MainWindow* parent);
private:
void init();
void addTreePreprocessing(QTabWidget* tabWidget);
void addTreeSolutionAnalysis(QTabWidget* tabWidget);
void addTreePostprocessing(QTabWidget* tabWidget);
TreeWidget* _treePreprocessing;
TreeWidget* _treeSolutionAnalysis;
TreeWidget* _treePostprocessing;
};
}
#endif

@ -1,6 +1,9 @@
HEADERS += \
$$PWD/CFDStructGUIAPI.h \
$$PWD/CFDStructMainWindow.h \
$$PWD/CFDMainTreeWidget.h \
SOURCES += \
$$PWD/CFDStructMainWindow.cpp \
$$PWD/CFDMainTreeWidget.cpp \

@ -33,6 +33,7 @@ win32{
-L../../output/bin \
-lGUIFrame \
-lCUIProperty \
-lGUIWidget \
Debug:CONFIG += console
@ -45,6 +46,7 @@ win32{
-L../../output/bin_d \
-lGUIFrame \
-lCUIProperty \
-lGUIWidget \
Debug:LIBS += -L$$PWD/../../Tools/Win64/SARibbon/libd/ \
-lSARibbonBard \

@ -1,6 +1,10 @@
#include "CFDStructMainWindow.h"
#include "CFDMainTreeWidget.h"
#include "GUIFrame/PropertyWidget.h"
#include "GUIFrame/MainTreeWidget.h"
#include "GUIFrame/RenderWidget.h"
#include "GUIFrame/TabWidget.h"
#include "CUIProperty/CUIConfig.h"
#include "CUIProperty/CUI.h"
@ -16,6 +20,7 @@
#include <QDebug>
#include <QGroupBox>
#include <QRadioButton>
#include <QSplitter>
//CFDStructMainWindow::CFDStructMainWindow() : GUI::MainWindow()
//{
@ -39,6 +44,56 @@ CFDStructMainWindow::CFDStructMainWindow() {
setWindowTitle("AreoFlow");
}
void CFDStructMainWindow::initCentralWidget()
{
// 子部件水平排布
QSplitter* spliterLayout = new QSplitter(Qt::Horizontal);
spliterLayout->setMouseTracking(true);
spliterLayout->setHandleWidth(5);
int mainWindSize = QMainWindow::width();
// _treeWidget = new MainTreeWidget(this);
_treeWidget = new CFDMainTreeWidget(this);
_treeWidget->setMinimumWidth(mainWindSize * 0.4);
_treeWidget->setMaximumWidth(mainWindSize * 0.4);
m_PropertyWidget = new PropertyWidget(this);
m_PropertyWidget->setMinimumWidth(mainWindSize * 0.65);
m_RenderWidget = new RenderWidget(this);
_tabWidgete = new TabWidget(this);
//m_GroupPropertyWidget = new GroupPropertyWidget(this);
//添加树界面
spliterLayout->addWidget(_treeWidget);
//添加属性界面
spliterLayout->addWidget(m_PropertyWidget);
QSplitter* verLayout = new QSplitter(Qt::Vertical);
spliterLayout->setMouseTracking(true);
spliterLayout->setHandleWidth(5);
verLayout->addWidget(m_RenderWidget);
verLayout->addWidget(_tabWidgete);
spliterLayout->addWidget(verLayout);
//spliterLayout->addWidget(m_GroupPropertyWidget);
// 设置大小
spliterLayout->setSizes({ 200, 300, 1000, 200 });
auto mainLayout = new QGridLayout();
mainLayout->setObjectName("CentralGridLayout");
mainLayout->setContentsMargins(5, 5, 5, 10);
mainLayout->addWidget(spliterLayout);
_currentWidget->setLayout(mainLayout);
setCentralWidget(_currentWidget);
}
void CFDStructMainWindow::initPropertyWidget() {
//CUI* cuiWidget = new CUI(new CUIConfig({
// "type", "Widget",

@ -29,6 +29,8 @@ class CFDStructGUIAPI CFDStructMainWindow : public GUI::MainWindow {
* @return none*/
void init();
void initCentralWidget();
/**
* @brief
* @return none*/

@ -54,7 +54,7 @@ namespace GUI
TreeWidget* getTreeWidget();
private:
protected:
TreeWidget* _treeWidget = nullptr;
};
}

Loading…
Cancel
Save