Salome HOME
0021275: EDF 1681 SMESH: Find the number of nodes of any group
[modules/smesh.git] / src / SMESHDS / SMESHDS_GroupOnFilter.cxx
index 8870f971fa34ac942d7b41e7950589729a029cbe..8307b279ac6b64cd47ea39b3b66f3709ed23db3b 100644 (file)
@@ -40,7 +40,7 @@ SMESHDS_GroupOnFilter::SMESHDS_GroupOnFilter (const int                 theID,
                                               const SMESHDS_Mesh*       theMesh,
                                               const SMDSAbs_ElementType theType,
                                               const SMESH_PredicatePtr& thePredicate)
-  : SMESHDS_GroupBase(theID,theMesh,theType), myMeshModifTime(0)
+  : SMESHDS_GroupBase(theID,theMesh,theType), myMeshModifTime(0), myPredicateTic(0)
 {
   setChanged();
   SetPredicate( thePredicate );
@@ -55,6 +55,7 @@ SMESHDS_GroupOnFilter::SMESHDS_GroupOnFilter (const int                 theID,
 void SMESHDS_GroupOnFilter::SetPredicate( const SMESH_PredicatePtr& thePredicate)
 {
   myPredicate = thePredicate;
+  ++myPredicateTic;
   setChanged();
   if ( myPredicate )
     myPredicate->SetMesh( GetMesh() );
@@ -123,6 +124,17 @@ int SMESHDS_GroupOnFilter::GetID (const int theIndex)
   return myElements[ theIndex-1 ]->GetID();
 }
 
+//================================================================================
+/*!
+ * \brief Return a value allowing to find out if a group has changed or not
+ */
+//================================================================================
+
+int SMESHDS_GroupOnFilter::GetTic() const
+{
+  return GetMesh()->GetMTime() * myPredicateTic;
+}
+
 //================================================================================
 /*!
  * \brief Updates myElements if necessary