]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fixed problem with too many executions of extrusion wit hexternal sketch edges
authormpv <mikhail.ponikarov@opencascade.com>
Fri, 31 Oct 2014 16:43:53 +0000 (19:43 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Fri, 31 Oct 2014 16:43:53 +0000 (19:43 +0300)
src/Model/Model_Document.cpp
src/Model/Model_Update.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.cpp

index 2487b7c30f1b6d0b068a65299380202a0a5fa73b..59cb68ddbcc6a96864852f215a529f244260e688 100644 (file)
@@ -769,9 +769,7 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated, const bool t
 
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
-  if (theMarkUpdated) {
-    aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
-  }
+  aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TOHIDE));
   boost::static_pointer_cast<Model_Session>(Model_Session::get())
index c6a669718b51b5456b35293d41880af09acfee91..80f44ccf4e87c8861f44c12c8699b4158d63560c 100644 (file)
@@ -69,6 +69,9 @@ void Model_Update::processEvent(const boost::shared_ptr<Events_Message>& theMess
   } else if (theMessage->eventID() == kCreatedEvent || theMessage->eventID() == kUpdatedEvent) {
     boost::shared_ptr<ModelAPI_ObjectUpdatedMessage> aMsg =
         boost::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
+    if (theMessage->eventID() == kCreatedEvent) {
+      myJustCreatedOrUpdated.clear();
+    }
     const std::set<ObjectPtr>& anObjs = aMsg->objects();
     std::set<ObjectPtr>::const_iterator anObjIter = anObjs.cbegin();
     for(; anObjIter != anObjs.cend(); anObjIter++)
@@ -111,7 +114,11 @@ void Model_Update::processEvent(const boost::shared_ptr<Events_Message>& theMess
     }
   }
   myUpdated.clear();
-  // flush
+  if (theMessage->eventID() == kUpdatedEvent) {
+    // flush updates without execution now (updates are caused by this process)
+    aLoop->flush(kUpdatedEvent);
+  }
+  // flush to update display
   static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
   aLoop->flush(EVENT_DISP);
   //Events_LongOp::end(this);
index 7b1c9bf494c320a531c6cfce724a66eaffa59e16..7eff7e79bbab58a89e0d69f4eddabaa26e48494c 100644 (file)
@@ -802,6 +802,8 @@ bool SketchSolver_ConstraintGroup::addWorkplane(boost::shared_ptr<ModelAPI_Compo
 // ============================================================================
 bool SketchSolver_ConstraintGroup::updateWorkplane()
 {
+  if (!mySketch->data())
+    return false; // case sketch is deleted
   // Get parameters of workplane
   boost::shared_ptr<ModelAPI_Attribute> aDirX = mySketch->data()->attribute(
       SketchPlugin_Sketch::DIRX_ID());