From cdaca32d1615752053e09dec9d1d969941ebe425 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 14 Dec 2015 09:29:29 +0300 Subject: [PATCH] #1111 Sketch invisible --- src/NewGeom/NewGeom_Module.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/NewGeom/NewGeom_Module.cpp b/src/NewGeom/NewGeom_Module.cpp index 7bc410a0b..dbf3bf669 100644 --- a/src/NewGeom/NewGeom_Module.cpp +++ b/src/NewGeom/NewGeom_Module.cpp @@ -120,6 +120,19 @@ void NewGeom_Module::initialize(CAM_Application* theApp) LightApp_Module::initialize(theApp); inspectSalomeModules(); + // if there are created viewer managers, we should try to create viewer + // selector and initialize viewer with it. It sets interactive contect to the + // proxy viewer. If study is opened, startApplication causes the objects visualization, + // AIS context should be initialized in the viewer before this. + if (!mySelector) { + ViewManagerList OCCViewManagers; + application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers); + if (OCCViewManagers.size() > 0) { + // the viewer is restored by "store_visual_state" + mySelector = createSelector(OCCViewManagers.first()); + } + } + myWorkshop->startApplication(); LightApp_Application* anApp = dynamic_cast(theApp); if (anApp) -- 2.39.2