Salome HOME
merge BR_v14_rc
[modules/hydro.git] / src / HYDROData / HYDROData_CalculationCase.cxx
index 4f95d9ec0f293286a81437d81e3412a4655dac6e..07397d1a64ee1dbee12cd9ff728e10e38106dc1c 100644 (file)
@@ -86,7 +86,7 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
 
 HYDROData_CalculationCase::HYDROData_CalculationCase()
-: HYDROData_Entity()
+: HYDROData_Entity( Geom_2d_and_groups )
 {
 }
 
@@ -508,7 +508,7 @@ bool HYDROData_CalculationCase::AddGeometryObject( const Handle(HYDROData_Object
   AddReferenceObject( theObject, DataTag_GeometryObject );
   
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_2d );
 
   return true;
 }
@@ -526,7 +526,7 @@ void HYDROData_CalculationCase::RemoveGeometryObject( const Handle(HYDROData_Obj
   RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
 
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_2d );
 }
 
 void HYDROData_CalculationCase::RemoveGeometryObjects()
@@ -534,7 +534,7 @@ void HYDROData_CalculationCase::RemoveGeometryObjects()
   ClearReferenceObjects( DataTag_GeometryObject );
 
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_2d );
 }
 
 bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
@@ -548,7 +548,7 @@ bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_ShapesG
   AddReferenceObject( theGroup, DataTag_GeometryGroup );
   
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_Groups );
 
   return true;
 }
@@ -566,7 +566,7 @@ void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_Shap
   RemoveReferenceObject( theGroup->Label(), DataTag_GeometryGroup );
 
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_Groups );
 }
 
 void HYDROData_CalculationCase::RemoveGeometryGroups()
@@ -574,7 +574,7 @@ void HYDROData_CalculationCase::RemoveGeometryGroups()
   ClearReferenceObjects( DataTag_GeometryGroup );
 
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_Groups );
 }
 
 void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline )
@@ -584,7 +584,8 @@ void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_Poly
   SetReferenceObject( thePolyline, DataTag_Polyline );
 
   // Indicate model of the need to update zones splitting
-  SetToUpdate( !IsEqual( aPrevPolyline, thePolyline ) || IsMustBeUpdated() );
+  if( !IsEqual( aPrevPolyline, thePolyline ) )
+    Changed( Geom_2d );
 }
 
 Handle(HYDROData_PolylineXY) HYDROData_CalculationCase::GetBoundaryPolyline() const
@@ -600,7 +601,7 @@ void HYDROData_CalculationCase::RemoveBoundaryPolyline()
   ClearReferenceObjects( DataTag_Polyline );
 
   // Indicate model of the need to update zones splitting
-  SetToUpdate( !aPrevPolyline.IsNull() || IsMustBeUpdated() );
+  Changed( Geom_2d );
 }
 
 void HYDROData_CalculationCase::SetStricklerTable( const Handle(HYDROData_StricklerTable)& theStricklerTable )
@@ -610,7 +611,8 @@ void HYDROData_CalculationCase::SetStricklerTable( const Handle(HYDROData_Strick
   SetReferenceObject( theStricklerTable, DataTag_StricklerTable );
 
   // Indicate model of the need to update land covers partition
-  SetToUpdate( !IsEqual( aPrevStricklerTable, theStricklerTable ) || IsMustBeUpdated() );
+  if( !IsEqual( aPrevStricklerTable, theStricklerTable ) )
+    Changed( Geom_No );
 }
 
 Handle(HYDROData_StricklerTable) HYDROData_CalculationCase::GetStricklerTable() const
@@ -626,7 +628,7 @@ void HYDROData_CalculationCase::RemoveStricklerTable()
   ClearReferenceObjects( DataTag_StricklerTable );
 
   // Indicate model of the need to update land covers partition
-  SetToUpdate( !aPrevStricklerTable.IsNull() || IsMustBeUpdated() );
+  Changed( Geom_No );
 }
 
 bool HYDROData_CalculationCase::AddLandCover( const Handle(HYDROData_LandCover)& theLandCover )
@@ -637,7 +639,7 @@ bool HYDROData_CalculationCase::AddLandCover( const Handle(HYDROData_LandCover)&
   AddReferenceObject( theLandCover, DataTag_LandCover );
   
   // Indicate model of the need to update land covers partition
-  SetToUpdate( true );
+  Changed( Geom_No );
 
   return true;
 }
@@ -655,7 +657,7 @@ void HYDROData_CalculationCase::RemoveLandCover( const Handle(HYDROData_LandCove
   RemoveReferenceObject( theLandCover->Label(), DataTag_LandCover );
 
   // Indicate model of the need to update land cover partition
-  SetToUpdate( true );
+  Changed( Geom_No );
 }
 
 void HYDROData_CalculationCase::RemoveLandCovers()
@@ -663,7 +665,7 @@ void HYDROData_CalculationCase::RemoveLandCovers()
   ClearReferenceObjects( DataTag_LandCover );
 
   // Indicate model of the need to update land cover partition
-  SetToUpdate( true );
+  Changed( Geom_No );
 }
 
 Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone,
@@ -699,7 +701,7 @@ bool HYDROData_CalculationCase::AddRegion( const Handle(HYDROData_Region)& theRe
   if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
   {
     Handle(HYDROData_Region) aNewRegion = addNewRegion( aDocument, CALCULATION_REGIONS_PREF, theLandCover );
-    theRegion->CopyTo( aNewRegion );
+    theRegion->CopyTo( aNewRegion, true );
 
     aFatherCalc->RemoveRegion( theRegion, theLandCover );
 
@@ -1328,7 +1330,7 @@ void HYDROData_CalculationCase::ClearRules( HYDROData_CalculationCase::DataTag t
 
   // Indicate model of the need to update splitting
   if ( theIsSetToUpdate ) {
-    SetToUpdate( true );
+    Changed( Geom_2d );
   }
 }
 
@@ -1342,7 +1344,7 @@ void HYDROData_CalculationCase::AddRule( const Handle(HYDROData_Entity)&    theO
   HYDROData_PriorityQueue::AddRule( aRulesLab, theObject1, thePriority, theObject2, theMergeType );
 
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_2d );
 }
 
 QString HYDROData_CalculationCase::DumpRules() const
@@ -1363,7 +1365,7 @@ void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode )
   TDataStd_Integer::Set( aModeLab, ( int ) theMode );
 
   // Indicate model of the need to update splitting
-  SetToUpdate( true );
+  Changed( Geom_2d );
 }
 
 HYDROData_CalculationCase::AssignmentMode HYDROData_CalculationCase::GetAssignmentMode() const
@@ -1466,7 +1468,7 @@ void HYDROData_CalculationCase::SetAssignmentLandCoverMode( AssignmentMode theMo
   TDataStd_Integer::Set( aModeLab, ( int ) theMode );
 
   // Indicate model of the need to update land covers partition
-  SetToUpdate( true );
+  Changed( Geom_No );
 }
 
 HYDROData_CalculationCase::AssignmentMode HYDROData_CalculationCase::GetAssignmentLandCoverMode() const