Tulip  5.0.0
Large graphs analysis and drawing
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 //============================================================
32 /// Face iterator for PlanarConMap
33 namespace tlp {
34 
35 class PlanarConMap;
36 
37 class FaceIterator : public Iterator<Face> {
38 public:
39  FaceIterator(PlanarConMap* m);
40  virtual ~FaceIterator() {}
41 
42  Face next();
43  bool hasNext();
44 
45 private:
46  unsigned int i;
47  PlanarConMap* mgraph;
48 };
49 
50 //============================================================
51 /// Adjacente Face iterator for PlanarConMap
52 class FaceAdjIterator : public Iterator<Face> {
53 public:
54  FaceAdjIterator(PlanarConMap* m, const node n);
55  virtual ~FaceAdjIterator() {}
56 
57  Face next();
58  bool hasNext();
59 
60 private:
61  std::vector<Face> facesAdj;
62  unsigned int i;
63 };
64 
65 //============================================================
66 /// Node of face iterator for PlanarConMap
67 class NodeFaceIterator : public Iterator<node> {
68 public :
69  NodeFaceIterator(PlanarConMap *m, const Face );
70  virtual ~NodeFaceIterator() {}
71 
72  node next();
73  bool hasNext();
74 
75 private :
76  /** contains the set of computed nodes */
77  std::vector<node> nodes;
78  unsigned int i;
79 };
80 
81 
82 //============================================================
83 /// Edge of face iterator for PlanarConMap
84 class EdgeFaceIterator : public Iterator<edge> {
85 public :
86  EdgeFaceIterator(PlanarConMap *m, const Face );
87  virtual ~EdgeFaceIterator() {}
88 
89  edge next();
90  bool hasNext();
91 
92 private :
93  /** reference on the current face */
94  std::vector<edge> ve;
95  unsigned int i;
96 };
97 
98 }
99 #endif
100 
101 ///@endcond
Interface for Tulip iterators. Allows basic iteration operations only.
Definition: Iterator.h:39