From: asv Date: Tue, 23 Aug 2005 12:23:30 +0000 (+0000) Subject: new function initView() is added in order to easily customize creation of a new view... X-Git-Tag: T_3_0_2a1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=96482edf6a358d7fc70505dbd804bf46999b4dca;p=modules%2Fgui.git new function initView() is added in order to easily customize creation of a new view window in SOCC. --- diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index acfb8cf2e..bf90792a5 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -88,16 +88,23 @@ void OCCViewer_Viewer::setBackgroundColor( const QColor& c ) myBgColor = c; } -SUIT_ViewWindow* OCCViewer_Viewer::createView( SUIT_Desktop* theDesktop ) +void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view ) { - OCCViewer_ViewWindow* res = new OCCViewer_ViewWindow(theDesktop, this); - res->initLayout(); + if ( view ) { + view->initLayout(); + + OCCViewer_ViewPort3d* vp3d = view->getViewPort(); + if ( vp3d ) + vp3d->setBackgroundColor( myBgColor ); + } +} - OCCViewer_ViewPort3d* vp3d = res->getViewPort(); - if ( vp3d ) - vp3d->setBackgroundColor( myBgColor ); - return res; +SUIT_ViewWindow* OCCViewer_Viewer::createView( SUIT_Desktop* theDesktop ) +{ + OCCViewer_ViewWindow* view = new OCCViewer_ViewWindow(theDesktop, this); + initView( view ); + return view; } //********************************************************************* diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index d42be6a25..64e153ad3 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -15,6 +15,7 @@ class SUIT_ViewWindow; class SUIT_Desktop; +class OCCViewer_ViewWindow; struct viewAspect { @@ -121,6 +122,9 @@ public: signals: void selectionChanged(); +protected: + void initView( OCCViewer_ViewWindow* view ); + protected slots: void onMousePress(SUIT_ViewWindow*, QMouseEvent*); void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);