From 9c57d510e5cf3a97f10c93467a5ed78fb9bedc48 Mon Sep 17 00:00:00 2001 From: adv Date: Wed, 25 Dec 2013 14:01:30 +0000 Subject: [PATCH] Forsed update of objects corrected (Bug #284). --- src/HYDROGUI/HYDROGUI_Operations.cxx | 2 +- src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx | 8 +++++--- src/HYDROGUI/HYDROGUI_UpdateObjectOp.h | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index 95fb864d..d2a7d3f4 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -392,7 +392,7 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const break; case UpdateObjectId: case ForcedUpdateObjectId: - anOp = new HYDROGUI_UpdateObjectOp( aModule ); + anOp = new HYDROGUI_UpdateObjectOp( aModule, theId == ForcedUpdateObjectId ); break; case RemoveImageRefsId: anOp = new HYDROGUI_RemoveImageRefsOp( aModule ); diff --git a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx index c653c107..40af609b 100644 --- a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx +++ b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx @@ -29,8 +29,10 @@ #include #include -HYDROGUI_UpdateObjectOp::HYDROGUI_UpdateObjectOp( HYDROGUI_Module* theModule ) -: HYDROGUI_Operation( theModule ) +HYDROGUI_UpdateObjectOp::HYDROGUI_UpdateObjectOp( HYDROGUI_Module* theModule, + const bool theIsForced ) +: HYDROGUI_Operation( theModule ), + myIsForced( theIsForced ) { setName( tr( "UPDATE_IMAGE" ) ); } @@ -75,7 +77,7 @@ void HYDROGUI_UpdateObjectOp::updateObject( const Handle(HYDROData_Entity)& theO updateObject( anObject, theMapOfTreated ); } - if ( !theObject->IsMustBeUpdated() ) + if ( !myIsForced && !theObject->IsMustBeUpdated() ) return; theObject->Update(); diff --git a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h index 735b01bf..8f9a65d7 100644 --- a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h +++ b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h @@ -34,7 +34,8 @@ class HYDROGUI_UpdateObjectOp : public HYDROGUI_Operation Q_OBJECT public: - HYDROGUI_UpdateObjectOp( HYDROGUI_Module* theModule ); + HYDROGUI_UpdateObjectOp( HYDROGUI_Module* theModule, + const bool theIsForced ); virtual ~HYDROGUI_UpdateObjectOp(); protected: @@ -43,6 +44,9 @@ protected: virtual void updateObject( const Handle_HYDROData_Entity& theObject, NCollection_Map& theMapOfTreated ) const; + +private: + bool myIsForced; }; #endif -- 2.39.2