![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 #ifndef FACEITERATOR2_H 00022 #define FACEITERATOR2_H 00023 00024 #include <vector> 00025 00026 #include <tulip/Iterator.h> 00027 #include <tulip/Face.h> 00028 #include <tulip/Node.h> 00029 #include <tulip/Edge.h> 00030 00031 #ifndef DOXYGEN_NOTFOR_DEVEL 00032 //============================================================ 00033 /// Face iterator for PlanarConMap 00034 namespace tlp { 00035 00036 class PlanarConMap; 00037 00038 class FaceIterator : public Iterator<Face> { 00039 public: 00040 FaceIterator(PlanarConMap* m); 00041 virtual ~FaceIterator() {} 00042 00043 Face next(); 00044 bool hasNext(); 00045 00046 private: 00047 unsigned int i; 00048 PlanarConMap* mgraph; 00049 }; 00050 00051 //============================================================ 00052 /// Adjacente Face iterator for PlanarConMap 00053 class FaceAdjIterator : public Iterator<Face> { 00054 public: 00055 FaceAdjIterator(PlanarConMap* m, const node n); 00056 virtual ~FaceAdjIterator() {} 00057 00058 Face next(); 00059 bool hasNext(); 00060 00061 private: 00062 std::vector<Face> facesAdj; 00063 unsigned int i; 00064 }; 00065 00066 //============================================================ 00067 /// Node of face iterator for PlanarConMap 00068 class NodeFaceIterator : public Iterator<node> { 00069 public : 00070 NodeFaceIterator(PlanarConMap *m, const Face ); 00071 virtual ~NodeFaceIterator() {} 00072 00073 node next(); 00074 bool hasNext(); 00075 00076 private : 00077 /** contains the set of computed nodes */ 00078 std::vector<node> nodes; 00079 unsigned int i; 00080 }; 00081 00082 00083 //============================================================ 00084 /// Edge of face iterator for PlanarConMap 00085 class EdgeFaceIterator : public Iterator<edge> { 00086 public : 00087 EdgeFaceIterator(PlanarConMap *m, const Face ); 00088 virtual ~EdgeFaceIterator() {} 00089 00090 edge next(); 00091 bool hasNext(); 00092 00093 private : 00094 /** reference on the current face */ 00095 std::vector<edge> ve; 00096 unsigned int i; 00097 }; 00098 00099 } 00100 #endif 00101 #endif 00102 ///@endcond