From 651e5d37742752679433fa0c15460402ce2c72f4 Mon Sep 17 00:00:00 2001 From: adv Date: Tue, 17 Dec 2013 10:04:13 +0000 Subject: [PATCH] Change name of group on calculation name changes. --- src/HYDROData/HYDROData_CalculationCase.cxx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 40a98695..f8d25eb7 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -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 ); -- 2.39.2