1 #include "SMDS_VtkCellIterator.hxx"
3 SMDS_VtkCellIterator::SMDS_VtkCellIterator(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType aType) :
4 _mesh(mesh), _cellId(vtkCellId), _index(0), _type(aType)
6 vtkUnstructuredGrid* grid = _mesh->getGrid();
7 _vtkIdList = vtkIdList::New();
8 grid->GetCellPoints(_cellId, _vtkIdList);
9 _nbNodes = _vtkIdList->GetNumberOfIds();
13 case SMDSEntity_Tetra:
18 case SMDSEntity_Pyramid:
23 case SMDSEntity_Penta:
25 //this->exchange(1, 2);
26 //this->exchange(4, 5);
35 case SMDSEntity_Quad_Tetra:
42 case SMDSEntity_Quad_Pyramid:
47 this->exchange(10, 12);
50 case SMDSEntity_Quad_Penta:
52 //this->exchange(1, 2);
53 //this->exchange(4, 5);
54 //this->exchange(6, 8);
55 //this->exchange(9, 11);
56 //this->exchange(13, 14);
59 case SMDSEntity_Quad_Hexa:
63 this->exchange(8, 11);
64 this->exchange(9, 10);
65 this->exchange(12, 15);
66 this->exchange(13, 14);
67 this->exchange(17, 19);
75 SMDS_VtkCellIterator::~SMDS_VtkCellIterator()
80 bool SMDS_VtkCellIterator::more()
82 return (_index < _nbNodes);
85 const SMDS_MeshElement* SMDS_VtkCellIterator::next()
87 vtkIdType id = _vtkIdList->GetId(_index++);
88 return _mesh->FindNode(id);