X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_MultiTranslation.cpp;h=5091d98d6e68dc62dc19a109e24fb6aa9a9e93af;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=b927739d1c65c12dc7d52c21d2b7eb48996fabce;hpb=08f1aef6629e6a63cc4671d271ded4de6e826948;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp old mode 100755 new mode 100644 index b927739d1..5091d98d6 --- a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp +++ b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SketchPlugin_MultiTranslation.h" @@ -94,6 +93,11 @@ void SketchPlugin_MultiTranslation::execute() if (isUpdateFlushed) Events_Loop::loop()->setFlushed(anUpdateEvent, false); + // Save the current feature of the document, because new features may appear while executing. + // In this case, they will become current. But if the number of copies is updated from outside + // of sketch (e.g. by parameter change), the history line should not hold in sketch. + keepCurrentFeature(); + AttributeRefListPtr aRefListOfShapes = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Constraint::ENTITY_A())); AttributeRefListPtr aRefListOfTranslated = std::dynamic_pointer_cast( @@ -202,6 +206,8 @@ void SketchPlugin_MultiTranslation::execute() } } + restoreCurrentFeature(); + // send events to update the sub-features by the solver if (isUpdateFlushed) Events_Loop::loop()->setFlushed(anUpdateEvent, true); @@ -213,7 +219,6 @@ AISObjectPtr SketchPlugin_MultiTranslation::getAISObject(AISObjectPtr thePreviou return thePrevious; AISObjectPtr anAIS = SketcherPrs_Factory::translateConstraint(this, sketch(), - sketch()->coordinatePlane(), thePrevious); return anAIS; }