Salome HOME
Issue #1169 : support the width of the copied objects on undo/redo and delete
authormpv <mpv@opencascade.com>
Thu, 24 Dec 2015 15:01:14 +0000 (18:01 +0300)
committermpv <mpv@opencascade.com>
Thu, 24 Dec 2015 15:01:14 +0000 (18:01 +0300)
src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp
src/SketchPlugin/SketchPlugin_MultiRotation.cpp
src/SketchPlugin/SketchPlugin_MultiTranslation.cpp
src/SketchPlugin/SketchPlugin_SketchEntity.cpp

index 7539c18e38ab868e7a4c6c327130ec435eb141cb..4b3bbb997422f734031314f85a4ac833366c00c8 100755 (executable)
@@ -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);
             }
index 68e0eab6da41e116d6f308bfa5d4b13bb2c79a06..3e99827d8888f6609260001986ac089a2aaca179 100755 (executable)
@@ -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);
             }
index df58c765db0a0f62a52f68ed0a069d5d60f06766..95cf7d50e514945aaa76f32887001a71a2fe6300 100755 (executable)
@@ -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);
             }
index f29dfc1391dfe661ce98ec2f780e2107b77a71ed..7f08f44005a96a4098333315f23b101d85064366 100644 (file)
@@ -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<ModelAPI_AttributeBoolean>(anAttr);
-  if(anAttr.get()) {
-    anAttrBool->setValue(false);
-  }
 }