From 10188f6e049f86beb78e076a88d28c298c9812da Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 12 Dec 2017 14:37:51 +0300 Subject: [PATCH] Keep also multiple modificators on the root shape of the body. --- src/Model/Model_BodyBuilder.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 7807464e6..2adab6e8f 100755 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -284,7 +284,8 @@ TNaming_Builder* Model_BodyBuilder::builder(const int theTag) std::map::iterator aFind = myBuilders.find(theTag); if (aFind == myBuilders.end()) { std::shared_ptr aData = std::dynamic_pointer_cast(data()); - myBuilders[theTag] = new TNaming_Builder(aData->shapeLab().FindChild(theTag)); + myBuilders[theTag] = new TNaming_Builder( + theTag == 0 ? aData->shapeLab() : aData->shapeLab().FindChild(theTag)); aFind = myBuilders.find(theTag); } return aFind->second; @@ -419,9 +420,9 @@ void Model_BodyBuilder::loadAndOrientModifiedShapes ( if(theIsStoreAsGenerated) { // Here we store shapes as generated, to avoid problem when one parent shape produce // several child shapes. In this case naming could not determine which shape to select. - builder(aBuilderTag)->Generated(aRoot,aNewShape); + builder(aBuilderTag)->Generated(aRoot, aNewShape); } else { - builder(aBuilderTag)->Modify(aRoot,aNewShape); + builder(aBuilderTag)->Modify(aRoot, aNewShape); } if(isBuilt) { if(theIsStoreSeparate) { @@ -443,6 +444,13 @@ void Model_BodyBuilder::loadAndOrientModifiedShapes ( if(theIsStoreSeparate) { aTag++; } + } else if (aResultShape->isSame(*anIt)) { + // keep the modification evolution on the root level (2241 - history propagation issue) + if(theIsStoreAsGenerated) { + builder(0)->Generated(aRoot, aNewShape); + } else { + builder(0)->Modify(aRoot, aNewShape); + } } } } -- 2.39.2