From: mzn Date: Wed, 5 Nov 2014 11:23:22 +0000 (+0000) Subject: Bug #485: rules in calculation case are lost. X-Git-Tag: BR_hydro_v_1_0_4~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b1426c956b530f3312f3492c8c199a66b1f2ddf7;p=modules%2Fhydro.git Bug #485: rules in calculation case are lost. --- diff --git a/src/HYDROData/HYDROData_PriorityQueue.cxx b/src/HYDROData/HYDROData_PriorityQueue.cxx index 95e167bd..075f70a0 100644 --- a/src/HYDROData/HYDROData_PriorityQueue.cxx +++ b/src/HYDROData/HYDROData_PriorityQueue.cxx @@ -121,7 +121,14 @@ void HYDROData_PriorityQueue::AddRule( TDF_Label& theRul const Handle(HYDROData_Object)& theObject2, HYDROData_Zone::MergeAltitudesType theMergeType ) { - TDF_Label aNewRuleLab = theRulesLabel.NewChild(); + // Get the last rule index + Standard_Integer aRuleIndex = 0; + Handle(TDataStd_Integer) anIntVal; + if ( theRulesLabel.FindAttribute( TDataStd_Integer::GetID(), anIntVal ) ) { + aRuleIndex = anIntVal->Get(); + } + + TDF_Label aNewRuleLab = theRulesLabel.FindChild( aRuleIndex ); TDF_Label anObj1Lab = aNewRuleLab.FindChild( Object1_Tag ); Handle(TDataStd_ReferenceList) aRefs = TDataStd_ReferenceList::Set( anObj1Lab ); @@ -136,6 +143,9 @@ void HYDROData_PriorityQueue::AddRule( TDF_Label& theRul TDF_Label aMergeLab = aNewRuleLab.FindChild( Merge_Tag ); TDataStd_Integer::Set( aMergeLab, theMergeType ); + + // Increment the last rule index + TDataStd_Integer::Set( theRulesLabel, aRuleIndex + 1 ); } HYDROData_ListOfRules HYDROData_PriorityQueue::GetRules( const TDF_Label& theRulesLabel )