#include <SMDS_VtkCellIterator.hxx>

Public Member Functions | |
| SMDS_VtkCellIteratorPolyH (SMDS_Mesh *mesh, int vtkCellId, SMDSAbs_EntityType aType) | |
| virtual | ~SMDS_VtkCellIteratorPolyH () |
| virtual bool | more () |
| Return true if and only if there are other object in this iterator. | |
| virtual const SMDS_MeshElement * | next () |
| Return the current object and step to the next one. | |
| void | exchange (vtkIdType a, vtkIdType b) |
| virtual void | remove () |
| Delete the current element and step to the next one. | |
Protected Attributes | |
| int | _nbNodesInFaces |
| SMDS_Mesh * | _mesh |
| int | _cellId |
| int | _index |
| int | _nbNodes |
| SMDSAbs_EntityType | _type |
| vtkIdList * | _vtkIdList |
Definition at line 62 of file SMDS_VtkCellIterator.hxx.
| SMDS_VtkCellIteratorPolyH::SMDS_VtkCellIteratorPolyH | ( | SMDS_Mesh * | mesh, |
| int | vtkCellId, | ||
| SMDSAbs_EntityType | aType | ||
| ) |
Definition at line 201 of file SMDS_VtkCellIterator.cxx.
References SMDS_VtkCellIterator._cellId, SMDS_VtkCellIterator._index, SMDS_VtkCellIterator._mesh, SMDS_VtkCellIterator._nbNodes, _nbNodesInFaces, SMDS_VtkCellIterator._type, SMDS_VtkCellIterator._vtkIdList, SMDS_Mesh.getGrid(), ex11_grid3partition.grid, PAL_MESH_041_mesh.mesh, and SMDSEntity_Polyhedra.
: SMDS_VtkCellIterator() { _mesh = mesh; _cellId = vtkCellId; _index = 0; _type = aType; //MESSAGE("SMDS_VtkCellIteratorPolyH " << _type); _vtkIdList = vtkIdList::New(); vtkUnstructuredGrid* grid = _mesh->getGrid(); grid->GetCellPoints(_cellId, _vtkIdList); _nbNodes = _vtkIdList->GetNumberOfIds(); switch (_type) { case SMDSEntity_Polyhedra: { //MESSAGE("SMDS_VtkCellIterator Polyhedra"); vtkIdType nFaces = 0; vtkIdType* ptIds = 0; grid->GetFaceStream(_cellId, nFaces, ptIds); int id = 0; _nbNodesInFaces = 0; for (int i = 0; i < nFaces; i++) { int nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace] _nbNodesInFaces += nodesInFace; id += (nodesInFace + 1); } _vtkIdList->SetNumberOfIds(_nbNodesInFaces); id = 0; int n = 0; for (int i = 0; i < nFaces; i++) { int nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace] for (int k = 1; k <= nodesInFace; k++) _vtkIdList->SetId(n++, ptIds[id + k]); id += (nodesInFace + 1); } break; } default: assert(0); } }
| SMDS_VtkCellIteratorPolyH::~SMDS_VtkCellIteratorPolyH | ( | ) | [virtual] |
Definition at line 246 of file SMDS_VtkCellIterator.cxx.
{
}
| void SMDS_VtkCellIterator.exchange | ( | vtkIdType | a, |
| vtkIdType | b | ||
| ) | [inherited] |
Definition at line 37 of file SMDS_VtkCellIterator.hxx.
References SMDS_VtkCellIterator._vtkIdList.
Referenced by SMDS_VtkCellIterator.SMDS_VtkCellIterator().
{
vtkIdType t = _vtkIdList->GetId(a);
_vtkIdList->SetId(a, _vtkIdList->GetId(b));
_vtkIdList->SetId(b, t);
}
| bool SMDS_VtkCellIteratorPolyH::more | ( | ) | [virtual] |
Return true if and only if there are other object in this iterator.
Reimplemented from SMDS_VtkCellIterator.
Definition at line 250 of file SMDS_VtkCellIterator.cxx.
References SMDS_VtkCellIterator._index, and _nbNodesInFaces.
{
return (_index < _nbNodesInFaces);
}
| const SMDS_MeshElement * SMDS_VtkCellIterator::next | ( | ) | [virtual, inherited] |
Return the current object and step to the next one.
Implements SMDS_Iterator< const SMDS_MeshElement * >.
Definition at line 109 of file SMDS_VtkCellIterator.cxx.
References SMDS_VtkCellIterator._index, SMDS_VtkCellIterator._mesh, SMDS_VtkCellIterator._vtkIdList, and SMDS_Mesh.FindNodeVtk().
{
vtkIdType id = _vtkIdList->GetId(_index++);
return _mesh->FindNodeVtk(id);
}
| 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.
{}
int SMDS_VtkCellIterator._cellId [protected, inherited] |
Definition at line 48 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIterator.SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
int SMDS_VtkCellIterator._index [protected, inherited] |
Definition at line 49 of file SMDS_VtkCellIterator.hxx.
Referenced by more(), SMDS_VtkCellIterator.more(), SMDS_VtkCellIterator.next(), SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
SMDS_Mesh* SMDS_VtkCellIterator._mesh [protected, inherited] |
Definition at line 45 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIterator.next(), SMDS_VtkCellIterator.SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
int SMDS_VtkCellIterator._nbNodes [protected, inherited] |
Definition at line 50 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIterator.more(), SMDS_VtkCellIterator.SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
int SMDS_VtkCellIteratorPolyH._nbNodesInFaces [protected] |
Definition at line 69 of file SMDS_VtkCellIterator.hxx.
Referenced by more(), and SMDS_VtkCellIteratorPolyH().
SMDSAbs_EntityType SMDS_VtkCellIterator._type [protected, inherited] |
Definition at line 51 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIterator.SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
vtkIdList* SMDS_VtkCellIterator._vtkIdList [protected, inherited] |
Definition at line 52 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIterator.exchange(), SMDS_VtkCellIterator.next(), SMDS_VtkCellIterator.SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH(), SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV(), and SMDS_VtkCellIterator.~SMDS_VtkCellIterator().