Salome HOME
Replace oe by ?
[modules/smesh.git] / src / SMDS / SMDS_VtkCellIterator.hxx
1 #ifndef _SMDS_VTKCELLITERATOR_HXX_
2 #define _SMDS_VTKCELLITERATOR_HXX_
3
4 #include "SMDS_ElemIterator.hxx"
5 #include "SMDS_Mesh.hxx"
6 #include "SMDSAbs_ElementType.hxx"
7
8 #include <vtkCell.h>
9 #include <vtkIdList.h>
10
11 class SMDS_VtkCellIterator: public SMDS_ElemIterator
12 {
13 public:
14   SMDS_VtkCellIterator(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType aType);
15   virtual ~SMDS_VtkCellIterator();
16   virtual bool more();
17   virtual const SMDS_MeshElement* next();
18   inline void exchange(vtkIdType a, vtkIdType b)
19   {
20     vtkIdType t = _vtkIdList->GetId(a);
21     _vtkIdList->SetId(a, _vtkIdList->GetId(b));
22     _vtkIdList->SetId(b, t);
23   }
24
25 protected:
26   SMDS_VtkCellIterator() {};
27
28   SMDS_Mesh* _mesh;
29   int _cellId;
30   int _index;
31   int _nbNodes;
32   SMDSAbs_EntityType _type;
33   vtkIdList* _vtkIdList;
34 };
35
36 class SMDS_VtkCellIteratorToUNV: public SMDS_VtkCellIterator
37 {
38 public:
39   SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType aType);
40   virtual ~SMDS_VtkCellIteratorToUNV();
41 };
42
43 class SMDS_VtkCellIteratorPolyH: public SMDS_VtkCellIterator
44 {
45 public:
46   SMDS_VtkCellIteratorPolyH(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType aType);
47   virtual ~SMDS_VtkCellIteratorPolyH();
48   virtual bool more();
49 protected:
50   int _nbNodesInFaces;
51 };
52
53 #endif