From: jfa Date: Fri, 10 Mar 2023 15:29:43 +0000 (+0000) Subject: Porting Salome to OCCT 7.7.0 X-Git-Tag: V9_11_0a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6da3a67cea89b52e2b6d715fa7ecbca224b40f2d;p=modules%2Fshaper.git Porting Salome to OCCT 7.7.0 --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp index 65881759d..90a2c78f0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp @@ -18,12 +18,17 @@ // #include + #include "GeomAlgoAPI_Tools.h" + +#include + +#include #include -#include #include -#include #include +#include +#include std::shared_ptr STLImport(const std::string& theFileName, std::string& theError) @@ -38,6 +43,15 @@ std::shared_ptr STLImport(const std::string& theFileName, theError = "Can't import file."; aResShape.Nullify(); } +#if OCC_VERSION_LARGE >= 0x07070000 + BRepBuilderAPI_Sewing aSewingTool; + aSewingTool.Init(1.0e-06, Standard_True); + aSewingTool.Load(aResShape); + aSewingTool.Perform(); + TopoDS_Shape aSewedShape = aSewingTool.SewedShape(); + if (!aSewedShape.IsNull()) + aResShape = aSewedShape; +#endif if(aResShape.ShapeType() == TopAbs_SHELL) { BRepBuilderAPI_MakeSolid soliMaker(TopoDS::Shell(aResShape)); diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index 903f253f7..1cd3cb5be 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -18,6 +18,7 @@ // #include + #include #include #include @@ -47,6 +48,8 @@ #include #include +#include + #define baseRef() \ std::dynamic_pointer_cast(data()->reference(BASE_REF_ID())->value()) @@ -196,7 +199,11 @@ static GeomShapePtr transformShape(const GeomShapePtr theShape, const gp_Trsf& t // just update the location of the shape in case of affine transformation TopoDS_Shape aShape = theShape->impl(); if (!aShape.IsNull()) { +#if OCC_VERSION_LARGE < 0x07070000 aShape.Move(theTrsf); +#else + aShape.Move(theTrsf, Standard_False); +#endif aResult->setImpl(new TopoDS_Shape(aShape)); } } @@ -289,7 +296,11 @@ std::wstring Model_ResultPart::nameInPart(const std::shared_ptr& TopExp_Explorer anExp(anOrigMain, aSelection.ShapeType()); for(; anExp.More(); anExp.Next()) { if (anExp.Current().IsPartner(aSelection)) { +#if OCC_VERSION_LARGE < 0x07070000 TopoDS_Shape anOrigMoved = anExp.Current().Moved(*(myTrsf.get())); +#else + TopoDS_Shape anOrigMoved = anExp.Current().Moved(*(myTrsf.get()), Standard_False); +#endif //if (anOrigMoved.IsSame(aSelection)) { if (IsEqualTrsf(aSelTrsf, anOrigMoved.Location().Transformation())) { std::shared_ptr anOrigSel(new GeomAPI_Shape); @@ -409,7 +420,11 @@ std::shared_ptr Model_ResultPart::shapeInPart( aResult = aSelAttr->value(theIndex - 1)->value(); if (myTrsf.get() && aResult.get() && !aResult->isNull()) { gp_Trsf aSumTrsf = sumTrsf(); +#if OCC_VERSION_LARGE < 0x07070000 TopoDS_Shape anOrigMoved = aResult->impl().Moved(aSumTrsf); +#else + TopoDS_Shape anOrigMoved = aResult->impl().Moved(aSumTrsf, Standard_False); +#endif aResult->setImpl(new TopoDS_Shape(anOrigMoved)); } return aResult; @@ -426,7 +441,11 @@ std::shared_ptr Model_ResultPart::selectionValue(const int theInd aResult = aSelAttr->value(theIndex - 1)->value(); if (myTrsf.get() && aResult.get() && !aResult->isNull()) { gp_Trsf aSumTrsf = sumTrsf(); +#if OCC_VERSION_LARGE < 0x07070000 TopoDS_Shape anOrigMoved = aResult->impl().Moved(aSumTrsf); +#else + TopoDS_Shape anOrigMoved = aResult->impl().Moved(aSumTrsf, Standard_False); +#endif aResult->setImpl(new TopoDS_Shape(anOrigMoved)); } return aResult;