Salome HOME
Merge remote-tracking branch 'origin/master' into BR_LAND_COVER_MAP
[modules/hydro.git] / src / HYDROData / HYDROData_Object.cxx
index 4a094521720404b1eeac7ef0fc7a0920a941e0cb..927bd86524aee657da9c88063146792e5aa3da40 100644 (file)
@@ -31,8 +31,8 @@
 IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity)
 
-HYDROData_Object::HYDROData_Object()
-: HYDROData_Entity()
+HYDROData_Object::HYDROData_Object( Geometry theGeometry )
+  : HYDROData_Entity( theGeometry )
 {
 }
 
@@ -71,9 +71,14 @@ void HYDROData_Object::SetName( const QString& theName )
 
 void HYDROData_Object::Update()
 {
-  RemoveTopShape();
-  RemoveShape3D();
-  RemoveGroupObjects();
+  if( IsMustBeUpdated( Geom_2d ) )
+  {
+    removeTopShape();
+    removeGroupObjects();
+  }
+  if( IsMustBeUpdated( Geom_3d ) )
+    removeShape3D();
+
   checkAndSetAltitudeObject();
   HYDROData_Entity::Update();
 }
@@ -89,13 +94,13 @@ HYDROData_SequenceOfObjects HYDROData_Object::GetAllReferenceObjects() const
   return aResSeq;
 }
 
-void HYDROData_Object::SetToUpdate( bool theFlag )
+void HYDROData_Object::Changed( Geometry theChangedGeometry )
 {
-  HYDROData_Entity::SetToUpdate( theFlag );
+  HYDROData_Entity::Changed( theChangedGeometry );
 
   Handle(HYDROData_DummyObject3D) anObject3D = GetObject3D();
   if ( !anObject3D.IsNull() )
-    anObject3D->SetToUpdate( theFlag );
+    anObject3D->Changed( theChangedGeometry );
 }
 
 void HYDROData_Object::SetTopShape( const TopoDS_Shape& theShape )