From 27347eb3e6d5c3b2c1c1c297d1f8b5032dba2a43 Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 28 Jan 2019 11:35:41 +0300 Subject: [PATCH] Fill: consider the list of tools while storing the history of modified shapes. --- src/CollectionPlugin/Test/TestGroupMove6.py | 13 +++++++------ src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp | 6 ++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/CollectionPlugin/Test/TestGroupMove6.py b/src/CollectionPlugin/Test/TestGroupMove6.py index 9807143bf..5229e0c27 100644 --- a/src/CollectionPlugin/Test/TestGroupMove6.py +++ b/src/CollectionPlugin/Test/TestGroupMove6.py @@ -71,17 +71,17 @@ selectionList = Group_3.feature().selectionList("group_list") assert(selectionList.size() == 19) assert(aFactory.validate(Group_3.feature())) -# groups related to the copied box should stay untouched +# groups related to the copied box should contain only the elements connected with the original box selectionList = Group_4.feature().selectionList("group_list") assert(selectionList.size() == 1) assert(aFactory.validate(Group_4.feature())) selectionList = Group_5.feature().selectionList("group_list") -assert(selectionList.size() == 6) +assert(selectionList.size() == 3) assert(aFactory.validate(Group_5.feature())) selectionList = Group_6.feature().selectionList("group_list") -assert(selectionList.size() == 12) +assert(selectionList.size() == 3) assert(aFactory.validate(Group_6.feature())) @@ -108,10 +108,11 @@ assert(selectionList.size() == 16) assert(aFactory.validate(Group_2.feature())) selectionList = Group_3.feature().selectionList("group_list") -assert(selectionList.size() == 19) +# one of edges should disappear, due to its belonging to the face of the filling +assert(selectionList.size() == 18) assert(aFactory.validate(Group_3.feature())) -# groups related to the copied box should stay untouched +# groups related to the copied box should be split correspondingly selectionList = Group_4.feature().selectionList("group_list") assert(selectionList.size() == 1) assert(aFactory.validate(Group_4.feature())) @@ -121,7 +122,7 @@ assert(selectionList.size() == 6) assert(aFactory.validate(Group_5.feature())) selectionList = Group_6.feature().selectionList("group_list") -assert(selectionList.size() == 12) +assert(selectionList.size() == 5) assert(aFactory.validate(Group_6.feature())) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp index 56608a692..27b46bc03 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp @@ -166,6 +166,9 @@ void FeaturesPlugin_BooleanFill::execute() std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); + // tools should be added to the list to fulfill the correct history of modification + aListWithObject.insert(aListWithObject.end(), aTools.begin(), aTools.end()); + ListOfShape aUsedTools = aTools; aUsedTools.insert(aUsedTools.end(), aPlanes.begin(), aPlanes.end()); @@ -261,6 +264,9 @@ void FeaturesPlugin_BooleanFill::execute() ListOfShape aBaseShapes; aBaseShapes.push_back(aCompSolid); + // tools should be added to the list to fulfill the correct history of modification + aBaseShapes.insert(aBaseShapes.end(), aTools.begin(), aTools.end()); + FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, aUsedTools, aMakeShapeList, aResultShape); setResult(aResultBody, aResultIndex); -- 2.39.2