Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

PALabel.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 
36 
37 namespace ogdf {
38 
46 class PALabel
47 {
48  friend class PlanarAugmentation;
49  friend class PlanarAugmentationFix;
50 
51 public:
52  enum class StopCause { Planarity, CDegree, BDegree, Root };
53 
55  m_parent = parent;
56  m_head = cutvertex;
57  m_stopCause = sc;
58  }
59 
60  bool isBLabel() {
61  return m_parent != nullptr;
62  }
63 
64  bool isCLabel() {
65  return m_parent == nullptr;
66  }
67 
69  node getPendant(int nr) {
70  return nr < m_pendants.size() ? *m_pendants.get(nr) : nullptr;
71  }
72 
74  return (m_pendants.size() > 0) ? m_pendants.front() : nullptr;
75  }
76 
78  return (m_pendants.size() > 0) ? m_pendants.back() : nullptr;
79  }
80 
82  int size() {
83  return m_pendants.size();
84  }
85 
86  void removePendant(node pendant);
87 
89  m_pendants.del(it);
90  }
91 
93  if (m_pendants.size() > 0){
94  m_pendants.popFront();
95  }
96  }
97 
98  void addPendant(node pendant) {
99  m_pendants.pushBack(pendant);
100  }
101 
103  m_pendants.clear();
104  }
105 
108  return (m_parent != nullptr) ? m_parent : m_head;
109  }
110 
112  node head() {
113  return m_head;
114  }
115 
116  void setParent(node newParent){
117  m_parent = newParent;
118  }
119 
120  void setHead(node newHead){
121  m_head = newHead;
122  }
123 
125  return m_stopCause;
126  }
127 
129  m_stopCause = sc;
130  }
131 
133 
134 private:
135 
143 
145 
147 
149 };
150 
151 using pa_label = PALabel*;
152 
153 }
void removeFirstPendant()
Definition: PALabel.h:92
auxiliary class for the planar augmentation algorithm
Definition: PALabel.h:46
int size()
return number of pendants
Definition: PALabel.h:82
node m_head
the cutvertex and perhaps (see m_parent) the parent node
Definition: PALabel.h:144
node head()
returns the head node
Definition: PALabel.h:112
void removePendant(node pendant)
bool isCLabel()
Definition: PALabel.h:64
node getPendant(int nr)
return pendant with number nr, starts counting at 0
Definition: PALabel.h:69
void stopCause(StopCause sc)
Definition: PALabel.h:128
The algorithm for biconnectivity augmentation with fixed combinatorial embedding. ...
void deleteAllPendants()
Definition: PALabel.h:102
StopCause m_stopCause
the stop cause that occurs when traversing from the pendants to the bc-tree-root computed in PlanarAu...
Definition: PALabel.h:148
The algorithm for planar biconnectivity augmentation (Mutzel, Fialko).
void setParent(node newParent)
Definition: PALabel.h:116
StopCause stopCause()
Definition: PALabel.h:124
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
PALabel(node parent, node cutvertex, StopCause sc=StopCause::BDegree)
Definition: PALabel.h:54
Class for the representation of nodes.
Definition: Graph_d.h:169
Encapsulates a pointer to a list element.
Definition: List.h:42
node m_parent
the "parent" of the pendants in the BC-Tree, m_parent is a b-vertex or a c-vertex if it is a b-vertex...
Definition: PALabel.h:142
#define OGDF_NEW_DELETE
Makes the class use OGDF&#39;s memory allocator.
Definition: memory.h:84
bool isBLabel()
Definition: PALabel.h:60
node getLastPendant()
Definition: PALabel.h:77
Includes declaration of graph class.
void addPendant(node pendant)
Definition: PALabel.h:98
void setHead(node newHead)
Definition: PALabel.h:120
node getFirstPendant()
Definition: PALabel.h:73
List< node > m_pendants
list with all pendants of the label
Definition: PALabel.h:146
The namespace for all OGDF objects.
node parent()
return the parent node. If the label is a c-label it returns m_head
Definition: PALabel.h:107
void removePendant(ListIterator< node > it)
Definition: PALabel.h:88