Iterator on list of elements. More...

Public Member Functions | |
| SMDS_MeshNode_MyInvIterator (SMDS_Mesh *mesh, vtkIdType *cells, int ncells, SMDSAbs_ElementType type) | |
| bool | more () |
| Return true if and only if there are other object in this iterator. | |
| const SMDS_MeshElement * | next () |
| Return the current object and step to the next one. | |
| virtual void | remove () |
| Delete the current element and step to the next one. | |
Private Attributes | |
| SMDS_Mesh * | myMesh |
| vtkIdType * | myCells |
| int | myNcells |
| SMDSAbs_ElementType | myType |
| int | iter |
| vector< vtkIdType > | cellList |
Iterator on list of elements.
Definition at line 139 of file SMDS_MeshNode.cxx.
| SMDS_MeshNode_MyInvIterator.SMDS_MeshNode_MyInvIterator | ( | SMDS_Mesh * | mesh, |
| vtkIdType * | cells, | ||
| int | ncells, | ||
| SMDSAbs_ElementType | type | ||
| ) |
Definition at line 150 of file SMDS_MeshNode.cxx.
References cellList, SMDS_Mesh.FindElement(), SMDS_Mesh.fromVtkToSmds(), SMDS_MeshElement.GetType(), myCells, myMesh, myNcells, and SMDSAbs_All.
:
myMesh(mesh), myCells(cells), myNcells(ncells), myType(type), iter(0)
{
//MESSAGE("SMDS_MeshNode_MyInvIterator : ncells " << myNcells);
cellList.clear();
if (type == SMDSAbs_All)
for (int i = 0; i < ncells; i++)
cellList.push_back(cells[i]);
else for (int i = 0; i < ncells; i++)
{
int vtkId = cells[i];
int smdsId = myMesh->fromVtkToSmds(vtkId);
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
if (elem->GetType() == type)
{
//MESSAGE("Add element vtkId " << vtkId << " " << elem->GetType())
cellList.push_back(vtkId);
}
}
myCells = &cellList[0];
myNcells = cellList.size();
//MESSAGE("myNcells="<<myNcells);
}
| bool SMDS_MeshNode_MyInvIterator.more | ( | ) | [virtual] |
Return true if and only if there are other object in this iterator.
Implements SMDS_Iterator< const SMDS_MeshElement * >.
Definition at line 174 of file SMDS_MeshNode.cxx.
| const SMDS_MeshElement* SMDS_MeshNode_MyInvIterator.next | ( | ) | [virtual] |
Return the current object and step to the next one.
Implements SMDS_Iterator< const SMDS_MeshElement * >.
Definition at line 180 of file SMDS_MeshNode.cxx.
References SMDS_Mesh.FindElement(), SMDS_Mesh.fromVtkToSmds(), iter, MESSAGE, myCells, and myMesh.
{
int vtkId = myCells[iter];
int smdsId = myMesh->fromVtkToSmds(vtkId);
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
if (!elem)
{
MESSAGE("SMDS_MeshNode_MyInvIterator problem Null element");
throw SALOME_Exception("SMDS_MeshNode_MyInvIterator problem Null element");
}
//MESSAGE("vtkId " << vtkId << " smdsId " << smdsId << " " << elem->GetType());
iter++;
return elem;
}
| virtual void SMDS_Iterator< const SMDS_MeshElement * >.remove | ( | ) | [virtual, inherited] |
Delete the current element and step to the next one.
Definition at line 44 of file SMDS_Iterator.hxx.
{}
vector<vtkIdType> SMDS_MeshNode_MyInvIterator.cellList [private] |
Definition at line 147 of file SMDS_MeshNode.cxx.
Referenced by SMDS_MeshNode_MyInvIterator().
int SMDS_MeshNode_MyInvIterator.iter [private] |
Definition at line 146 of file SMDS_MeshNode.cxx.
vtkIdType* SMDS_MeshNode_MyInvIterator.myCells [private] |
Definition at line 143 of file SMDS_MeshNode.cxx.
Referenced by next(), and SMDS_MeshNode_MyInvIterator().
SMDS_Mesh* SMDS_MeshNode_MyInvIterator.myMesh [private] |
Definition at line 142 of file SMDS_MeshNode.cxx.
Referenced by next(), and SMDS_MeshNode_MyInvIterator().
int SMDS_MeshNode_MyInvIterator.myNcells [private] |
Definition at line 144 of file SMDS_MeshNode.cxx.
Referenced by more(), and SMDS_MeshNode_MyInvIterator().
Definition at line 145 of file SMDS_MeshNode.cxx.