From: mpv Date: Thu, 24 Dec 2015 15:01:14 +0000 (+0300) Subject: Issue #1169 : support the width of the copied objects on undo/redo and delete X-Git-Tag: V_2.1.0~61 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b079ab2e4232782ea9fae9ca82de933020c9f267;p=modules%2Fshaper.git Issue #1169 : support the width of the copied objects on undo/redo and delete --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp index 7539c18e3..4b3bbb997 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp @@ -214,7 +214,8 @@ void SketchPlugin_ConstraintMirror::erase() if(aFeature.get()) { AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); if(aBooleanAttr.get()) { - aBooleanAttr->setValue(false); + if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo + aBooleanAttr->setValue(false); // Redisplay object as it is not copy anymore. ModelAPI_EventCreator::get()->sendUpdated(aRes, aRedispEvent); } diff --git a/src/SketchPlugin/SketchPlugin_MultiRotation.cpp b/src/SketchPlugin/SketchPlugin_MultiRotation.cpp index 68e0eab6d..3e99827d8 100755 --- a/src/SketchPlugin/SketchPlugin_MultiRotation.cpp +++ b/src/SketchPlugin/SketchPlugin_MultiRotation.cpp @@ -230,7 +230,8 @@ void SketchPlugin_MultiRotation::erase() if(aFeature.get()) { AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); if(aBooleanAttr.get()) { - aBooleanAttr->setValue(false); + if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo + aBooleanAttr->setValue(false); // Redisplay object as it is not copy anymore. ModelAPI_EventCreator::get()->sendUpdated(aRes, aRedispEvent); } diff --git a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp index df58c765d..95cf7d50e 100755 --- a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp +++ b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp @@ -217,7 +217,8 @@ void SketchPlugin_MultiTranslation::erase() if(aFeature.get()) { AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); if(aBooleanAttr.get()) { - aBooleanAttr->setValue(false); + if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo + aBooleanAttr->setValue(false); // Redisplay object as it is not copy anymore. ModelAPI_EventCreator::get()->sendUpdated(aRes, aRedispEvent); } diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.cpp b/src/SketchPlugin/SketchPlugin_SketchEntity.cpp index f29dfc139..7f08f4400 100644 --- a/src/SketchPlugin/SketchPlugin_SketchEntity.cpp +++ b/src/SketchPlugin/SketchPlugin_SketchEntity.cpp @@ -21,8 +21,4 @@ void SketchPlugin_SketchEntity::initAttributes() AttributePtr anAttr = data()->addAttribute(SketchPlugin_SketchEntity::COPY_ID(), ModelAPI_AttributeBoolean::typeId()); anAttr->setIsArgument(false); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_SketchEntity::COPY_ID()); - AttributeBooleanPtr anAttrBool = std::dynamic_pointer_cast(anAttr); - if(anAttr.get()) { - anAttrBool->setValue(false); - } }