From e5854b0139b4c56b7674d454f87144c88571bc2a Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 29 Dec 2016 19:43:00 +0300 Subject: [PATCH] #1958 Fatal error in GEOM module after Export to GEOM AIS_Trihedron problem: Axis and Point should be manually hidden when GEOM is activated. --- src/XGUI/XGUI_Workshop.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index a891e6f35..8a1379687 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -86,6 +86,10 @@ #include +#include +#include +#include + #include #include #include @@ -329,6 +333,23 @@ void XGUI_Workshop::deactivateModule() XGUI_Displayer* aDisplayer = displayer(); QObjectPtrList aDisplayed = aDisplayer->displayedObjects(); aDisplayer->deactivateObjects(aDisplayed, true); + Handle(AIS_InteractiveContext) aContext = viewer()->AISContext(); + Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(aDisplayer->getTrihedron()); + /// deactivate trihedron in selection modes + TColStd_ListOfInteger aTColModes; + aContext->ActivatedModes(aTrihedron, aTColModes); + TColStd_ListIteratorOfListOfInteger itr( aTColModes ); + for (; itr.More(); itr.Next() ) { + Standard_Integer aMode = itr.Value(); + aContext->Deactivate(aTrihedron, aMode); + } + /// Trihedron problem: objects stayed in the viewer, should be removed manually + /// otherwise in SALOME happens crash by HideAll in the viewer + aContext->Remove(aTrihedron->Position(), true); + aContext->Remove(aTrihedron->Axis(), true); + aContext->Remove(aTrihedron->XAxis(), true); + aContext->Remove(aTrihedron->YAxis(), true); + myOperationMgr->deactivate(); } -- 2.39.2