From d08653632bfa61de5af865057cad11393a0b4a6b Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 15 Feb 2016 14:23:40 +0300 Subject: [PATCH] Overconstraint situation: redisplay objects through the events loop. --- .../PartSet_OverconstraintListener.cpp | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index 435ceca00..52d84913e 100755 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -148,33 +148,16 @@ bool PartSet_OverconstraintListener::repairConflictingObjects( void PartSet_OverconstraintListener::redisplayObjects( const std::set& theObjects) { -/*static Events_Loop* aLoop = Events_Loop::loop(); - static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_UPDATED); + static Events_Loop* aLoop = Events_Loop::loop(); + static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); std::set::const_iterator anIt = theObjects.begin(), aLast = theObjects.end(); - for (; anIt != aLast; anIt++) { + for (; anIt != aLast; anIt++) aECreator->sendUpdated(*anIt, EVENT_DISP); - //#ifdef DEBUG_FEATURE_OVERCONSTRAINT_LISTENER - // QString anInfoStr = ModuleBase_Tools::objectInfo(*anIt); - // qDebug(QString("PartSet_OverconstraintListener::SEND UPDATED: %1").arg(anInfoStr).toStdString().c_str()); - //#endif - } - aLoop->flush(EVENT_DISP);*/ - - XGUI_Displayer* aDisplayer = workshop()->displayer(); - bool aHidden; - std::set::const_iterator anIt = theObjects.begin(), aLast = theObjects.end(); - for (; anIt != aLast; anIt++) { - ObjectPtr anObject = *anIt; - aHidden = !anObject->data() || !anObject->data()->isValid() || - anObject->isDisabled() || (!anObject->isDisplayed()); - if (!aHidden) - aDisplayer->redisplay(anObject, false); - } - aDisplayer->updateViewer(); + aLoop->flush(EVENT_DISP); } XGUI_Workshop* PartSet_OverconstraintListener::workshop() const -- 2.39.2