From 9ef491f540879952217af7e01c7b092af0ccb7e4 Mon Sep 17 00:00:00 2001 From: Artem Zhidkov Date: Tue, 15 Sep 2020 15:51:09 +0300 Subject: [PATCH] Issue #19890: Shape displayed with some transparency after symmetry Use correct transformation algorithm on the Part level. --- src/FeaturesPlugin/Test/TestSymmetry_Part.py | 2 +- src/Model/Model_ResultPart.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/FeaturesPlugin/Test/TestSymmetry_Part.py b/src/FeaturesPlugin/Test/TestSymmetry_Part.py index e1853ee74..478bf3770 100644 --- a/src/FeaturesPlugin/Test/TestSymmetry_Part.py +++ b/src/FeaturesPlugin/Test/TestSymmetry_Part.py @@ -38,4 +38,4 @@ model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.SOLID, [1, 1]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.FACE, [6, 6]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.EDGE, [24, 24]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.VERTEX, [48, 48]) -model.testResultsVolumes(Symmetry_3, [-1000, 1000]) +model.testResultsVolumes(Symmetry_3, [1000, 1000]) diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index 01d7ef900..51d8879bd 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -36,6 +36,8 @@ #include +#include + #include #include @@ -197,12 +199,9 @@ std::shared_ptr Model_ResultPart::shape() ResultPtr anOrigResult = baseRef(); std::shared_ptr anOrigShape = anOrigResult->shape(); if (anOrigShape.get()) { - TopoDS_Shape aShape = anOrigShape->impl(); - if (!aShape.IsNull()) { - aShape.Move(*(myTrsf.get())); - myShape = aShape; - aResult->setImpl(new TopoDS_Shape(aShape)); - } + GeomTrsfPtr aTrsf = std::make_shared(new gp_Trsf(*myTrsf)); + GeomAlgoAPI_Transform aTransform(anOrigShape, aTrsf); + aResult = aTransform.shape(); } if (!myShape.IsNull() && aToSendUpdate) { static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); -- 2.39.2