// restore previous view of presentations
bool isModified = redisplayObjects(myItemObjects, false);
std::set<std::shared_ptr<ModelAPI_Object> > aHiddenObjects = myHiddenObjects;
- isModified = displayHiddenObjects(aHiddenObjects, false) || isModified;
+ isModified = displayHiddenObjects(aHiddenObjects, myHiddenObjects, false) || isModified;
if (isModified && isToFlushRedisplay)
Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
}
if (isModified) {
bool isRedisplayed = redisplayObjects(aRestoredObjects, false);
- isRedisplayed = displayHiddenObjects(aRestoredObjects, false) || isRedisplayed;
+ isRedisplayed = displayHiddenObjects(aRestoredObjects, myHiddenObjects, false)
+ || isRedisplayed;
if (isRedisplayed)
Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
// should be after flush of redisplay to have items object to be updated
//********************************************************************
bool XGUI_FacesPanel::displayHiddenObjects(
const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects,
+ std::set<std::shared_ptr<ModelAPI_Object> >& theHiddenObjects,
const bool isToFlushRedisplay)
{
if (theObjects.empty())
{
ObjectPtr anObject = *anIt;
// if the object was hidden by this panel
- if (anObject->isDisplayed() || myHiddenObjects.find(anObject) == myHiddenObjects.end())
+ if (anObject->isDisplayed() || theHiddenObjects.find(anObject) == theHiddenObjects.end())
continue;
- myHiddenObjects.erase(anObject);
+ theHiddenObjects.erase(anObject);
anObject->setDisplayed(true); // it means that the object is hidden by hide all faces
ModelAPI_EventCreator::get()->sendUpdated(anObject, aDispEvent);
isModified = true;
bool isModified = false;
if (useTransparency()) {
std::set<std::shared_ptr<ModelAPI_Object> > aHiddenObjects = myHiddenObjects;
- isModified = displayHiddenObjects(aHiddenObjects, false);
+ isModified = displayHiddenObjects(aHiddenObjects, myHiddenObjects, false);
}
else
isModified = hideEmptyObjects();
/// \param theObjects container of objects
/// \param isToFlushRedisplay flag if redisplay should be flushed immediatelly
/// \return true if some of objects was redisplayed
- bool redisplayObjects(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects,
- const bool isToFlushRedisplay);
+ static bool redisplayObjects(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects,
+ const bool isToFlushRedisplay);
/// Display objects if the objects are in a container of hidden by this pane.
/// \param theObjects container of objects
+ /// \param theHiddenObjects hidden objects, if object is in the container, it should be removed
/// \param isToFlushRedisplay flag if redisplay should be flushed immediatelly
/// \return true if some of objects was redisplayed
- bool displayHiddenObjects(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects,
- const bool isToFlushRedisplay);
+ static bool displayHiddenObjects(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects,
+ std::set<std::shared_ptr<ModelAPI_Object> >& theHiddenObjects,
+ const bool isToFlushRedisplay);
/// Iterates by items and hide objects where all sub-shapes are hidden
/// \return true if some of objects was redisplayed