Salome HOME
Selector implementation for OCC viewer.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.cxx
index 3e1a5dc83dfa21297172dbdade6877075455d123..fd48bc169f2a73f5f80a6feb9beaa1e4c6394b30 100644 (file)
@@ -116,8 +116,7 @@ void HYDROGUI_CalculationOp::startOperation()
           continue;
 
         Region aRegion;
-        // aRegion.SplitData.Path = aSplitZone->GetPainterPath();
-        // aRegion.SplitData.ZoneNames ???
+        aRegion.SplitData.Shape = aDataRegion->Face();
 
         aRegion.FillingColor = aDataRegion->GetFillingColor();
         aRegion.BorderColor  = aDataRegion->GetBorderColor();
@@ -251,6 +250,8 @@ bool HYDROGUI_CalculationOp::processApply( int&     theUpdateFlags,
       continue;
 
     // Fill the zone data
+    aDataRegion->SetFace( aRegion.SplitData.Face() );
+
     aDataRegion->SetName( aRegion.RegionName );
     aDataRegion->SetBorderColor( aRegion.BorderColor );
     aDataRegion->SetFillingColor( aRegion.FillingColor );
@@ -356,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->setPath( aRegion.SplitData.Path, 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
@@ -386,6 +390,7 @@ void HYDROGUI_CalculationOp::closePreview()
     Region& aRegion = *anIter;
     if ( aRegion.Shape )
     {
+      aRegion.Shape->erase( false );
       delete aRegion.Shape;
       aRegion.Shape = NULL;
     }