From: nds Date: Tue, 25 Apr 2017 12:03:46 +0000 (+0300) Subject: Issue #2141 Sketch : horizontal constraint not applicated when I select a line X-Git-Tag: V_2.7.1~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b73fe58710175c7a9de443537e7630c16aeabd04;p=modules%2Fshaper.git Issue #2141 Sketch : horizontal constraint not applicated when I select a line --- diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index 10042d488..f0be4ae9e 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -386,15 +386,7 @@ void ModuleBase_ModelWidget::updateObject(ObjectPtr theObject) #ifdef DEBUG_WIDGET_INSTANCE qDebug("ModuleBase_ModelWidget::updateObject"); #endif - ModuleBase_Tools::blockUpdateViewer(true); - // Fix the problem of not previewed results of constraints applied. Flush Create/Delete - // (for the sketch result) to start processing of the sketch in the solver. - // TODO: these flushes should be moved in a separate method provided by Model - Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED)); - Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); - Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED)); - - ModuleBase_Tools::blockUpdateViewer(false); + ModuleBase_Tools::flushUpdated(theObject); emit objectUpdated(); } } diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index cca2ba2c5..53ee53347 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -701,7 +701,12 @@ void flushUpdated(ObjectPtr theObject) { blockUpdateViewer(true); + // Fix the problem of not previewed results of constraints applied. Flush Create/Delete + // (for the sketch result) to start processing of the sketch in the solver. + // TODO: these flushes should be moved in a separate method provided by Model + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED)); Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED)); blockUpdateViewer(false); }