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 #include <ogdf/basic/List.h>
36 #include <ogdf/basic/memory.h>
37 
38 namespace ogdf {
39 
47 class PALabel {
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() { return m_parent != nullptr; }
61 
62  bool isCLabel() { return m_parent == nullptr; }
63 
65  node getPendant(int nr) { return nr < m_pendants.size() ? *m_pendants.get(nr) : nullptr; }
66 
67  node getFirstPendant() { return (m_pendants.size() > 0) ? m_pendants.front() : nullptr; }
68 
69  node getLastPendant() { return (m_pendants.size() > 0) ? m_pendants.back() : nullptr; }
70 
72  int size() { return m_pendants.size(); }
73 
74  void removePendant(node pendant);
75 
77 
79  if (m_pendants.size() > 0) {
80  m_pendants.popFront();
81  }
82  }
83 
84  void addPendant(node pendant) { m_pendants.pushBack(pendant); }
85 
86  void deleteAllPendants() { m_pendants.clear(); }
87 
89  node parent() { return (m_parent != nullptr) ? m_parent : m_head; }
90 
92  node head() { return m_head; }
93 
94  void setParent(node newParent) { m_parent = newParent; }
95 
96  void setHead(node newHead) { m_head = newHead; }
97 
99 
100  void stopCause(StopCause sc) { m_stopCause = sc; }
101 
103 
104 private:
112 
114 
116 
120 };
121 
122 using pa_label = PALabel*;
123 
124 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::PALabel::addPendant
void addPendant(node pendant)
Definition: PALabel.h:84
ogdf::PALabel::m_pendants
List< node > m_pendants
list with all pendants of the label
Definition: PALabel.h:115
ogdf::PALabel::parent
node parent()
return the parent node. If the label is a c-label it returns m_head
Definition: PALabel.h:89
ogdf::PALabel::head
node head()
returns the head node
Definition: PALabel.h:92
ogdf::PALabel::removePendant
void removePendant(ListIterator< node > it)
Definition: PALabel.h:76
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:111
ogdf::PALabel::StopCause::Planarity
@ Planarity
OGDF_NEW_DELETE
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition: memory.h:85
ogdf::PALabel::m_head
node m_head
the cutvertex and perhaps (see m_parent) the parent node
Definition: PALabel.h:113
ogdf::PlanarAugmentation
The algorithm for planar biconnectivity augmentation (Mutzel, Fialko).
Definition: PlanarAugmentation.h:62
ogdf::PALabel::removePendant
void removePendant(node pendant)
ogdf::PALabel::getFirstPendant
node getFirstPendant()
Definition: PALabel.h:67
ogdf::PALabel::StopCause::BDegree
@ BDegree
ogdf::PALabel
auxiliary class for the planar augmentation algorithm
Definition: PALabel.h:47
ogdf::PALabel::setParent
void setParent(node newParent)
Definition: PALabel.h:94
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::PALabel::size
int size()
return number of pendants
Definition: PALabel.h:72
ogdf::PALabel::StopCause::CDegree
@ CDegree
ogdf::PALabel::stopCause
StopCause stopCause()
Definition: PALabel.h:98
ogdf::PALabel::StopCause
StopCause
Definition: PALabel.h:52
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:119
ogdf::PALabel::getLastPendant
node getLastPendant()
Definition: PALabel.h:69
ogdf::PALabel::setHead
void setHead(node newHead)
Definition: PALabel.h:96
ogdf::PlanarAugmentationFix
The algorithm for biconnectivity augmentation with fixed combinatorial embedding.
Definition: PlanarAugmentationFix.h:50
ogdf::PALabel::getPendant
node getPendant(int nr)
return pendant with number nr, starts counting at 0
Definition: PALabel.h:65
List.h
Declaration of doubly linked lists and iterators.
ogdf::PALabel::PALabel
PALabel(node parent, node cutvertex, StopCause sc=StopCause::BDegree)
Definition: PALabel.h:54
ogdf::PALabel::isCLabel
bool isCLabel()
Definition: PALabel.h:62
ogdf::ListIteratorBase
Encapsulates a pointer to a list element.
Definition: List.h:51
ogdf::PALabel::removeFirstPendant
void removeFirstPendant()
Definition: PALabel.h:78
ogdf::PALabel::stopCause
void stopCause(StopCause sc)
Definition: PALabel.h:100
ogdf::PALabel::StopCause::Root
@ Root
ogdf::PALabel::deleteAllPendants
void deleteAllPendants()
Definition: PALabel.h:86
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
memory.h
Declaration of memory manager for allocating small pieces of memory.
ogdf::PALabel::isBLabel
bool isBLabel()
Definition: PALabel.h:60