mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 08:40:36 +05:00
0021275: EDF 1681 SMESH: Find the number of nodes of any group
+ virtual int GetTic() const;
This commit is contained in:
parent
044576569d
commit
af3090f59b
@ -161,6 +161,17 @@ SMDS_ElemIteratorPtr SMESHDS_Group::GetElements() const
|
||||
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 :
|
||||
|
@ -56,6 +56,8 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
|
||||
|
||||
virtual SMDS_ElemIteratorPtr GetElements() const;
|
||||
|
||||
virtual int GetTic() const;
|
||||
|
||||
bool Add (const int theID);
|
||||
|
||||
bool Remove (const int theID);
|
||||
|
@ -71,6 +71,8 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
|
||||
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)
|
||||
|
@ -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 myMeshModifTime * myPredicateTic;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Updates myElements if necessary
|
||||
|
@ -56,6 +56,8 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase
|
||||
|
||||
virtual int GetID (const int theIndex);
|
||||
|
||||
virtual int GetTic() const;
|
||||
|
||||
private:
|
||||
|
||||
void update() const;
|
||||
@ -64,6 +66,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase
|
||||
SMESH_PredicatePtr myPredicate;
|
||||
std::vector< const SMDS_MeshElement*> myElements;
|
||||
unsigned long myMeshModifTime; // when myElements was filled
|
||||
int myPredicateTic;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -128,3 +128,14 @@ bool SMESHDS_GroupOnGeom::Contains (const SMDS_MeshElement* elem)
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,8 @@ class SMESHDS_EXPORT SMESHDS_GroupOnGeom: public SMESHDS_GroupBase
|
||||
|
||||
virtual SMDS_ElemIteratorPtr GetElements() const;
|
||||
|
||||
virtual int GetTic() const;
|
||||
|
||||
private:
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
|
Loading…
Reference in New Issue
Block a user