From: adv Date: Tue, 17 Dec 2013 10:04:13 +0000 (+0000) Subject: Change name of group on calculation name changes. X-Git-Tag: BR_hydro_v_0_6~66 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=651e5d37742752679433fa0c15460402ce2c72f4;p=modules%2Fhydro.git Change name of group on calculation name changes. --- 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 );