Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PALabel.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 
36 namespace ogdf {
37 
45 class PALabel {
46  friend class PlanarAugmentation;
47  friend class PlanarAugmentationFix;
48 
49 public:
50  enum class StopCause { Planarity, CDegree, BDegree, Root };
51 
53  m_parent = parent;
54  m_head = cutvertex;
55  m_stopCause = sc;
56  }
57 
58  bool isBLabel() { return m_parent != nullptr; }
59 
60  bool isCLabel() { return m_parent == nullptr; }
61 
63  node getPendant(int nr) { return nr < m_pendants.size() ? *m_pendants.get(nr) : nullptr; }
64 
65  node getFirstPendant() { return (m_pendants.size() > 0) ? m_pendants.front() : nullptr; }
66 
67  node getLastPendant() { return (m_pendants.size() > 0) ? m_pendants.back() : nullptr; }
68 
70  int size() { return m_pendants.size(); }
71 
72  void removePendant(node pendant);
73 
75 
77  if (m_pendants.size() > 0) {
78  m_pendants.popFront();
79  }
80  }
81 
82  void addPendant(node pendant) { m_pendants.pushBack(pendant); }
83 
84  void deleteAllPendants() { m_pendants.clear(); }
85 
87  node parent() { return (m_parent != nullptr) ? m_parent : m_head; }
88 
90  node head() { return m_head; }
91 
92  void setParent(node newParent) { m_parent = newParent; }
93 
94  void setHead(node newHead) { m_head = newHead; }
95 
97 
98  void stopCause(StopCause sc) { m_stopCause = sc; }
99 
101 
102 private:
110 
112 
114 
118 };
119 
120 using pa_label = PALabel*;
121 
122 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
Graph.h
Includes declaration of graph class.
ogdf::PALabel::addPendant
void addPendant(node pendant)
Definition: PALabel.h:82
ogdf::PALabel::m_pendants
List< node > m_pendants
list with all pendants of the label
Definition: PALabel.h:113
ogdf::PALabel::parent
node parent()
return the parent node. If the label is a c-label it returns m_head
Definition: PALabel.h:87
ogdf::PALabel::head
node head()
returns the head node
Definition: PALabel.h:90
ogdf::PALabel::removePendant
void removePendant(ListIterator< node > it)
Definition: PALabel.h:74
ogdf::PALabel::m_parent
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:109
ogdf::PALabel::StopCause::Planarity
@ Planarity
OGDF_NEW_DELETE
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition: memory.h:84
ogdf::PALabel::m_head
node m_head
the cutvertex and perhaps (see m_parent) the parent node
Definition: PALabel.h:111
ogdf::PlanarAugmentation
The algorithm for planar biconnectivity augmentation (Mutzel, Fialko).
Definition: PlanarAugmentation.h:59
ogdf::PALabel::removePendant
void removePendant(node pendant)
ogdf::PALabel::getFirstPendant
node getFirstPendant()
Definition: PALabel.h:65
ogdf::PALabel::StopCause::BDegree
@ BDegree
ogdf::PALabel
auxiliary class for the planar augmentation algorithm
Definition: PALabel.h:45
ogdf::PALabel::setParent
void setParent(node newParent)
Definition: PALabel.h:92
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::PALabel::size
int size()
return number of pendants
Definition: PALabel.h:70
ogdf::PALabel::StopCause::CDegree
@ CDegree
ogdf::PALabel::stopCause
StopCause stopCause()
Definition: PALabel.h:96
ogdf::PALabel::StopCause
StopCause
Definition: PALabel.h:50
ogdf::PALabel::m_stopCause
StopCause m_stopCause
the stop cause that occurs when traversing from the pendants to the bc-tree-root computed in PlanarAu...
Definition: PALabel.h:117
ogdf::PALabel::getLastPendant
node getLastPendant()
Definition: PALabel.h:67
ogdf::PALabel::setHead
void setHead(node newHead)
Definition: PALabel.h:94
ogdf::PlanarAugmentationFix
The algorithm for biconnectivity augmentation with fixed combinatorial embedding.
Definition: PlanarAugmentationFix.h:46
ogdf::PALabel::getPendant
node getPendant(int nr)
return pendant with number nr, starts counting at 0
Definition: PALabel.h:63
ogdf::PALabel::PALabel
PALabel(node parent, node cutvertex, StopCause sc=StopCause::BDegree)
Definition: PALabel.h:52
ogdf::PALabel::isCLabel
bool isCLabel()
Definition: PALabel.h:60
ogdf::ListIteratorBase
Encapsulates a pointer to a list element.
Definition: List.h:46
ogdf::PALabel::removeFirstPendant
void removeFirstPendant()
Definition: PALabel.h:76
ogdf::PALabel::stopCause
void stopCause(StopCause sc)
Definition: PALabel.h:98
ogdf::PALabel::StopCause::Root
@ Root
ogdf::PALabel::deleteAllPendants
void deleteAllPendants()
Definition: PALabel.h:84
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::PALabel::isBLabel
bool isBLabel()
Definition: PALabel.h:58