From: azv Date: Fri, 10 Jun 2016 04:10:28 +0000 (+0300) Subject: Send CREATED event when building tangent arc (issue #1291) X-Git-Tag: V_2.4.0~120 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=825fcb61f5890cd8176c0022765cc34ed683270a;p=modules%2Fshaper.git Send CREATED event when building tangent arc (issue #1291) --- diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index aa6e7fb4f..90cb7e541 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -766,10 +766,10 @@ void SketchPlugin_Arc::tangencyArcConstraints() Events_Loop::loop()->flush(aDeleteEvent); // Wait all constraints being created, then send update events - static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); - bool isUpdateFlushed = Events_Loop::loop()->isFlushed(anUpdateEvent); - if (isUpdateFlushed) - Events_Loop::loop()->setFlushed(anUpdateEvent, false); + static Events_ID aCreateEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED); + bool isCreateFlushed = Events_Loop::loop()->isFlushed(aCreateEvent); + if (isCreateFlushed) + Events_Loop::loop()->setFlushed(aCreateEvent, false); // Create new constraints FeaturePtr aConstraint = sketch()->addFeature(SketchPlugin_ConstraintCoincidence::ID()); @@ -780,7 +780,7 @@ void SketchPlugin_Arc::tangencyArcConstraints() aRefAttrA->setAttr(aStartAttr); aRefAttrB->setAttr(aTangPtAttr->attr()); aConstraint->execute(); - ModelAPI_EventCreator::get()->sendUpdated(aConstraint, anUpdateEvent); + ModelAPI_EventCreator::get()->sendUpdated(aConstraint, aCreateEvent); aConstraint = sketch()->addFeature(SketchPlugin_ConstraintTangent::ID()); aRefAttrA = std::dynamic_pointer_cast( @@ -790,11 +790,13 @@ void SketchPlugin_Arc::tangencyArcConstraints() aRefAttrA->setObject(aThisArc); aRefAttrB->setObject(aTangFeature); aConstraint->execute(); - ModelAPI_EventCreator::get()->sendUpdated(aConstraint, anUpdateEvent); + ModelAPI_EventCreator::get()->sendUpdated(aConstraint, aCreateEvent); // Send events to update the sub-features by the solver. - if(isUpdateFlushed) - Events_Loop::loop()->setFlushed(anUpdateEvent, true); + if(isCreateFlushed) + Events_Loop::loop()->setFlushed(aCreateEvent, true); + else + Events_Loop::loop()->flush(aCreateEvent); } }