Tulip  4.7.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
FaceIterator.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip 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.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef FACEITERATOR2_H
22 #define FACEITERATOR2_H
23 
24 #include <vector>
25 
26 #include <tulip/Iterator.h>
27 #include <tulip/Face.h>
28 #include <tulip/Node.h>
29 #include <tulip/Edge.h>
30 
31 #ifndef DOXYGEN_NOTFOR_DEVEL
32 //============================================================
33 /// Face iterator for PlanarConMap
34 namespace tlp {
35 
36 class PlanarConMap;
37 
38 class FaceIterator : public Iterator<Face> {
39 public:
40  FaceIterator(PlanarConMap* m);
41  virtual ~FaceIterator() {}
42 
43  Face next();
44  bool hasNext();
45 
46 private:
47  unsigned int i;
48  PlanarConMap* mgraph;
49 };
50 
51 //============================================================
52 /// Adjacente Face iterator for PlanarConMap
53 class FaceAdjIterator : public Iterator<Face> {
54 public:
55  FaceAdjIterator(PlanarConMap* m, const node n);
56  virtual ~FaceAdjIterator() {}
57 
58  Face next();
59  bool hasNext();
60 
61 private:
62  std::vector<Face> facesAdj;
63  unsigned int i;
64 };
65 
66 //============================================================
67 /// Node of face iterator for PlanarConMap
68 class NodeFaceIterator : public Iterator<node> {
69 public :
70  NodeFaceIterator(PlanarConMap *m, const Face );
71  virtual ~NodeFaceIterator() {}
72 
73  node next();
74  bool hasNext();
75 
76 private :
77  /** contains the set of computed nodes */
78  std::vector<node> nodes;
79  unsigned int i;
80 };
81 
82 
83 //============================================================
84 /// Edge of face iterator for PlanarConMap
85 class EdgeFaceIterator : public Iterator<edge> {
86 public :
87  EdgeFaceIterator(PlanarConMap *m, const Face );
88  virtual ~EdgeFaceIterator() {}
89 
90  edge next();
91  bool hasNext();
92 
93 private :
94  /** reference on the current face */
95  std::vector<edge> ve;
96  unsigned int i;
97 };
98 
99 }
100 #endif
101 #endif
102 ///@endcond