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)
theList.append(OCCViewer_Viewer::Type());
}
+//******************************************************
+void NewGeom_Module::connectToStudy(CAM_Study* theStudy)
+{
+ // 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, CAM application calls this method before the open() of data model
+ // the NewGeom data model is specific and during open(load) redisplay signals are flushed, so
+ // we need to connect to the viewer before it. Here, it seems the most appropriate place for this
+ // according to SALOME architecture.
+ if (!mySelector) {
+ ViewManagerList OCCViewManagers;
+ application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers);
+ if (OCCViewManagers.size() > 0) {
+ mySelector = createSelector(OCCViewManagers.first());
+ }
+ }
+ LightApp_Module::connectToStudy(theStudy);
+}
+
//******************************************************
bool NewGeom_Module::activateModule(SUIT_Study* theStudy)
{