Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / SMESHDS / SMESHDS_GroupOnFilter.cxx
index 3c2b2a36b46035d210c88949fa5f1fa214ece837..32bd8c7f3485553f1dcb7cc7e7bfd4bba304db29 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -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<SMESHDS_GroupOnFilter*>( this );
     me->myElements.clear();