Tulip  4.4.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
Ordering.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 1 and Inria Bordeaux - Sud Ouest
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 ORDERING_H
22 #define ORDERING_H
23 #include <tulip/Face.h>
24 //#include <tulip/PlanarConMap.h>
25 #include <tulip/Node.h>
26 #include <tulip/Edge.h>
27 //#include <vector>
28 //#include <map>
29 
30 #include <tulip/MutableContainer.h>
31 
32 #ifndef DOXYGEN_NOTFOR_USER
33 
34 namespace tlp {
35 class PluginProgress;
36 class PlanarConMap;
37 
38 class TLP_SCOPE Ordering {
39 public :
40 
41  typedef struct FaceAndPos_ {
42  Face face;
43  node n_first;
44  node n_last;
45  } FaceAndPos;
46 
47  std::vector<edge> getDummyEdges() {
48  return dummy_edge;
49  }
50 
51  Ordering(PlanarConMap * G, PluginProgress* pluginProgress = 0,
52  int minProgress = 0, int deltaProgress = 0, int maxProgress = 0);
53  ~Ordering();
54 // inline void push_back(std::vector<node> nodeVector) {
55  inline size_t size() {
56  return _data.size();
57  }
58  inline std::vector<node> operator[](const unsigned int i) const {
59  return _data[i];
60  }
61  inline std::vector<node>& operator[](const unsigned int i) {
62  return _data[i];
63  }
64 
65 private :
66  std::vector<std::vector<node> > _data;
67  PlanarConMap * Gp;
68  MutableContainer<int> oute;
69  MutableContainer<int> outv;
70  MutableContainer<bool> visitedNodes;
71  MutableContainer<bool> visitedFaces;
72  MutableContainer<bool> markedFaces;
73  MutableContainer<int> seqP;
74  MutableContainer<bool> isOuterFace;
75  MutableContainer<bool> contour;
76  MutableContainer<bool> is_selectable;
77  MutableContainer<bool> is_selectable_visited;
78  MutableContainer<bool> is_selectable_face;
79  MutableContainer<bool> is_selectable_visited_face;
80  MutableContainer<node> left;
81  MutableContainer<node> right;
82  bool existMarkedF;
83  FaceAndPos minMarkedFace ;
84  Face ext;
85  std::vector<node> v1;
86  std::vector<edge> dummy_edge;
87 
88  node getLastOfQ(Face f, node prec, node n, edge e);
89  node getLastOfP(Face f, node prec, node n,edge e);
90  std::vector<node> getPathFrom(std::vector<node> fn, int from);
91  int infFaceSize();
92 
93  void updateOutAndVisitedFaces(Face f);
94  void updateContourLeftRight(node prec, node n, edge e, node last);
95  void updateNewSelectableNodes(node node_f, node no_tmp2,edge ed_tmp, node node_last,std::vector<Face> v_faces, bool one_face = false, bool was_visited = false, bool selection_face = false);
96  void updateSelectableFaces(std::vector<Face> v_faces);
97 
98  int seqp(Face f);
99  void minMarkedf();
100  void setMinMarkedFace(Face f);
101 
102  struct augmentableAndNodes_ getAugAndNodes(Face f);
103  void augment(Face f, node prec, node n, node prec_last, node last, int nbNewFace, bool pair);
104  void selectAndUpdate(Face f);
105  void selectAndUpdate(node n);
106  bool isSelectable(node n);
107 
108  void init();
109  void init_v1(std::vector<node> fn);
110  void init_selectableNodes();
111  void init_selectableFaces();
112  void init_outv_oute();
113  void init_seqP();
114  void init_outerface();
115 
116 };
117 
118 }
119 #endif
120 #endif
121 ///@endcond