Salome HOME
Fix for the bug #42: point C is not activated, but point C is shown in preview in...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Region.cxx
index 15722904a6c296dcf89ed5e41984500eb228bd83..f9e1547b472474d08dad14cd30afdc173ae92df1 100644 (file)
@@ -37,12 +37,24 @@ HYDROGUI_Region::HYDROGUI_Region( SUIT_DataObject* theParent,
 {
 }
 
-void HYDROGUI_Region::addZones( )
+bool HYDROGUI_Region::addZones( const QList<HYDROGUI_Zone*>& theZonesList )
 {
   Handle(HYDROData_Region) aRegion = Handle(HYDROData_Region)::DownCast( modelObject() );
-  if ( !aRegion.IsNull() )
+  bool isOk = !aRegion.IsNull();
+  if ( isOk )
   {
-    // TODO: Add zones
-    ;
+    Handle(HYDROData_Zone) aZone;
+    for (int i = 0; i < theZonesList.length(); i++ )
+    {
+      aZone = Handle(HYDROData_Zone)::DownCast( theZonesList.at(i)->modelObject() );
+      if ( !aZone.IsNull() )
+      {
+        if ( !( aRegion->AddZone( aZone ) ) )
+        {
+          isOk = false;
+        }
+      }
+    }
   }
+  return isOk;
 }