Salome HOME
Fix for the bug #255: VTK viewer is not updated after modification of objects.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataModel.cxx
index 81a96bfd4814423896f1d89fb183f6966b25ce88..e1a64a838c2d86a0e36378a236d6eeacb3b6ad47 100644 (file)
@@ -877,11 +877,34 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent,
     Handle(HYDROData_Channel) aChannelObj =
       Handle(HYDROData_Channel)::DownCast( aDataObj );
 
-    Handle(HYDROData_Profile) aProfile = aChannelObj->GetProfile();
+    LightApp_DataObject* aGuideLineSect = 
+      createObject( aGuiObj, tr( "CHANNEL_GUIDE_LINE" ), aGuiObj->entry() );
     Handle(HYDROData_Polyline3D) aGuideLine = aChannelObj->GetGuideLine();
+    if ( !aGuideLine.IsNull() && !aGuideLine->IsRemoved() ) {
+      createObject( aGuideLineSect, aGuideLine, aGuiObj->entry(), false );
+    }
+
+    LightApp_DataObject* aProfileSect = 
+      createObject( aGuiObj, tr( "CHANNEL_PROFILE" ), aGuiObj->entry() );
+    Handle(HYDROData_Profile) aProfile = aChannelObj->GetProfile();
+    if ( !aProfile.IsNull() && !aProfile->IsRemoved() ) {
+      createObject( aProfileSect, aProfile, aGuiObj->entry(), false );
+    }
+  }
+  else if ( anObjectKind == KIND_STREAM )
+  {
+    Handle(HYDROData_Stream) aStreamObj =
+      Handle(HYDROData_Stream)::DownCast( aDataObj );
+
+    LightApp_DataObject* aHydraulicAxisSect = 
+      createObject( aGuiObj, tr( "STREAM_HYDRAULIC_AXIS" ), aGuiObj->entry() );
+    Handle(HYDROData_PolylineXY) aHydraulicAxis = aStreamObj->GetHydraulicAxis();
+    if ( !aHydraulicAxis.IsNull() && !aHydraulicAxis->IsRemoved() ) {
+      createObject( aHydraulicAxisSect, aHydraulicAxis, aGuiObj->entry(), false );
+    }
 
-    createObject( aGuiObj, aProfile, aGuiObj->entry(), false );
-    createObject( aGuiObj, aGuideLine, aGuiObj->entry(), false );
+    HYDROData_SequenceOfObjects aProfiles = aStreamObj->GetProfiles();
+    buildObjectPartition( aGuiObj, aProfiles, tr( "STREAM_PROFILES" ), true );
   }
 }