Salome HOME
refs #430: incorrect coordinates in dump polyline
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Region.cxx
index 15722904a6c296dcf89ed5e41984500eb228bd83..a53ddc78507d851add33c532b38790a02c26628a 100644 (file)
 
 HYDROGUI_Region::HYDROGUI_Region( SUIT_DataObject* theParent, 
                                   Handle(HYDROData_Region) theData,
-                                  const QString& theParentEntry )
-: HYDROGUI_DataObject( theParent, theData, theParentEntry ), CAM_DataObject( theParent )
+                                  const QString& theParentEntry,
+                                  const bool theIsInOperation )
+: HYDROGUI_DataObject( theParent, theData, theParentEntry, theIsInOperation ), CAM_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;
 }