]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Change name of group on calculation name changes.
authoradv <adv@opencascade.com>
Tue, 17 Dec 2013 10:04:13 +0000 (10:04 +0000)
committeradv <adv@opencascade.com>
Tue, 17 Dec 2013 10:04:13 +0000 (10:04 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx

index 40a986951e49c3a652fddf8e96befb4445fe430b..f8d25eb746999b52c0aaa5e42442cedb827d18a9 100644 (file)
@@ -35,6 +35,7 @@
 
 #define CALCULATION_REGIONS_PREF GetName() + "_Reg"
 #define CALCULATION_ZONES_PREF GetName() + "_Zone"
+#define CALCULATION_GROUPS_PREF GetName() + "_"
 
 #define PYTHON_CALCULATION_ID "KIND_CALCULATION"
 
@@ -91,6 +92,24 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
         }
       }
     }
+
+    HYDROData_SequenceOfObjects aGroups = GetGeometryGroups();
+
+    anIter.Init( aGroups );
+    for ( ; anIter.More(); anIter.Next() )
+    {
+      Handle(HYDROData_SplittedEdgesGroup) aGroup =
+        Handle(HYDROData_SplittedEdgesGroup)::DownCast( anIter.Value() );
+      if ( aGroup.IsNull() )
+        continue;
+
+      QString aGroupName = aGroup->GetName();
+      if ( aGroupName.startsWith( anOldCaseName ) )
+      {
+        aGroupName.replace( anOldCaseName, theName );
+        aGroup->SetName( aGroupName );
+      }
+    }
   }
 
   HYDROData_Entity::SetName( theName );
@@ -238,7 +257,7 @@ void HYDROData_CalculationCase::Update()
       {
         aSplittedGroup = addNewSplittedGroup();
 
-        QString aCalcGroupName = GetName() + "_" + anObjName;
+        QString aCalcGroupName = CALCULATION_GROUPS_PREF + anObjName;
         aSplittedGroup->SetName( aCalcGroupName );
 
         aSplittedEdgesGroupsMap.insert( anObjName, aSplittedGroup );