#include "OperatorsBoundaryConditions.h" #include "GUIFrame/PropertyWidget.h" #include "OperatorsInterface/TreeEventOperator.h" #include "GUIDialog/GUICalculateDialog/BoundaryWidget.h" #include "GUIDialog/GUICalculateDialog/BoundaryCreateDialog.h" #include "GUIDialog/GUICalculateDialog/BoundaryDeleteDialog.h" #include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h" #include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h" #include "FITK_Interface/FITKInterfaceFlowOF/FITKOFPhysicsData.h" #include "FITK_Interface/FITKInterfaceFlowOF/FITKOFBoundary.h" namespace ModelOper { OperatorsBoundaryConditions::OperatorsBoundaryConditions() { } OperatorsBoundaryConditions::~OperatorsBoundaryConditions() { } bool OperatorsBoundaryConditions::execGUI() { GUI::MainWindow* mainWindow = dynamic_cast(FITKAPP->getGlobalData()->getMainWindow()); if (mainWindow == nullptr)return false; GUI::PropertyWidget* propertyWidget = mainWindow->getPropertyWidget(); if (propertyWidget == nullptr)return false; auto physicsData = FITKAPP->getGlobalData()->getPhysicsData(); if (physicsData == nullptr)return false; auto boundaryManager = physicsData->getBoundaryManager(); if (boundaryManager == nullptr)return false; switch (_operType){ case ModelOper::OperManagerBase::Create: { GUI::BoundaryCreateDialog* dialog = new GUI::BoundaryCreateDialog(this); dialog->show(); break; } case ModelOper::OperManagerBase::Edit: { int objID = -1; this->argValue("objID", objID); Interface::FITKOFBoundary* boundaryObj = boundaryManager->getDataByID(objID); GUI::BoundaryWidget* widget = new GUI::BoundaryWidget(boundaryObj, this, propertyWidget); propertyWidget->setWidget(widget); break; } case ModelOper::OperManagerBase::Delete: { int objID = -1; this->argValue("objID", objID); Interface::FITKOFBoundary* boundaryObj = boundaryManager->getDataByID(objID); GUI::BoundaryDeleteDialog* dialog = new GUI::BoundaryDeleteDialog(boundaryObj, this); dialog->show(); } } return false; } bool OperatorsBoundaryConditions::execProfession() { // 获取模型树控制器 auto treeOper = Core::FITKOperatorRepo::getInstance()->getOperatorT("ModelTreeEvent"); if (treeOper == nullptr) return false; switch (_operType){ case ModelOper::OperManagerBase::Create:{ treeOper->updateTree(); break; } case ModelOper::OperManagerBase::Edit: { break; } case ModelOper::OperManagerBase::Delete: { treeOper->updateTree(); break; } } return true; } }