return SMDS_ElemIteratorPtr( new MyGroupIterator ( myGroup ));
}
+//================================================================================
+/*!
+ * \brief Return a value allowing to find out if a group has changed or not
+ */
+//================================================================================
+
+int SMESHDS_Group::GetTic() const
+{
+ return myGroup.Tic();
+}
+
//=======================================================================
//function : SetType
//purpose :
virtual SMDS_ElemIteratorPtr GetElements() const;
+ virtual int GetTic() const;
+
bool Add (const int theID);
bool Remove (const int theID);
virtual int GetID (const int theIndex);
// use it for iterations 1..Extent()
+ virtual int GetTic() const = 0;
+
virtual ~SMESHDS_GroupBase() {}
void SetColor (const Quantity_Color& theColor)
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 );
void SMESHDS_GroupOnFilter::SetPredicate( const SMESH_PredicatePtr& thePredicate)
{
myPredicate = thePredicate;
+ ++myPredicateTic;
setChanged();
if ( myPredicate )
myPredicate->SetMesh( GetMesh() );
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 myMeshModifTime * myPredicateTic;
+}
+
//================================================================================
/*!
* \brief Updates myElements if necessary
virtual int GetID (const int theIndex);
+ virtual int GetTic() const;
+
private:
void update() const;
SMESH_PredicatePtr myPredicate;
std::vector< const SMDS_MeshElement*> myElements;
unsigned long myMeshModifTime; // when myElements was filled
+ int myPredicateTic;
};
#endif
return mySubMesh->Contains( elem );
}
+//================================================================================
+/*!
+ * \brief Return a value allowing to find out if a group has changed or not
+ */
+//================================================================================
+
+int SMESHDS_GroupOnGeom::GetTic() const
+{
+ return GetMesh()->GetMTime();
+}
+
virtual SMDS_ElemIteratorPtr GetElements() const;
+ virtual int GetTic() const;
+
private:
TopoDS_Shape myShape;