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

src/HYDROGUI/HYDROGUI_TranslateObstacleOp.cxx
src/HYDROGUI/HYDROGUI_TranslateObstacleOp.h

index 952fe9fbdd908b91618c97751ae2687800e335b9..c66a725cfd5307a3c82dbf1f12a045157a04793b 100644 (file)
@@ -140,14 +140,16 @@ void HYDROGUI_TranslateObstacleOp::createPreview()
   // Create preview presentation if necessary
   if ( !myPreviewPrs ) {
     LightApp_Application* anApp = module()->getApp();
-    OCCViewer_ViewManager* aViewManager = ::qobject_cast<OCCViewer_ViewManager*>( 
-      anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
-  
+
+    if ( !getPreviewManager() )
+      setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( 
+                         anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
+    OCCViewer_ViewManager* aViewManager = getPreviewManager();
     if ( aViewManager ) {
       if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
         Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
         if ( !aCtx.IsNull() ) {
-          myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL );
+          myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
           myPreviewPrs->setFillingColor( myEditedObject->GetFillingColor(), false, false );
           myPreviewPrs->setBorderColor( myEditedObject->GetBorderColor(), false, false );
         }
index 5d21e04742ebd74fc061faacd397e5c173045dd7..2e63066a8519853ab73f744f47278ee6d7f63581 100644 (file)
@@ -48,6 +48,8 @@ protected:
 
   virtual bool                 processApply( int& theUpdateFlags, QString& theErrorMsg );
 
+  virtual HYDROGUI_Shape*   getPreviewShape() const { return myPreviewPrs; };
+
 private slots:
   void                         onArgumentsChanged();