#include <SMDS_VtkCellIterator.hxx>

Public Member Functions | |
| SMDS_VtkCellIterator (SMDS_Mesh *mesh, int vtkCellId, SMDSAbs_EntityType aType) | |
| virtual | ~SMDS_VtkCellIterator () |
| 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 Member Functions | |
| SMDS_VtkCellIterator () | |
Protected Attributes | |
| SMDS_Mesh * | _mesh |
| int | _cellId |
| int | _index |
| int | _nbNodes |
| SMDSAbs_EntityType | _type |
| vtkIdList * | _vtkIdList |
Definition at line 30 of file SMDS_VtkCellIterator.hxx.
| SMDS_VtkCellIterator::SMDS_VtkCellIterator | ( | SMDS_Mesh * | mesh, |
| int | vtkCellId, | ||
| SMDSAbs_EntityType | aType | ||
| ) |
Definition at line 23 of file SMDS_VtkCellIterator.cxx.
References _cellId, _mesh, _nbNodes, _type, _vtkIdList, exchange(), SMDS_Mesh.getGrid(), ex11_grid3partition.grid, MESSAGE, SMDSEntity_Hexa, SMDSEntity_Penta, SMDSEntity_Polyhedra, SMDSEntity_Pyramid, SMDSEntity_Quad_Hexa, SMDSEntity_Quad_Penta, SMDSEntity_Quad_Pyramid, SMDSEntity_Quad_Tetra, and SMDSEntity_Tetra.
: _mesh(mesh), _cellId(vtkCellId), _index(0), _type(aType) { //MESSAGE("SMDS_VtkCellIterator " << _type); _vtkIdList = vtkIdList::New(); vtkUnstructuredGrid* grid = _mesh->getGrid(); grid->GetCellPoints(_cellId, _vtkIdList); _nbNodes = _vtkIdList->GetNumberOfIds(); switch (_type) { case SMDSEntity_Tetra: { this->exchange(1, 2); break; } case SMDSEntity_Pyramid: { this->exchange(1, 3); break; } case SMDSEntity_Penta: { //this->exchange(1, 2); //this->exchange(4, 5); break; } case SMDSEntity_Hexa: { this->exchange(1, 3); this->exchange(5, 7); break; } case SMDSEntity_Quad_Tetra: { this->exchange(1, 2); this->exchange(4, 6); this->exchange(8, 9); break; } case SMDSEntity_Quad_Pyramid: { this->exchange(1, 3); this->exchange(5, 8); this->exchange(6, 7); this->exchange(10, 12); break; } case SMDSEntity_Quad_Penta: { //this->exchange(1, 2); //this->exchange(4, 5); //this->exchange(6, 8); //this->exchange(9, 11); //this->exchange(13, 14); break; } case SMDSEntity_Quad_Hexa: { MESSAGE("SMDS_VtkCellIterator Quad_Hexa"); this->exchange(1, 3); this->exchange(5, 7); this->exchange(8, 11); this->exchange(9, 10); this->exchange(12, 15); this->exchange(13, 14); this->exchange(17, 19); break; } case SMDSEntity_Polyhedra: MESSAGE("SMDS_VtkCellIterator Polyhedra (iterate on actual nodes)"); break; default: break; } }
| SMDS_VtkCellIterator::~SMDS_VtkCellIterator | ( | ) | [virtual] |
Definition at line 99 of file SMDS_VtkCellIterator.cxx.
References _vtkIdList.
{
_vtkIdList->Delete();
}
| SMDS_VtkCellIterator.SMDS_VtkCellIterator | ( | ) | [protected] |
Definition at line 45 of file SMDS_VtkCellIterator.hxx.
{};
| void SMDS_VtkCellIterator.exchange | ( | vtkIdType | a, |
| vtkIdType | b | ||
| ) |
Definition at line 37 of file SMDS_VtkCellIterator.hxx.
References _vtkIdList.
Referenced by SMDS_VtkCellIterator().
{
vtkIdType t = _vtkIdList->GetId(a);
_vtkIdList->SetId(a, _vtkIdList->GetId(b));
_vtkIdList->SetId(b, t);
}
| bool SMDS_VtkCellIterator::more | ( | ) | [virtual] |
Return true if and only if there are other object in this iterator.
Implements SMDS_Iterator< const SMDS_MeshElement * >.
Reimplemented in SMDS_VtkCellIteratorPolyH.
Definition at line 104 of file SMDS_VtkCellIterator.cxx.
| const SMDS_MeshElement * SMDS_VtkCellIterator::next | ( | ) | [virtual] |
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 _index, _mesh, _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] |
Definition at line 48 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH.SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
int SMDS_VtkCellIterator._index [protected] |
Definition at line 49 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIteratorPolyH.more(), more(), next(), SMDS_VtkCellIteratorPolyH.SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
SMDS_Mesh* SMDS_VtkCellIterator._mesh [protected] |
Definition at line 45 of file SMDS_VtkCellIterator.hxx.
Referenced by next(), SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH.SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
int SMDS_VtkCellIterator._nbNodes [protected] |
Definition at line 50 of file SMDS_VtkCellIterator.hxx.
Referenced by more(), SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH.SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
SMDSAbs_EntityType SMDS_VtkCellIterator._type [protected] |
Definition at line 51 of file SMDS_VtkCellIterator.hxx.
Referenced by SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH.SMDS_VtkCellIteratorPolyH(), and SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV().
vtkIdList* SMDS_VtkCellIterator._vtkIdList [protected] |
Definition at line 52 of file SMDS_VtkCellIterator.hxx.
Referenced by exchange(), next(), SMDS_VtkCellIterator(), SMDS_VtkCellIteratorPolyH.SMDS_VtkCellIteratorPolyH(), SMDS_VtkCellIteratorToUNV.SMDS_VtkCellIteratorToUNV(), and ~SMDS_VtkCellIterator().