Salome HOME
Fix for the bug #255: VTK viewer is not updated after modification of objects.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.cxx
index ceafe1eb669f408b4fbcfe5fc72bcbec1cf95f31..37eaf35001c6050e1f74bab38968ac0aaa59cef9 100644 (file)
@@ -47,6 +47,7 @@
 #include <HYDROData_Polyline3D.h>
 #include <HYDROData_Profile.h>
 #include <HYDROData_Region.h>
+#include <HYDROData_ShapesGroup.h>
 #include <HYDROData_Stream.h>
 #include <HYDROData_Zone.h>
 
@@ -350,6 +351,28 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
       setFillingColor( aFillingColor, false, false );
       setBorderColor( aBorderColor, false, false );
     }
+    else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_ShapesGroup) ) )
+    {
+      Handle(HYDROData_ShapesGroup) aShapesGroup =
+        Handle(HYDROData_ShapesGroup)::DownCast( myObject );
+
+      TopTools_SequenceOfShape aShapes;
+      aShapesGroup->GetShapes( aShapes );
+
+      BRepBuilderAPI_MakeWire aMakeWire;
+
+      for ( int i = 1, n = aShapes.Length(); i <= n; ++i )
+      {
+        TopoDS_Edge anEdge = TopoDS::Edge( aShapes.Value( i ) );
+        aMakeWire.Add( anEdge );
+      }
+
+      aMakeWire.Build();
+      TopoDS_Wire aResWire = aMakeWire.Wire();
+
+      setWire( aResWire, false, false );  
+      setBorderColor( Qt::red, false, false );
+    }
   }
  
   if ( myShape.IsNull() || !isVisible() )
@@ -671,7 +694,10 @@ void HYDROGUI_Shape::colorShapeBorder( const QColor& theColor )
 
       Handle(Prs3d_LineAspect) aBoundaryAspect = anAttributes->FaceBoundaryAspect();
       if ( !aBoundaryAspect.IsNull() )
+      {
         aBoundaryAspect->SetColor( aBorderColor );
+        anAttributes->SetFaceBoundaryAspect( aBoundaryAspect );
+      }
     }
   }
   else if ( myDisplayMode == AIS_WireFrame )