From f40895b4d881810ef7d19c27ce6e952d72353d2c Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 31 Oct 2014 19:43:53 +0300 Subject: [PATCH] Fixed problem with too many executions of extrusion wit hexternal sketch edges --- src/Model/Model_Document.cpp | 4 +--- src/Model/Model_Update.cpp | 9 ++++++++- src/SketchSolver/SketchSolver_ConstraintGroup.cpp | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 2487b7c30..59cb68ddb 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -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::get()) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index c6a669718..80f44ccf4 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -69,6 +69,9 @@ void Model_Update::processEvent(const boost::shared_ptr& theMess } else if (theMessage->eventID() == kCreatedEvent || theMessage->eventID() == kUpdatedEvent) { boost::shared_ptr aMsg = boost::dynamic_pointer_cast(theMessage); + if (theMessage->eventID() == kCreatedEvent) { + myJustCreatedOrUpdated.clear(); + } const std::set& anObjs = aMsg->objects(); std::set::const_iterator anObjIter = anObjs.cbegin(); for(; anObjIter != anObjs.cend(); anObjIter++) @@ -111,7 +114,11 @@ void Model_Update::processEvent(const boost::shared_ptr& 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); diff --git a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp index 7b1c9bf49..7eff7e79b 100644 --- a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp @@ -802,6 +802,8 @@ bool SketchSolver_ConstraintGroup::addWorkplane(boost::shared_ptrdata()) + return false; // case sketch is deleted // Get parameters of workplane boost::shared_ptr aDirX = mySketch->data()->attribute( SketchPlugin_Sketch::DIRX_ID()); -- 2.39.2