Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
planarity.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file planarity.h
1 /* This software is distributed under the GNU Lesser General Public License */
2 //==========================================================================
3 //
4 // planarity.h
5 //
6 //==========================================================================
7 // $Id: planarity.h,v 1.22 2008/02/03 18:17:08 chris Exp $
8 
9 #ifndef PLANARITY_H
10 #define PLANARITY_H
11 
12 #include <GTL/GTL.h>
13 #include <GTL/graph.h>
14 #include <GTL/algorithm.h>
15 #include <GTL/st_number.h>
16 #include <GTL/embedding.h>
17 #include <GTL/biconnectivity.h>
18 #include <GTL/pq_node.h>
19 
21 
48 {
49 public:
55  planarity();
56 
60  ~planarity();
61 
81  int check(graph& G);
82 
99  int run(graph& G);
100 
107  void reset();
108 
118  void calc_embedding(bool p)
119  {
120  emp = p;
121  if (!emp) kup = false;
122  }
123 
133  bool calc_embedding () const
134  { return emp; }
135 
147  void calc_obstruction(bool p)
148  {
149  kup = p;
150  if (kup) emp = true;
151  }
152 
162  bool calc_obstruction() const
163  {
164  return kup;
165  }
166 
184  void make_biconnected(bool p)
185  {
186  bip = p;
187  }
188 
197  bool make_biconnected() const
198  {
199  return bip;
200  }
201 
207  bool is_planar() const
208  {
209  return planar;
210  }
211 
220  planar_embedding& get_embedding()
221  {
222  return embedding;
223  }
224 
234  list<edge>& get_obstruction_edges()
235  {
236  return ob_edges;
237  }
238 
248  list<node>& get_obstruction_nodes()
249  {
250  return ob_nodes;
251  }
252 private:
264  bool run_on_biconnected(graph& G, planar_embedding& em);
265 
274  void add_to_embedding(graph& G, planar_embedding& em);
275 
288  void correct_embedding(planar_embedding& em,
289  st_number& st,
290  node_map<list<direction_indicator> >& dirs);
291 
306  void extend_embedding(
307  node n,
308  planar_embedding& em,
309  node_map<int>& mark,
310  node_map<symlist<edge>::iterator >& upward_begin);
311 
324  void switch_to_component(graph& G,
326 
344  void examine_obstruction(graph& G,
345  st_number& st,
346  node act,
347  pq_node* fail,
348  bool failed_at_root,
349  planar_embedding& em,
350  node_map<list<direction_indicator> >& dirs,
351  pq_tree* PQ);
352 
367  void dfs_bushform(node act,
368  node_map<int>& mark,
369  st_number& st,
370  int stop,
371  node_map<edge>& to_father);
372 
373 
386  void attachment_cycle (node n, planar_embedding& em);
387 
399  void mark_all_neighbors_of_leaves (pq_node* act, node_map<int>& mark);
400 
414  pq_leaf* run_through_partial(q_node* partial,
415  node_map<int>& mark,
416  node_map<edge>& to_father,
417  node v);
418 
429  node up_until_marked(node act,
430  node_map<int>& mark,
431  node_map<edge>& to_father);
432 
444  node up_until_marked(node act,
445  node_map<int>& mark,
446  st_number& st);
447 
456  pq_leaf* search_full_leaf (pq_node* n);
457 
466  pq_leaf* search_empty_leaf(pq_node* n);
467 
479  void case_A(p_node* p_fail,
480  node act,
481  st_number& _st,
482  node_map<edge> to_father,
483  graph& G);
484 
496  void case_B(p_node* p_fail,
497  node act,
498  st_number& _st,
499  node_map<edge> to_father,
500  graph& G);
501 
516  void case_C(node* nodes,
517  pq_leaf** leaves,
518  st_number& _st,
519  node_map<edge> to_father,
520  graph& G,
521  q_node* q_fail);
522 
537  void case_D(node* nodes,
538  pq_leaf** leaves,
539  st_number& _st,
540  node_map<edge> to_father,
541  graph& G,
542  q_node* q_fail);
543 
558  void case_E(node* nodes,
559  pq_leaf** leaves,
560  st_number& _st,
561  node_map<edge> to_father,
562  graph& G,
563  q_node* q_fail);
564 
565 #ifdef _DEBUG
566 
569  void write_bushform(graph& G, st_number& _st, int k, const char* name,
570  const node_map<int>& mark, const node_map<edge>& to_father);
571 
575  void write_node(ostream& os, int id, int label, int mark);
576 #endif
577 
581  list<edge> ob_edges;
582 
586  list<node> ob_nodes;
587 
592 
596  bool planar;
597 
601  bool emp;
602 
606  bool kup;
607 
611  bool bip;
612 };
613 
615 
616 #endif // PLANARITY_H
617 
618 //--------------------------------------------------------------------------
619 // end of file
620 //--------------------------------------------------------------------------