From abb0ef62f4c90d0d71defe679911c0d708913280 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 24 Feb 2012 10:30:58 +0000 Subject: [PATCH] 0021208: Performance issue when loading SMESH with an hdf file containing a big mesh + bool IsUpToDate() const; --- src/SMESHDS/SMESHDS_GroupOnFilter.cxx | 13 ++++++++++++- src/SMESHDS/SMESHDS_GroupOnFilter.hxx | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx index 3c2b2a36b..cc6f0fa04 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx @@ -135,6 +135,17 @@ int SMESHDS_GroupOnFilter::GetTic() const return GetMesh()->GetMTime() * myPredicateTic; } +//================================================================================ +/*! + * \brief Return false if update() is needed + */ +//================================================================================ + +bool SMESHDS_GroupOnFilter::IsUpToDate() const +{ + return !( myMeshModifTime < GetMesh()->GetMTime() ); +} + //================================================================================ /*! * \brief Updates myElements if necessary @@ -143,7 +154,7 @@ int SMESHDS_GroupOnFilter::GetTic() const void SMESHDS_GroupOnFilter::update() const { - if ( myMeshModifTime < GetMesh()->GetMTime() ) + if ( !IsUpToDate() ) { SMESHDS_GroupOnFilter* me = const_cast( this ); me->myElements.clear(); diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.hxx b/src/SMESHDS/SMESHDS_GroupOnFilter.hxx index f17917aab..3725c6911 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.hxx @@ -58,6 +58,8 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase virtual int GetTic() const; + bool IsUpToDate() const; + private: void update() const; -- 2.39.2