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;
}