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