]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correct update of tree on abort operation
authormpv <mikhail.ponikarov@opencascade.com>
Fri, 16 May 2014 07:30:21 +0000 (11:30 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Fri, 16 May 2014 07:30:21 +0000 (11:30 +0400)
src/Model/Model_Document.cpp
src/SketchPlugin/SketchPlugin_Feature.cpp

index 73e6adbc75d6828058dbc12b6b5f996943cf3439..7618babe23c484dab3d700d19fe30d6b3dc6856b 100644 (file)
@@ -196,6 +196,7 @@ void Model_Document::finishOperation()
 void Model_Document::abortOperation()
 {
   myDoc->AbortCommand();
+  synchronizeFeatures();
   // abort for all subs
   set<string>::iterator aSubIter = mySubs.begin();
   for(; aSubIter != mySubs.end(); aSubIter++)
index 00c849fc9e1023abf5aa5c6f842c8852a6055722..e75bc01e6aa72beb9741ee463d17bfe150e8c232 100644 (file)
@@ -18,13 +18,15 @@ void SketchPlugin_Feature::setData(boost::shared_ptr<ModelAPI_Data> theData)
   for(int a = 0; a < aSketches && !mySketch; a++) {
     boost::shared_ptr<SketchPlugin_Sketch> aSketch = 
       boost::dynamic_pointer_cast<SketchPlugin_Sketch>(document()->feature("Construction", a));
-    std::list<boost::shared_ptr<ModelAPI_Feature> > aList = 
-      aSketch->data()->reflist(SKETCH_ATTR_FEATURES)->list();
-    std::list<boost::shared_ptr<ModelAPI_Feature> >::iterator aSub = aList.begin();
-    for(; aSub != aList.end(); aSub++) {
-      if ((*aSub)->data()->isEqual(theData)) {
-        mySketch = aSketch.get();
-        break;
+    if (aSketch) {
+      std::list<boost::shared_ptr<ModelAPI_Feature> > aList = 
+        aSketch->data()->reflist(SKETCH_ATTR_FEATURES)->list();
+      std::list<boost::shared_ptr<ModelAPI_Feature> >::iterator aSub = aList.begin();
+      for(; aSub != aList.end(); aSub++) {
+        if ((*aSub)->data()->isEqual(theData)) {
+          mySketch = aSketch.get();
+          break;
+        }
       }
     }
   }