#include "FITKOCCModelOperImprintSolid.h" #include "FITK_Kernel/FITKAppFramework/FITKMessage.h" // Geometry #include "FITKOCCVirtualTopoCreator.h" #include "FITK_Interface/FITKInterfaceGeometry/FITKAbsVirtualTopoMapper.h" //OCC #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Global data #include "FITK_Kernel/FITKCore/FITKDataRepo.h" #include namespace OCC { FITKOCCModelOperImprintSolid::FITKOCCModelOperImprintSolid() : OCCShapeAgent(this) { _shapeAgent = _occShapeAgent; } bool FITKOCCModelOperImprintSolid::update() { if (m_tempVShapes.size() < 1) return false; QList shapes; for (int i = 0; i < m_tempVShapes.size(); ++i) { //数据获取 FITKAbsGeoCommand* comm = FITKDATAREPO->getTDataByID(m_tempVShapes[i]->CmdId); if (comm == nullptr) return false; OCC::FITKOCCTopoShape* vOCCShapeSolid = comm->getShapeT(Interface::FITKGeoEnum::VTopoShapeType::VSSolid, m_tempVShapes[i]->VirtualTopoId); if (vOCCShapeSolid == nullptr) return false; shapes.append(vOCCShapeSolid->getTopoShape()); } return updateImprintSolid(shapes); } bool FITKOCCModelOperImprintSolid::updateImprintSolid(QList shapes) { if (shapes.size() < 2) return false; TopTools_ListOfShape shapesw; TopTools_ListOfShape shapest; for (int i = 0; i < shapes.size(); i++) { shapesw.Append(shapes[i]); shapest.Append(shapes[i]); } BRepAlgoAPI_Splitter spli; spli.SetArguments(shapesw); spli.SetTools(shapest); spli.Build(); _occShapeAgent->updateShape(spli.Shape()); return true; } }