From: nds Date: Fri, 31 Jan 2014 14:03:20 +0000 (+0000) Subject: #refs 327 - Polyline is not shown during creation X-Git-Tag: BR_hydro_v_1_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ccd047bf3bf7ae3e7459efbf2f81f0314357a5d1;p=modules%2Fhydro.git #refs 327 - Polyline is not shown during creation Translate obstacle. --- diff --git a/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.cxx b/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.cxx index 952fe9fb..c66a725c 100644 --- a/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.cxx +++ b/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.cxx @@ -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( - anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ); - + + if ( !getPreviewManager() ) + setPreviewManager( ::qobject_cast( + 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 ); } diff --git a/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.h b/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.h index 5d21e047..2e63066a 100644 --- a/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.h +++ b/src/HYDROGUI/HYDROGUI_TranslateObstacleOp.h @@ -48,6 +48,8 @@ protected: virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg ); + virtual HYDROGUI_Shape* getPreviewShape() const { return myPreviewPrs; }; + private slots: void onArgumentsChanged();