Salome HOME
Creat\Edit stream operation.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.cxx
index 9e36f73d2307986c0eb7ae74eb90949fe407f5b1..86f12ef42fa205f20c7e654b269a7d057a423e85 100644 (file)
 #include <HYDROData_Document.h>
 #include <HYDROData_Image.h>
 #include <HYDROData_ImmersibleZone.h>
+#include <HYDROData_Obstacle.h>
 #include <HYDROData_PolylineXY.h>
+#include <HYDROData_Profile.h>
 #include <HYDROData_Region.h>
+#include <HYDROData_Stream.h>
 #include <HYDROData_Zone.h>
-#include <HYDROData_Obstacle.h>
-#include <HYDROData_Profile.h>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Wire.hxx>
@@ -169,25 +170,6 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
 
       TopoDS_Face aZoneFace = TopoDS::Face( aZone->GetShape() );
 
-      // Generate the filling color for zone
-      QStringList aGeomObjectsNames;
-
-      HYDROData_SequenceOfObjects aRefObjects = aZone->GetGeometryObjects();
-      HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects );
-      for ( ; anIter.More(); anIter.Next() )
-      {
-        Handle(HYDROData_Object) aRefbject = 
-          Handle(HYDROData_Object)::DownCast( anIter.Value() );
-        if ( aRefbject.IsNull() )
-          continue;
-
-        QString aRefObjectName = aRefbject->GetName();
-        if ( aRefObjectName.isEmpty() )
-          continue;
-
-        aGeomObjectsNames.append( aRefObjectName );
-      }
-       
       setFace( aZoneFace, false, false );
       if (aZone->IsMergingNeed() && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN )
       {
@@ -196,6 +178,25 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
       }
       else
       {
+        // Generate the filling color for zone
+        QStringList aGeomObjectsNames;
+
+        HYDROData_SequenceOfObjects aRefObjects = aZone->GetGeometryObjects();
+        HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects );
+        for ( ; anIter.More(); anIter.Next() )
+        {
+          Handle(HYDROData_Object) aRefbject = 
+            Handle(HYDROData_Object)::DownCast( anIter.Value() );
+          if ( aRefbject.IsNull() )
+            continue;
+
+          QString aRefObjectName = aRefbject->GetName();
+          if ( aRefObjectName.isEmpty() )
+            continue;
+
+          aGeomObjectsNames.append( aRefObjectName );
+        }
+
         setFillingColor( HYDROGUI_Tool::GenerateFillingColor( aDocument, aGeomObjectsNames ) );
       }
     }
@@ -304,6 +305,15 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
 
       setWire( aProfileWire, false, false );  
     }
+    else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Stream) ) )
+    {
+      Handle(HYDROData_Stream) aStream =
+        Handle(HYDROData_Stream)::DownCast( myObject );
+
+      TopoDS_Shell aStreamShape = TopoDS::Shell( aStream->GetTopShape() );
+
+      setShape( aStreamShape, false, false );
+    }
   }
  
   if ( myShape.IsNull() || !isVisible() )