X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PriorityQueue.cxx;h=59ffc56d24ecb319dd2a4180ffa603694fd96899;hb=9c3749501bcf6c4eed78966cb69934bab0a1a3b9;hp=95e167bd2c7fa8440230efd9d7b8f9c2c4c1c126;hpb=1c46311dfa50e3077f13290dbe935205c1edb8a1;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PriorityQueue.cxx b/src/HYDROData/HYDROData_PriorityQueue.cxx index 95e167bd..59ffc56d 100644 --- a/src/HYDROData/HYDROData_PriorityQueue.cxx +++ b/src/HYDROData/HYDROData_PriorityQueue.cxx @@ -1,3 +1,24 @@ +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include #include @@ -121,7 +142,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 +164,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 )