Salome HOME
Selector implementation for OCC viewer.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.cxx
index 6e8aa189d65e093eacbcb5bde5dfd3dababa5e08..fd48bc169f2a73f5f80a6feb9beaa1e4c6394b30 100644 (file)
@@ -357,13 +357,16 @@ void HYDROGUI_CalculationOp::createPreview()
       {
         Region& aRegion = *anIter;
         if ( aRegion.Shape )
+        {
+          aRegion.Shape->erase( false );
           delete aRegion.Shape;
+        }
 
-        aRegion.Shape = new HYDROGUI_Shape( aCtx );
+        aRegion.Shape = new HYDROGUI_Shape( aCtx, NULL );
 
-        aRegion.Shape->setFillingColor( aRegion.FillingColor, false );
-        aRegion.Shape->setBorderColor( aRegion.BorderColor, false );
-        aRegion.Shape->setFace( aRegion.SplitData.Face(), true );
+        aRegion.Shape->setFillingColor( aRegion.FillingColor, false, false );
+        aRegion.Shape->setBorderColor( aRegion.BorderColor, false, false );
+        aRegion.Shape->setFace( aRegion.SplitData.Face(), true, false );
       }
 
       //Process the draw events for viewer
@@ -387,6 +390,7 @@ void HYDROGUI_CalculationOp::closePreview()
     Region& aRegion = *anIter;
     if ( aRegion.Shape )
     {
+      aRegion.Shape->erase( false );
       delete aRegion.Shape;
       aRegion.Shape = NULL;
     }