Salome HOME
Icons are shown in the object browser tree.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_PolylineOp.cxx
index ce078a5f2cd3f04f3d46f789424a7b723ea1cdbb..8ff209f50dfa3105db4fe141499aa21177e8c0b8 100755 (executable)
@@ -236,15 +236,14 @@ bool HYDROGUI_PolylineOp::processApply( int& theUpdateFlags,
 
   theUpdateFlags = UF_Model;
 
+  // the polyline should be rebuild in all viewers, where it is displayed
+  theUpdateFlags |= UF_Viewer | UF_GV_Forced;
+  theUpdateFlags |= UF_OCCViewer | UF_OCC_Forced;
+
   size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
-  if ( anActiveViewId != 0 )
-  {
-    theUpdateFlags |= UF_Viewer | UF_GV_Forced;
-  }
-  else
+  if ( anActiveViewId == 0 )
   {
     anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( module() );
-    theUpdateFlags |= UF_OCCViewer | UF_OCC_Forced;
   }
 
   if( !myIsEdit )
@@ -285,7 +284,7 @@ void HYDROGUI_PolylineOp::displayPreview()
       {
         CurveCreator_Displayer* aDisplayer = new CurveCreator_Displayer( aCtx );
         myCurve->setDisplayer( aDisplayer );
-        aDisplayer->display( myCurve->constructWire() );
+        aDisplayer->display( myCurve->constructWire(), true );
       }
     }
   }
@@ -301,7 +300,7 @@ void HYDROGUI_PolylineOp::erasePreview()
       Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
       if( !aCtx.IsNull() )
       {
-        aDisplayer->erase();
+        aDisplayer->erase( true );
       }
     }
   }