]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#1111 Sketch invisible
authornds <nds@opencascade.com>
Mon, 14 Dec 2015 06:29:29 +0000 (09:29 +0300)
committernds <nds@opencascade.com>
Mon, 14 Dec 2015 06:29:59 +0000 (09:29 +0300)
src/NewGeom/NewGeom_Module.cpp

index 7bc410a0b88e804ba8f87478dada54db0f94b42c..dbf3bf6696d9a87034bf6306277c2eac15211cb0 100644 (file)
@@ -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<LightApp_Application*>(theApp);
   if (anApp)