+void HYDROData_CalculationCase::SetName( const QString& theName )
+{
+ QString anOldCaseName = GetName();
+ if ( anOldCaseName != theName )
+ {
+ HYDROData_SequenceOfObjects aRegions = GetRegions();
+
+ HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Region) aRegion =
+ Handle(HYDROData_Region)::DownCast( anIter.Value() );
+ if ( aRegion.IsNull() )
+ continue;
+
+ QString aRegionName = aRegion->GetName();
+ if ( aRegionName.startsWith( anOldCaseName ) )
+ {
+ aRegionName.replace( anOldCaseName, theName );
+ aRegion->SetName( aRegionName );
+ }
+
+ HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
+ HYDROData_SequenceOfObjects::Iterator anIter( aZones );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Zone) aRegZone =
+ Handle(HYDROData_Zone)::DownCast( anIter.Value() );
+ if ( aRegZone.IsNull() )
+ continue;
+
+ QString aRegionZoneName = aRegZone->GetName();
+ if ( aRegionZoneName.startsWith( anOldCaseName ) )
+ {
+ aRegionZoneName.replace( anOldCaseName, theName );
+ aRegZone->SetName( aRegionZoneName );
+ }
+ }
+ }
+ }
+
+ HYDROData_Entity::SetName( theName );
+}
+