X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PriorityQueue.cxx;h=12d39ce61e005ebe64d848db4b84e81f70bded24;hb=e744ba34fd38d6744d11b54cd15b6f86350695b2;hp=43d39df35b5be6ffc1628113f280aaf03fa0ebd4;hpb=69048e668dcd9f681a48054df3b01a84d7ed773e;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PriorityQueue.cxx b/src/HYDROData/HYDROData_PriorityQueue.cxx index 43d39df3..12d39ce6 100644 --- a/src/HYDROData/HYDROData_PriorityQueue.cxx +++ b/src/HYDROData/HYDROData_PriorityQueue.cxx @@ -27,10 +27,11 @@ HYDROData_PriorityQueue::HYDROData_PriorityQueue( HYDROData_CalculationCase* theCalcCase, Standard_Integer aTag ) { - myGeomObjects = theCalcCase->GetGeometryObjects(); - for( int i=myGeomObjects.Lower(), n=myGeomObjects.Upper(); i<=n; i++ ) + bool isLandCover = aTag == HYDROData_CalculationCase::DataTag_CustomLandCoverRules; + myObjects = isLandCover ? theCalcCase->GetLandCovers() : theCalcCase->GetGeometryObjects(); + for( int i=myObjects.Lower(), n=myObjects.Upper(); i<=n; i++ ) { - Handle(HYDROData_Entity) anObj = myGeomObjects.Value( i ); + Handle(HYDROData_Entity) anObj = myObjects.Value( i ); if( !anObj.IsNull() ) { QString anObjName = anObj->GetName(); @@ -49,9 +50,9 @@ Handle(HYDROData_Entity) HYDROData_PriorityQueue::GetMostPriorityObject( const Q HYDROData_Zone::MergeType& theMergeType ) const { QStringList aSortedZoneObjects; - for( int i=myGeomObjects.Lower(), n=myGeomObjects.Upper(); i<=n; i++ ) + for( int i=myObjects.Lower(), n=myObjects.Upper(); i<=n; i++ ) { - QString aName = myGeomObjects.Value( i )->GetName(); + QString aName = myObjects.Value( i )->GetName(); if( theZoneObjects.contains( aName ) ) aSortedZoneObjects.append( aName ); } @@ -105,14 +106,14 @@ bool HYDROData_PriorityQueue::IsMorePriority( const Handle(HYDROData_Entity)& th } // 2. If no custom rule found, the standard ordering list is applied - for( int i=myGeomObjects.Lower(), n=myGeomObjects.Upper(); i<=n; i++ ) + for( int i=myObjects.Lower(), n=myObjects.Upper(); i<=n; i++ ) { - if( myGeomObjects.Value( i )->Label() == theObj1->Label() ) + if( myObjects.Value( i )->Label() == theObj1->Label() ) { theMergeType = HYDROData_Zone::Merge_Object; return true; } - if( myGeomObjects.Value( i )->Label() == theObj2->Label() ) + if( myObjects.Value( i )->Label() == theObj2->Label() ) { theMergeType = HYDROData_Zone::Merge_Object; return false; @@ -200,7 +201,9 @@ HYDROData_ListOfRules HYDROData_PriorityQueue::GetRules( const TDF_Label& theRul QString HYDROData_PriorityQueue::DumpRules( const TDF_Label& theRulesLab ) { - QString aDump = "Rules:\n"; + bool isLandCover = theRulesLab.Tag() == HYDROData_CalculationCase::DataTag_CustomLandCoverRules; + QString aDump = isLandCover ? "Land Cover rules:\n" : "Rules:\n"; + HYDROData_ListOfRules aRules = GetRules( theRulesLab ); HYDROData_ListOfRules::const_iterator anIt = aRules.begin(), aLast = aRules.end(); for( ; anIt!=aLast; anIt++ )