]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
#refs 327 - Polyline is not shown during creation
authornds <nds@opencascade.com>
Fri, 31 Jan 2014 11:13:33 +0000 (11:13 +0000)
committernds <nds@opencascade.com>
Fri, 31 Jan 2014 11:13:33 +0000 (11:13 +0000)
Channel

src/HYDROGUI/HYDROGUI_ChannelOp.cxx
src/HYDROGUI/HYDROGUI_ChannelOp.h
src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx
src/HYDROGUI/HYDROGUI_Module.cxx

index 38d16ae440520b49ededb060e2939842a09b3827..8d6729e4fde1bd0a390d81986dad5840d8e60ecd 100644 (file)
@@ -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<OCCViewer_ViewManager*>( 
-      anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
+  
+  if ( !getPreviewManager() )
+    setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( 
+                       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 );
index ddb294ef771e4c59b7e791e2e69f9e279c7d7d01..eb15b4e861515b35970a17934079f49412935369 100644 (file)
@@ -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;
 };
 
index 13fd5202367a17fc3d1318c28139395c7203774e..0fad51be853d32d9db3b0d334883fa6c9677960e 100644 (file)
@@ -262,7 +262,6 @@ void HYDROGUI_ImmersibleZoneOp::onCreatePreview( const QString& thePolylineName
   if ( !getPreviewManager() )
     setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( 
                        anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
-
   OCCViewer_ViewManager* aViewManager = getPreviewManager();
   if ( aViewManager && !myPreviewPrs )
   {
index ff22583a28874d74ef0cd5ab86f0d5196312b5ec..ffa5d7ed5893d6d4889023535544a3792898c796 100644 (file)
@@ -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 );
 }