Salome HOME
refs #653, #665 - 669: start implementation of features.
[modules/hydro.git] / src / HYDROData / HYDROData_Object.cxx
index 95d0efeb7166607a71f7c693594dbd0a604af5f7..78f734ea0a9b387d71b020c1fbae3f0c5e3ed986 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 )
@@ -230,7 +235,7 @@ void HYDROData_Object::SetFillingColor( const QColor& theColor )
 
 QColor HYDROData_Object::GetFillingColor() const
 {
-  return GetColor( getDefaultFillingColor(), DataTag_FillingColor );
+  return GetColor( DefaultFillingColor(), DataTag_FillingColor );
 }
 
 void HYDROData_Object::SetBorderColor( const QColor& theColor )
@@ -240,15 +245,15 @@ void HYDROData_Object::SetBorderColor( const QColor& theColor )
 
 QColor HYDROData_Object::GetBorderColor() const
 {
-  return GetColor( getDefaultBorderColor(), DataTag_BorderColor );
+  return GetColor( DefaultBorderColor(), DataTag_BorderColor );
 }
 
-QColor HYDROData_Object::getDefaultFillingColor() const
+QColor HYDROData_Object::DefaultFillingColor() const
 {
   return QColor( Qt::yellow );
 }
 
-QColor HYDROData_Object::getDefaultBorderColor() const
+QColor HYDROData_Object::DefaultBorderColor() const
 {
   return QColor( Qt::transparent );
 }
@@ -262,10 +267,10 @@ QStringList HYDROData_Object::dumpObjectCreation( MapOfTreatedObjects& theTreate
   QStringList aColorsDef;
 
   QColor aFillingColor = GetFillingColor();
-  setPythonObjectColor( aColorsDef, aFillingColor, getDefaultFillingColor(), "SetFillingColor" );
+  setPythonObjectColor( aColorsDef, aFillingColor, DefaultFillingColor(), "SetFillingColor" );
 
   QColor aBorderColor = GetBorderColor();
-  setPythonObjectColor( aColorsDef, aBorderColor, getDefaultBorderColor(), "SetBorderColor" );
+  setPythonObjectColor( aColorsDef, aBorderColor, DefaultBorderColor(), "SetBorderColor" );
 
   if ( !aColorsDef.isEmpty() )
   {