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