From: vsv Date: Fri, 31 Oct 2014 13:23:44 +0000 (+0300) Subject: Close context before new opening in order to clear selection modes. X-Git-Tag: V_0.5~49 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ebf12116cc92186497036ef6a374e194fcd17b90;p=modules%2Fshaper.git Close context before new opening in order to clear selection modes. --- diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 0bdf7633e..afc04003c 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include @@ -314,6 +316,20 @@ void XGUI_Displayer::openLocalContext() //aContext->OpenLocalContext(false/*use displayed objects*/, true/*allow shape decomposition*/); aContext->OpenLocalContext(); aContext->NotUseDisplayedObjects(); + + // Deactivate trihedron which can be activated in local selector + //AIS_ListOfInteractive aPrsList; + //aContext->DisplayedObjects(aPrsList, true); + + //Handle(AIS_Trihedron) aTrihedron; + //AIS_ListIteratorOfListOfInteractive aIt(aPrsList); + //for(; aIt.More(); aIt.Next()){ + // aTrihedron = Handle(AIS_Trihedron)::DownCast(aIt.Value()); + // if (!aTrihedron.IsNull()) { + // aContext->Deactivate(aTrihedron); + // break; + // } + //} } } @@ -404,7 +420,7 @@ void XGUI_Displayer::activateObjectsOutOfContext(const QIntList& theModes) ResultToAISMap::iterator aIt; Handle(AIS_InteractiveObject) anAISIO; for (aIt = myResult2AISObjectMap.begin(); aIt != myResult2AISObjectMap.end(); aIt++) { - anAISIO = (*aIt).second->impl(); + anAISIO = (*aIt).second->impl(); aContext->Load(anAISIO, -1, true); if (theModes.size() == 0) aContext->Activate(anAISIO); @@ -486,6 +502,12 @@ void XGUI_Displayer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilte Handle(AIS_InteractiveContext) aContext = AISContext(); if (aContext.IsNull()) return; + const SelectMgr_ListOfFilter& aFilters = aContext->Filters(); + SelectMgr_ListIteratorOfListOfFilter aIt(aFilters); + for (; aIt.More(); aIt.Next()) { + if (theFilter.Access() == aIt.Value().Access()) + return; + } aContext->AddFilter(theFilter); } diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index 6a3c81a9f..45f2d0ed7 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -59,6 +59,8 @@ ModuleBase_Operation* XGUI_ModuleConnector::currentOperation() const void XGUI_ModuleConnector::activateSubShapesSelection(const QIntList& theTypes) { XGUI_Displayer* aDisp = myWorkshop->displayer(); + // Close context if it was opened in order to clear stsndard selection modes + aDisp->closeLocalContexts(false); aDisp->openLocalContext(); // Convert shape types to selection types QIntList aModes;