if (module()->canEraseObject(aObj))
aObj->setDisplayed(false);
}
+ // Block fitAll command according to bug #2214
+ myEventsListener->setFitAllBlocked(true);
+
+ //Do not use eraseAll if you didn't send Redisplay event:
+ //all objects are erased from viewer, but considered as displayed in displayer
+ // Problem in bug 2218
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
#ifdef HAVE_SALOME
//issue #2159 Hide all incomplete behavior
viewer()->eraseAll();
aObj->setDisplayed(true);
}
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+
+ // UnBlock fitAll command (bug #2214)
+ myEventsListener->setFitAllBlocked(false);
}
XGUI_WorkshopListener::XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop)
: myWorkshop(theWorkshop),
- myUpdatePrefs(false)
+ myUpdatePrefs(false),
+ myBlockFitAll(false)
{
XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
}
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
//VSV FitAll updated viewer by itself
- if (aDoFitAll)
+ if (aDoFitAll && (!myBlockFitAll))
myWorkshop->viewer()->fitAll();
else
aDisplayer->updateViewer();
//! Redefinition of Events_Listener method
virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
+ //! Returns state of blocking fitAll command
+ bool isFitAllBlocked() const { return myBlockFitAll; }
+
+ //! Sets state of blocking fitAll command
+ //! \param toBlock a new blocking state
+ void setFitAllBlocked(bool toBlock) { myBlockFitAll = toBlock; }
+
signals:
/// Emitted when error in applivation happens
void errorOccurred(std::shared_ptr<Events_InfoMessage> theMsg);
ModuleBase_IWorkshop* myWorkshop; // the current workshop
bool myUpdatePrefs;
+ bool myBlockFitAll;
};
#endif