Added getNeighbours functions to class Operation + moved UpdateMeshDensity to class...
[engrid.git] / iterator.h
blobad546ab60df01429088c3165591bf41ea55dd124
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008,2009 Oliver Gloth +
7 // + +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
12 // + +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
17 // + +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 // + +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #ifndef iterator_H
24 #define iterator_H
26 class Iterator;
28 #include "operation.h"
30 class Iterator : public Operation
33 private: // attributes
35 protected: // attributes
37 struct pair_t
39 vtkIdType item1;
40 vtkIdType item2;
41 bool terminate;
44 QVector<pair_t> pair;
46 /** array used to mark item for the next iteration loop. */
47 QVector<bool> mark1;
49 /** array used to marked "finished" items */
50 QVector<bool> mark2;
52 QVector<vtkIdType> item;
54 bool volume_iteration;
55 bool custom_iteration;
57 QVector<vtkIdType> cells;
58 QVector<vtkIdType> nodes;
59 QVector<int> _cells;
60 QVector<int> _nodes;
61 QVector<QSet<int> > n2c;
62 QVector<QSet<int> > n2n;
63 QVector<QVector<int> > c2c;
66 protected: // methods
68 virtual void pass1();
69 virtual void pass2() {};
70 void getCells();
72 public: // methods
74 Iterator();
76 void setVolumeIteration() { volume_iteration = true; };
77 void setSurfaceIteration() { volume_iteration = false; };
81 #endif