X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Displayer.cpp;h=c79aeafacef1eda8f17476e08c88047584c69a7c;hb=75708cdfd8653e625bfb7aee667a7bb31867f292;hp=ff4127e2f2c1cae1504cf837b3960f531759c1ac;hpb=bf28130e010a4dbffe57cb19c81e5965cdb817cd;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index ff4127e2f..c79aeafac 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -46,6 +46,9 @@ #include #include +#include +#include + #include const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse selection sensitivity @@ -301,6 +304,19 @@ void XGUI_Displayer::redisplay(ObjectPtr theObject, bool theUpdateViewer) } } +void XGUI_Displayer::redisplayObjects() +{ + // redisplay objects visualized in the viewer + static Events_ID EVENT_DISP = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY); + static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); + QObjectPtrList aDisplayed = myWorkshop->displayer()->displayedObjects(); + QObjectPtrList::const_iterator anIt = aDisplayed.begin(), aLast = aDisplayed.end(); + for (; anIt != aLast; anIt++) { + aECreator->sendUpdated(*anIt, EVENT_DISP); + } + Events_Loop::loop()->flush(EVENT_DISP); +} + void XGUI_Displayer::deactivate(ObjectPtr theObject, const bool theUpdateViewer) { #ifdef DEBUG_DEACTIVATE @@ -326,6 +342,17 @@ void XGUI_Displayer::deactivate(ObjectPtr theObject, const bool theUpdateViewer) } } +void XGUI_Displayer::deactivateObjects(const QObjectPtrList& theObjList, + const bool theUpdateViewer) +{ + QObjectPtrList::const_iterator anIt = theObjList.begin(), aLast = theObjList.end(); + for (; anIt != aLast; anIt++) { + deactivate(*anIt, false); + } + if (theUpdateViewer) + updateViewer(); +} + void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theModes) { if (!isVisible(theObject)) @@ -783,6 +810,24 @@ XGUI_Displayer::DisplayMode XGUI_Displayer::displayMode(ObjectPtr theObject) con return (XGUI_Displayer::DisplayMode) aAISIO->DisplayMode(); } +void XGUI_Displayer::deactivateSelectionFilters() +{ + Handle(AIS_InteractiveContext) aContext = AISContext(); + if (!myAndFilter.IsNull() && !aContext.IsNull()) { + bool aFound = false; + const SelectMgr_ListOfFilter& aFilters = aContext->Filters(); + SelectMgr_ListIteratorOfListOfFilter anIt(aFilters); + for (; anIt.More() && !aFound; anIt.Next()) { + Handle(SelectMgr_Filter) aFilter = anIt.Value(); + aFound = aFilter == myAndFilter; + } + if (aFound) { + aContext->RemoveFilter(myAndFilter); + myAndFilter.Nullify(); + } + } +} + void XGUI_Displayer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) { Handle(AIS_InteractiveContext) aContext = AISContext(); @@ -954,7 +999,6 @@ bool XGUI_Displayer::customizeObject(ObjectPtr theObject) } bool isCustomized = aCustomPrs.get() && aCustomPrs->customisePresentation(aResult, anAISObj, myCustomPrs); - myWorkshop->module()->customizeObject(theObject); return isCustomized; }