#include <SMDS_MeshNodeIDFactory.hxx>

Public Member Functions | |
| SMDS_MeshNodeIDFactory () | |
| bool | BindID (int ID, SMDS_MeshElement *elem) |
| SMDS_MeshElement * | MeshElement (int ID) |
| virtual int | GetFreeID () |
| virtual void | ReleaseID (int ID, int vtkId=-1) |
| int | GetMaxID () const |
| int | GetMinID () const |
| SMDS_ElemIteratorPtr | elementsIterator () const |
| virtual void | Clear () |
| virtual void | emptyPool (int maxId) |
| void | SetMesh (SMDS_Mesh *mesh) |
| SMDS_Mesh * | GetMesh () |
| bool | isPoolIdEmpty () |
| void | adjustMaxId (int ID) |
Protected Member Functions | |
| void | updateMinMax () const |
| void | updateMinMax (int id) const |
Protected Attributes | |
| int | myMin |
| int | myMax |
| int | myMaxID |
| std::set< int > | myPoolOfID |
| SMDS_Mesh * | myMesh |
Definition at line 37 of file SMDS_MeshNodeIDFactory.hxx.
| SMDS_MeshNodeIDFactory::SMDS_MeshNodeIDFactory | ( | ) |
Definition at line 43 of file SMDS_MeshNodeIDFactory.cxx.
: SMDS_MeshIDFactory(), myMin(0), myMax(0) { }
| void SMDS_MeshIDFactory.adjustMaxId | ( | int | ID | ) | [inherited] |
Definition at line 48 of file SMDS_MeshIDFactory.hxx.
Referenced by SMDS_Mesh.AddNodeWithID().
| bool SMDS_MeshNodeIDFactory::BindID | ( | int | ID, |
| SMDS_MeshElement * | elem | ||
| ) |
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 52 of file SMDS_MeshNodeIDFactory.cxx.
References updateMinMax().
Referenced by SMDS_Mesh.AddNodeWithID(), and SMDS_Mesh.Renumber().
{
updateMinMax(ID);
return true;
}
| void SMDS_MeshNodeIDFactory::Clear | ( | ) | [virtual] |
Reimplemented from SMDS_MeshIDFactory.
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 139 of file SMDS_MeshNodeIDFactory.cxx.
Referenced by SMDS_Mesh.Clear(), and SMDS_Mesh.Renumber().
{
myMin = myMax = 0;
SMDS_MeshIDFactory::Clear();
}
| SMDS_ElemIteratorPtr SMDS_MeshNodeIDFactory::elementsIterator | ( | ) | const |
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 134 of file SMDS_MeshNodeIDFactory.cxx.
References SMDS_Mesh.elementsIterator(), SMDS_MeshIDFactory.myMesh, and SMDSAbs_Node.
Referenced by SMDS_Mesh.Renumber().
{
return myMesh->elementsIterator(SMDSAbs_Node);
}
| void SMDS_MeshNodeIDFactory::emptyPool | ( | int | maxId | ) | [virtual] |
Reimplemented from SMDS_MeshIDFactory.
Definition at line 145 of file SMDS_MeshNodeIDFactory.cxx.
References myMax.
Referenced by SMESHDS_Mesh.compactMesh().
{
SMDS_MeshIDFactory::emptyPool(maxId);
myMax = maxId;
}
| int SMDS_MeshNodeIDFactory::GetFreeID | ( | ) | [virtual] |
Reimplemented from SMDS_MeshIDFactory.
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 75 of file SMDS_MeshNodeIDFactory.cxx.
References MeshElement().
Referenced by SMDS_Mesh.AddNode(), and SMDS_Mesh.AddNodeWithID().
{
int ID;
do {
ID = SMDS_MeshIDFactory::GetFreeID();
} while ( MeshElement( ID ));
return ID;
}
| int SMDS_MeshNodeIDFactory::GetMaxID | ( | ) | const |
Definition at line 103 of file SMDS_MeshNodeIDFactory.cxx.
References myMax, and updateMinMax().
Referenced by SMDS_Mesh.adjustStructure(), and SMDS_Mesh.MaxElementID().
{
if (myMax == 0)
updateMinMax();
return myMax;
}
| SMDS_Mesh * SMDS_MeshIDFactory::GetMesh | ( | ) | [inherited] |
Definition at line 103 of file SMDS_MeshIDFactory.cxx.
References SMDS_MeshIDFactory.myMesh.
Referenced by MeshElement(), and SMDS_MeshElementIDFactory.MeshElement().
{
return myMesh;
}
| int SMDS_MeshNodeIDFactory::GetMinID | ( | ) | const |
Definition at line 115 of file SMDS_MeshNodeIDFactory.cxx.
References myMax, myMin, and updateMinMax().
Referenced by SMDS_Mesh.MinElementID().
{
if (myMax == 0)
updateMinMax();
return myMin;
}
| bool SMDS_MeshIDFactory.isPoolIdEmpty | ( | ) | [inherited] |
Definition at line 46 of file SMDS_MeshIDFactory.hxx.
{ return myPoolOfID.empty(); };
| SMDS_MeshElement * SMDS_MeshNodeIDFactory::MeshElement | ( | int | ID | ) |
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 62 of file SMDS_MeshNodeIDFactory.cxx.
References SMDS_Mesh.FindNode(), and SMDS_MeshIDFactory.GetMesh().
Referenced by SMDS_Mesh.Add0DElementWithID(), SMDS_Mesh.AddEdgeWithID(), SMDS_Mesh.AddFaceWithID(), SMDS_Mesh.AddNodeWithID(), SMDS_Mesh.AddPolygonalFaceWithID(), SMDS_Mesh.AddVolumeWithID(), SMDS_Mesh.GetElementType(), and GetFreeID().
{
// commented since myMax can be 0 after ReleaseID()
// if ((ID < 1) || (ID > myMax))
// return NULL;
const SMDS_MeshElement* elem = GetMesh()->FindNode(ID);
return (SMDS_MeshElement*) (elem);
}
Reimplemented from SMDS_MeshIDFactory.
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 88 of file SMDS_MeshNodeIDFactory.cxx.
References myMax, SMDS_MeshIDFactory.myMesh, myMin, and SMDS_Mesh.setMyModified().
Referenced by SMDS_Mesh.Clear(), SMDS_Mesh.RemoveElement(), SMDS_Mesh.RemoveFreeElement(), and SMDS_Mesh.~SMDS_Mesh().
{
SMDS_MeshIDFactory::ReleaseID(ID);
myMesh->setMyModified();
if (ID == myMax)
myMax = 0; // --- force updateMinMax
if (ID == myMin)
myMax = 0; // --- force updateMinMax
}
| void SMDS_MeshIDFactory::SetMesh | ( | SMDS_Mesh * | mesh | ) | [inherited] |
Definition at line 98 of file SMDS_MeshIDFactory.cxx.
References PAL_MESH_041_mesh.mesh, and SMDS_MeshIDFactory.myMesh.
Referenced by SMDS_Mesh.SMDS_Mesh().
| void SMDS_MeshNodeIDFactory.updateMinMax | ( | int | id | ) | const [protected] |
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 53 of file SMDS_MeshNodeIDFactory.hxx.
| void SMDS_MeshNodeIDFactory::updateMinMax | ( | ) | const [protected] |
Reimplemented in SMDS_MeshElementIDFactory.
Definition at line 127 of file SMDS_MeshNodeIDFactory.cxx.
References SMDS_Mesh.MaxNodeID(), SMDS_Mesh.MinNodeID(), myMax, SMDS_MeshIDFactory.myMesh, myMin, and SMDS_Mesh.updateNodeMinMax().
Referenced by BindID(), GetMaxID(), and GetMinID().
int SMDS_MeshNodeIDFactory.myMax [mutable, protected] |
Definition at line 61 of file SMDS_MeshNodeIDFactory.hxx.
Referenced by Clear(), SMDS_MeshElementIDFactory.Clear(), emptyPool(), GetMaxID(), GetMinID(), ReleaseID(), SMDS_MeshElementIDFactory.ReleaseID(), updateMinMax(), and SMDS_MeshElementIDFactory.updateMinMax().
int SMDS_MeshIDFactory.myMaxID [protected, inherited] |
Definition at line 51 of file SMDS_MeshIDFactory.hxx.
Referenced by SMDS_MeshIDFactory.Clear(), SMDS_MeshIDFactory.emptyPool(), SMDS_MeshIDFactory.GetFreeID(), and SMDS_MeshIDFactory.ReleaseID().
SMDS_Mesh* SMDS_MeshIDFactory.myMesh [protected, inherited] |
Definition at line 53 of file SMDS_MeshIDFactory.hxx.
Referenced by SMDS_MeshElementIDFactory.BindID(), SMDS_MeshElementIDFactory.Clear(), elementsIterator(), SMDS_MeshElementIDFactory.elementsIterator(), SMDS_MeshIDFactory.GetMesh(), SMDS_MeshElementIDFactory.MeshElement(), ReleaseID(), SMDS_MeshElementIDFactory.ReleaseID(), SMDS_MeshElementIDFactory.SetInVtkGrid(), SMDS_MeshIDFactory.SetMesh(), updateMinMax(), and SMDS_MeshElementIDFactory.updateMinMax().
int SMDS_MeshNodeIDFactory.myMin [mutable, protected] |
Definition at line 61 of file SMDS_MeshNodeIDFactory.hxx.
Referenced by Clear(), SMDS_MeshElementIDFactory.Clear(), GetMinID(), ReleaseID(), SMDS_MeshElementIDFactory.ReleaseID(), updateMinMax(), and SMDS_MeshElementIDFactory.updateMinMax().
std::set<int> SMDS_MeshIDFactory.myPoolOfID [protected, inherited] |
Definition at line 52 of file SMDS_MeshIDFactory.hxx.
Referenced by SMDS_MeshIDFactory.Clear(), SMDS_MeshIDFactory.emptyPool(), SMDS_MeshIDFactory.GetFreeID(), and SMDS_MeshIDFactory.ReleaseID().