From: adv Date: Mon, 2 Dec 2013 11:27:15 +0000 (+0000) Subject: Update method improved. X-Git-Tag: BR_hydro_v_0_4~107 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=15f767768f154976b55885bfa7b52e79dcf8b700;p=modules%2Fhydro.git Update method improved. --- diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 45ea5f01..f8c514b3 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -34,6 +34,13 @@ void HYDROData_Object::SetShape3D( const TopoDS_Shape& theShape ) aBuilder.Generated( theShape ); } +void HYDROData_Object::Update() +{ + removeTopShape(); + removeShape3D(); + SetToUpdate( false ); +} + void HYDROData_Object::SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry ) { SetReferenceObject( theBathymetry, DataTag_Bathymetry ); diff --git a/src/HYDROData/HYDROData_Object.h b/src/HYDROData/HYDROData_Object.h index eda73755..0fcd1384 100644 --- a/src/HYDROData/HYDROData_Object.h +++ b/src/HYDROData/HYDROData_Object.h @@ -54,6 +54,13 @@ public: HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0; + /** + * Update the geometry object. + * Call this method whenever you made changes for object data. + */ + HYDRODATA_EXPORT virtual void Update(); + + /** * Set reference bathymetry object for geometry object. */ diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index bb8d172b..89f3be36 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -62,8 +62,7 @@ TopoDS_Shape HYDROData_Polyline3D::GetShape3D() const void HYDROData_Polyline3D::Update() { - removeTopShape(); - removeShape3D(); + HYDROData_Object::Update(); Handle(HYDROData_PolylineXY) aPolylineXY = GetPolylineXY(); Handle(HYDROData_ProfileUZ) aProfileUZ = GetProfileUZ(); diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx index 0512e90a..19c9900a 100644 --- a/src/HYDROData/HYDROData_Stream.cxx +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -66,8 +66,7 @@ TopoDS_Shape HYDROData_Stream::GetShape3D() const void HYDROData_Stream::Update() { - removeTopShape(); - removeShape3D(); + HYDROData_NaturalObject::Update(); Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis(); HYDROData_SequenceOfObjects aRefProfiles = GetProfiles();