return aView;
}
+QWidget* NewGeom_SalomeView::viewPort() const
+{
+ SUIT_ViewManager* aMgr = myViewer->getViewManager();
+ OCCViewer_ViewWindow* aWnd = static_cast<OCCViewer_ViewWindow*>(aMgr->getActiveView());
+ return aWnd->getViewPort();
+}
+
//**********************************************
//**********************************************
//**********************************************
return myWorkshop->salomeConnector()->viewer()->activeView();
} else {
AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
- return (aViewer->activeViewWindow()) ? aViewer->activeViewWindow()->viewPort()->getView() :
+ return (aViewer->activeViewWindow()) ? aViewer->activeViewWindow()->viewPortApp()->getView() :
Handle(V3d_View)();
}
}
} else {
AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
if (aViewer->activeViewWindow())
- aViewer->activeViewWindow()->viewPort()->fitAll();
+ aViewer->activeViewWindow()->viewPortApp()->fitAll();
}
}
this, SIGNAL(deleteView(ModuleBase_IViewWindow*)));
connect(aViewer, SIGNAL(viewCreated(ModuleBase_IViewWindow*)),
- this, SIGNAL(viewCreated(ModuleBase_IViewWindow*)));
+ this, SLOT(onViewCreated(ModuleBase_IViewWindow*)));
connect(aViewer, SIGNAL(activated(ModuleBase_IViewWindow*)),
this, SIGNAL(activated(ModuleBase_IViewWindow*)));
bool XGUI_ViewerProxy::eventFilter(QObject *theObject, QEvent *theEvent)
{
- AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
- bool isViewPort = theObject == aViewer->activeViewWindow()->viewPort();
- if (isViewPort)
- {
- if (theEvent->type() == QEvent::Enter) {
- emit enterViewPort();
- }
- else if (theEvent->type() == QEvent::Leave) {
- emit leaveViewPort();
- }
+ if (theEvent->type() == QEvent::Enter) {
+ emit enterViewPort();
+ }
+ else if (theEvent->type() == QEvent::Leave) {
+ emit leaveViewPort();
}
return ModuleBase_IViewer::eventFilter(theObject, theEvent);
}
emit deleteView(theWnd);
}
+void XGUI_ViewerProxy::onViewCreated(ModuleBase_IViewWindow* theWnd)
+{
+ theWnd->viewPort()->installEventFilter(this);
+
+ emit viewCreated(theWnd);
+}
+
void XGUI_ViewerProxy::onViewCreated(AppElements_ViewWindow* theWnd)
{
theWnd->viewPort()->installEventFilter(this);