myLastWarning.Data = theData;
}
-int HYDROData_CalculationCase::GetRulesCount() const
-{
- TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
- return HYDROData_PriorityQueue::GetRulesCount( aRulesLab );
-}
-
bool HYDROData_CalculationCase::GetRule( int theIndex,
Handle(HYDROData_Object)& theObject1,
HYDROData_PriorityType& thePriority,
HYDRODATA_EXPORT void SetAssignmentMode( AssignmentMode theMode );
HYDRODATA_EXPORT AssignmentMode GetAssignmentMode() const;
- HYDRODATA_EXPORT void ClearRules( const bool theIsSetToUpdate );
+ HYDRODATA_EXPORT void ClearRules( const bool theIsSetToUpdate = true );
HYDRODATA_EXPORT void AddRule( const Handle(HYDROData_Object)& theObject1,
HYDROData_PriorityType thePriority,
const Handle(HYDROData_Object)& theObject2,
HYDROData_Zone::MergeAltitudesType theMergeType );
- HYDRODATA_EXPORT int GetRulesCount() const;
HYDRODATA_EXPORT bool GetRule( int theIndex,
Handle(HYDROData_Object)& theObject1,
HYDROData_PriorityType& thePriority,
}
}
-int HYDROData_PriorityQueue::GetRulesCount( const TDF_Label& theRulesLab )
-{
- return theRulesLab.NbChildren();
-}
-
bool HYDROData_PriorityQueue::GetRule( const TDF_Label& theRulesLab,
int theIndex,
Handle(HYDROData_Object)& theObject1,
static void DumpRulesToPython( const TDF_Label& theRulesLab,
const QString& theCalcCaseName,
QStringList& theScript );
- static int GetRulesCount( const TDF_Label& theRulesLab );
static bool GetRule( const TDF_Label& theRulesLab,
int theIndex,
Handle(HYDROData_Object)& theObject1,
Handle(HYDROData_Object) anObject1, anObject2;
HYDROData_PriorityType aPriority;
HYDROData_Zone::MergeAltitudesType aMergeType;
- int aRulesNb = myEditedObject->GetRulesCount();
- for ( int anIndex = 0; anIndex < aRulesNb; anIndex++ ) {
+ for ( int anIndex = 0; ; anIndex++ )
+ {
if ( myEditedObject->GetRule( anIndex, anObject1, aPriority, anObject2, aMergeType ) ) {
HYDROData_CustomRule aRule;
aRule.Object1 = anObject1;
aRules << aRule;
}
+ else
+ break;
}
aPanel->setRules( aRules );
}
}
// For manual mode priority rules are redundant
- if ( aPanel->getMode() == HYDROData_CalculationCase::MANUAL &&
- myEditedObject->GetRulesCount() > 0 ) {
+ if ( aPanel->getMode() == HYDROData_CalculationCase::MANUAL ) {
myEditedObject->ClearRules( false );
}
}
// Clear priority rules
- if ( myEditedObject->GetRulesCount() > 0 ) {
+ //@ASL if ( myEditedObject->GetRulesCount() > 0 ) {
myEditedObject->ClearRules( true );
- }
+ //@ASL }
// Set priority rules
foreach ( const HYDROData_CustomRule& aRule, aPanel->getRules() ) {
myEditedObject->AddRule( aRule.Object1, aRule.Priority,