Salome HOME
Fix for the bug #45: check and warning when the same image is used in 2 arguments.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.cxx
index adbed36710e04d0a30fd0d3a854943331d80ab82..4ba2ed2dd7422ba0768d12003154d2bfb9796140 100644 (file)
@@ -37,6 +37,7 @@
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Graphic3d_MaterialAspect.hxx>
 
+#include <HYDROData_Channel.h>
 #include <HYDROData_Document.h>
 #include <HYDROData_Image.h>
 #include <HYDROData_ImmersibleZone.h>
@@ -82,7 +83,7 @@ HYDROGUI_Shape::HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext
 
 HYDROGUI_Shape::~HYDROGUI_Shape()
 {
-  erase();
+  erase( false );
 
   if ( !myShape.IsNull() )
     myShape.Nullify();
@@ -317,6 +318,21 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
       QColor aFillingColor = aStream->GetFillingColor();
       QColor aBorderColor = aStream->GetBorderColor();
 
+      setFillingColor( aFillingColor, false, false );
+      setBorderColor( aBorderColor, false, false );
+    }
+    else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Channel) ) )
+    {
+      Handle(HYDROData_Channel) aChannel =
+        Handle(HYDROData_Channel)::DownCast( myObject );
+
+      TopoDS_Face aChannelShape = TopoDS::Face( aChannel->GetTopShape() );
+
+      setShape( aChannelShape, false, false );
+
+      QColor aFillingColor = aChannel->GetFillingColor();
+      QColor aBorderColor = aChannel->GetBorderColor();
+
       setFillingColor( aFillingColor, false, false );
       setBorderColor( aBorderColor, false, false );
     }