#include "FITKOFMeshProcessor.h" #include "FITK_Interface/FITKInterfaceMesh/FITKUnstructuredFluidMeshVTK.h" #include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h" #include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h" #include "FITK_Component/FITKOFMeshIO/FITKOFMeshReader.h" #include "FITK_Kernel/FITKAppFramework/FITKComponents.h" #include "FITK_Component/FITKCGNSIO/FITKCGNSIOInterface.h" namespace OF { void FITKOFMeshProcessor::start(QStringList info /*= QStringList()*/) { QString path = getValue("WorkDir").toString(); Interface::FITKUnstructuredFluidMeshVTK* mesh = FITKAPP->getGlobalData()->getMeshData(); mesh->clearMesh(); // 读取网格 if (!path.isEmpty()) { auto ofMeshReader = FITKAPP->getComponents()->getComponentTByName("IO::FITKOFMeshReader"); if (ofMeshReader == nullptr) return; ofMeshReader->setMeshFolder(path + "/constant/polyMesh/"); ofMeshReader->setMeshObj(mesh); ofMeshReader->exec(0); return; } path = getValue("MeshFile").toString(); if (!path.isEmpty() && path.endsWith(".cgns")) { auto ofMeshReader = FITKAPP->getComponents()->getComponentTByName("IO::FITKCGNSIOInterface"); if (ofMeshReader == nullptr) return; ofMeshReader->setFileName(path); ofMeshReader->setMeshObj(mesh); ofMeshReader->exec(1); return; } } }