return aGeomObj._retn();
}
-void HYDROData_CalculationCase::ClearRules()
+void HYDROData_CalculationCase::ClearRules( const bool theIsSetToUpdate )
{
TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
HYDROData_PriorityQueue::ClearRules( aRulesLab );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ if ( theIsSetToUpdate ) {
+ SetToUpdate( true );
+ }
}
void HYDROData_CalculationCase::AddRule( const Handle(HYDROData_Object)& theObject1,
HYDRODATA_EXPORT void SetAssignmentMode( AssignmentMode theMode );
HYDRODATA_EXPORT AssignmentMode GetAssignmentMode() const;
- HYDRODATA_EXPORT void ClearRules();
+ HYDRODATA_EXPORT void ClearRules( const bool theIsSetToUpdate );
HYDRODATA_EXPORT void AddRule( const Handle(HYDROData_Object)& theObject1,
HYDROData_PriorityType thePriority,
const Handle(HYDROData_Object)& theObject2,
Handle(HYDROData_Object) anObject1, anObject2;
HYDROData_PriorityType aPriority;
HYDROData_Zone::MergeAltitudesType aMergeType;
- for ( int anIndex = 0; anIndex < myEditedObject->GetRulesCount(); anIndex++ ) {
+ int aRulesNb = myEditedObject->GetRulesCount();
+ for ( int anIndex = 0; anIndex < aRulesNb; anIndex++ ) {
if ( myEditedObject->GetRule( anIndex, anObject1, aPriority, anObject2, aMergeType ) ) {
HYDROData_CustomRule aRule;
aRule.Object1 = anObject1;
theBrowseObjectsEntries.append( anEntry );
}
+ // For manual mode priority rules are redundant
+ if ( aPanel->getMode() == HYDROData_CalculationCase::MANUAL &&
+ myEditedObject->GetRulesCount() > 0 ) {
+ myEditedObject->ClearRules( false );
+ }
+
theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init;
return true;
// At first we must to update the case name because of
// automatic names generation for regions and zones
myEditedObject->SetName( aNewCaseName );
-
- // Clear rules
- if ( myEditedObject->GetRulesCount() > 0 ) {
- myEditedObject->ClearRules();
- }
-
+
// Set parameters for automatic mode
int aMode = aPanel->getMode();
if ( aMode == HYDROData_CalculationCase::AUTOMATIC ) {
myEditedObject->AddGeometryObject( anObject );
}
+ // Clear priority rules
+ if ( myEditedObject->GetRulesCount() > 0 ) {
+ myEditedObject->ClearRules( true );
+ }
// Set priority rules
foreach ( const HYDROData_CustomRule& aRule, aPanel->getRules() ) {
myEditedObject->AddRule( aRule.Object1, aRule.Priority,