From: nds Date: Fri, 31 Jan 2014 11:13:33 +0000 (+0000) Subject: #refs 327 - Polyline is not shown during creation X-Git-Tag: BR_hydro_v_1_0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ff8d3c8919312e506334fd31e19928b09093bebe;p=modules%2Fhydro.git #refs 327 - Polyline is not shown during creation Channel --- diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index 38d16ae4..8d6729e4 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -45,7 +45,6 @@ HYDROGUI_ChannelOp::HYDROGUI_ChannelOp( HYDROGUI_Module* theModule, const bool theIsEdit ) : HYDROGUI_Operation( theModule ), myIsEdit( theIsEdit ), - myViewManager( 0 ), myPreviewPrs( 0 ) { setName( theIsEdit ? tr( "EDIT_CHANNEL" ) : tr( "CREATE_CHANNEL" ) ); @@ -237,21 +236,23 @@ void HYDROGUI_ChannelOp::onCreatePreview( const bool theIsInit ) } LightApp_Application* anApp = module()->getApp(); - if ( !myViewManager ) - myViewManager = ::qobject_cast( - anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ); + + if ( !getPreviewManager() ) + setPreviewManager( ::qobject_cast( + anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) ); - if ( myViewManager && !myPreviewPrs ) + OCCViewer_ViewManager* aViewManager = getPreviewManager(); + if ( aViewManager && !myPreviewPrs ) { - if ( OCCViewer_Viewer* aViewer = myViewManager->getOCCViewer() ) + if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) { Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext(); if ( !aCtx.IsNull() ) - myPreviewPrs = new HYDROGUI_Shape( aCtx, myEditedObject ); + myPreviewPrs = new HYDROGUI_Shape( aCtx, myEditedObject, getPreviewZLayer() ); } } - if ( !myViewManager || !myPreviewPrs ) + if ( !aViewManager || !myPreviewPrs ) return; myPreviewPrs->update( true, true ); diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.h b/src/HYDROGUI/HYDROGUI_ChannelOp.h index ddb294ef..eb15b4e8 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.h +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.h @@ -56,12 +56,12 @@ protected: virtual Handle(HYDROData_Channel) getObjectToEdit() const; + virtual HYDROGUI_Shape* getPreviewShape() const { return myPreviewPrs; }; + protected: bool myIsEdit; Handle(HYDROData_Channel) myEditedObject; - OCCViewer_ViewManager* myViewManager; - HYDROGUI_Shape* myPreviewPrs; }; diff --git a/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx b/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx index 13fd5202..0fad51be 100644 --- a/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx @@ -262,7 +262,6 @@ void HYDROGUI_ImmersibleZoneOp::onCreatePreview( const QString& thePolylineName if ( !getPreviewManager() ) setPreviewManager( ::qobject_cast( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) ); - OCCViewer_ViewManager* aViewManager = getPreviewManager(); if ( aViewManager && !myPreviewPrs ) { diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index ff22583a..ffa5d7ed 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -270,6 +270,7 @@ bool HYDROGUI_Module::deactivateModule( SUIT_Study* theStudy ) HYDROGUI_Tool::setOCCActionShown( this, OCCViewer_ViewWindow::MaximizedId, true ); + myActiveOperationMap.clear(); return LightApp_Module::deactivateModule( theStudy ); }