1 #include "SMDS_VtkCellIterator.hxx"
3 SMDS_VtkCellIterator::SMDS_VtkCellIterator(SMDS_Mesh* mesh, int vtkCellId,
4 SMDSAbs_EntityType aType) :
5 _mesh(mesh), _cellId(vtkCellId), _index(0), _type(aType)
7 vtkUnstructuredGrid* grid = _mesh->getGrid();
8 _vtkIdList = vtkIdList::New();
9 grid->GetCellPoints(_cellId, _vtkIdList);
10 _nbNodes = _vtkIdList->GetNumberOfIds();
14 case SMDSEntity_Tetra:
19 case SMDSEntity_Pyramid:
24 case SMDSEntity_Penta:
26 //this->exchange(1, 2);
27 //this->exchange(4, 5);
36 case SMDSEntity_Quad_Tetra:
43 case SMDSEntity_Quad_Pyramid:
48 this->exchange(10, 12);
51 case SMDSEntity_Quad_Penta:
53 //this->exchange(1, 2);
54 //this->exchange(4, 5);
55 //this->exchange(6, 8);
56 //this->exchange(9, 11);
57 //this->exchange(13, 14);
60 case SMDSEntity_Quad_Hexa:
64 this->exchange(8, 11);
65 this->exchange(9, 10);
66 this->exchange(12, 15);
67 this->exchange(13, 14);
68 this->exchange(17, 19);
76 SMDS_VtkCellIterator::~SMDS_VtkCellIterator()
81 bool SMDS_VtkCellIterator::more()
83 return (_index < _nbNodes);
86 const SMDS_MeshElement* SMDS_VtkCellIterator::next()
88 vtkIdType id = _vtkIdList->GetId(_index++);
89 return _mesh->FindNode(id);