Salome HOME
Refs #289 - Spline profile is represented in OCC view as polyline profile
[modules/hydro.git] / src / HYDROData / HYDROData_CalculationCase.cxx
index 32fb604477b7081ee647bd7d1a755ffb9e9d33b2..198222ab62a76428d734c9c6163ba39374c9eb0f 100644 (file)
@@ -70,12 +70,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
       if ( aRegion.IsNull() )
         continue;
 
-      QString aRegionName = aRegion->GetName();
-      if ( aRegionName.startsWith( anOldCaseName ) )
-      {
-        aRegionName.replace( anOldCaseName, theName );
-        aRegion->SetName( aRegionName );
-      }
+      HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aRegion );
 
       HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
       HYDROData_SequenceOfObjects::Iterator anIter( aZones );
@@ -86,12 +81,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
         if ( aRegZone.IsNull() )
           continue;
 
-        QString aRegionZoneName = aRegZone->GetName();
-        if ( aRegionZoneName.startsWith( anOldCaseName ) )
-        {
-          aRegionZoneName.replace( anOldCaseName, theName );
-          aRegZone->SetName( aRegionZoneName );
-        }
+        HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aRegZone );
       }
     }
 
@@ -105,12 +95,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
       if ( aGroup.IsNull() )
         continue;
 
-      QString aGroupName = aGroup->GetName();
-      if ( aGroupName.startsWith( anOldCaseName ) )
-      {
-        aGroupName.replace( anOldCaseName, theName );
-        aGroup->SetName( aGroupName );
-      }
+      HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aGroup );
     }
   }
 
@@ -813,7 +798,7 @@ GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM(
 
     SALOMEDS::SObject_var aResultSO = 
       theGeomEngine->PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), 
-                                     aGeomObj, qPrintable( theName ) );
+                                     aGeomObj, qPrintable( aName ) );
     if ( aResultSO->_is_nil() ) {
       aGeomObj = GEOM::GEOM_Object::_nil();
     }