Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
38namespace ogdf {
39
47class PALabel {
48 friend class PlanarAugmentation;
50
51public:
53
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
104private:
112
114
116
120};
121
123
124}
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Encapsulates a pointer to a list element.
Definition List.h:113
Class for the representation of nodes.
Definition Graph_d.h:241
auxiliary class for the planar augmentation algorithm
Definition PALabel.h:47
void removePendant(ListIterator< node > it)
Definition PALabel.h:76
bool isBLabel()
Definition PALabel.h:60
node m_head
the cutvertex and perhaps (see m_parent) the parent node
Definition PALabel.h:113
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
void addPendant(node pendant)
Definition PALabel.h:84
node getPendant(int nr)
return pendant with number nr, starts counting at 0
Definition PALabel.h:65
void stopCause(StopCause sc)
Definition PALabel.h:100
int size()
return number of pendants
Definition PALabel.h:72
node parent()
return the parent node. If the label is a c-label it returns m_head
Definition PALabel.h:89
List< node > m_pendants
list with all pendants of the label
Definition PALabel.h:115
bool isCLabel()
Definition PALabel.h:62
StopCause stopCause()
Definition PALabel.h:98
node getFirstPendant()
Definition PALabel.h:67
void removePendant(node pendant)
void deleteAllPendants()
Definition PALabel.h:86
void setParent(node newParent)
Definition PALabel.h:94
PALabel(node parent, node cutvertex, StopCause sc=StopCause::BDegree)
Definition PALabel.h:54
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
node head()
returns the head node
Definition PALabel.h:92
void removeFirstPendant()
Definition PALabel.h:78
node getLastPendant()
Definition PALabel.h:69
void setHead(node newHead)
Definition PALabel.h:96
The algorithm for biconnectivity augmentation with fixed combinatorial embedding.
The algorithm for planar biconnectivity augmentation (Mutzel, Fialko).
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition memory.h:85
Declaration of memory manager for allocating small pieces of memory.
The namespace for all OGDF objects.