SalomeApp_VTKSelector* mySelector;
public:
- Viewer(SalomeApp_Application* theApp, TViewerMap& theViewerMap)
+ Viewer(VisuGUI_Module* theModule, TViewerMap& theViewerMap)
{
- myViewManager = new SVTK_ViewManager( theApp->activeStudy(), theApp->desktop() );
+ SalomeApp_Application* anApp = theModule->getApp();
+ myViewManager = new SVTK_ViewManager( anApp->activeStudy(), anApp->desktop() );
SVTK_Viewer* aViewer = (SVTK_Viewer*)myViewManager->getViewModel();
- mySelector = new SalomeApp_VTKSelector( aViewer, theApp->selectionMgr() );
- theApp->addViewManager( myViewManager );
- theViewerMap.insert(TViewerMap::value_type(myViewManager,PViewer(this)));
+ mySelector = new SalomeApp_VTKSelector( aViewer, anApp->selectionMgr() );
+ anApp->addViewManager( myViewManager );
+ theViewerMap.insert(TViewerMap::value_type(myViewManager,PViewer(this)));
+ QObject::connect( myViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
+ theModule, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
+
//aViewer->setBackgroundColor( Qt::darkGreen );
myViewManager->createViewWindow();
}
-
+
virtual
~Viewer()
{
createAction( GAUSS_NEW_VIEWER, tr("MEN_NEW_VIEWER"), QIconSet(),
tr("MEN_NEW_VIEWER"), "", 0, this, false,
this, SLOT(onCreateViewManager()));
+
createMenu( GAUSS_NEW_VIEWER, aMenuId, 10 ); // new viewer
}
VisuGUI_Module
::onCreateViewManager()
{
- new Viewer(getApp(),myViewerMap);
+ new Viewer(this,myViewerMap);
}