|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
46 template<
class T,
class X,
class Y>
48 template<
class T,
class X,
class Y>
50 template<
class T,
class X,
class Y>
52 template<
class T,
class X,
class Y>
55 template<
class T,
class X,
class Y>
78 explicit PQNode(
int count);
151 if (side == SibDirection::Left || side == SibDirection::NoDir) {
153 }
else if (side == SibDirection::Right) {
169 if (side == SibDirection::Left) {
171 }
else if (side == SibDirection::Right) {
255 return SibDirection::Left;
260 return SibDirection::Right;
280 if (preference == SibDirection::Left) {
288 return SibDirection::Right;
293 return SibDirection::Left;
305 if (pointerToInfo !=
nullptr) {
373 virtual PQNodeMark
mark()
const = 0;
376 virtual void mark(PQNodeMark) = 0;
389 virtual PQNodeStatus
status()
const = 0;
392 virtual void status(PQNodeStatus) = 0;
404 virtual PQNodeType
type()
const = 0;
407 virtual void type(PQNodeType) = 0;
514 template<
class T,
class X,
class Y>
516 if (m_leftEndmost == oldEnd) {
517 m_leftEndmost = newEnd;
519 }
else if (m_rightEndmost == oldEnd) {
520 m_rightEndmost = newEnd;
538 template<
class T,
class X,
class Y>
540 if (m_sibLeft == oldSib) {
543 }
else if (m_sibRight == oldSib) {
555 template<
class T,
class X,
class Y>
557 m_identificationNumber = count;
559 m_pertChildCount = 0;
561 m_debugTreeNumber = 0;
562 m_parentType = PQNodeType::Undefined;
565 m_firstFull =
nullptr;
567 m_sibRight =
nullptr;
568 m_referenceChild =
nullptr;
569 m_referenceParent =
nullptr;
570 m_leftEndmost =
nullptr;
571 m_rightEndmost =
nullptr;
576 m_pointerToInfo = infoPtr;
577 infoPtr->setNodePointer(
this);
584 template<
class T,
class X,
class Y>
586 m_identificationNumber = count;
588 m_pertChildCount = 0;
590 m_debugTreeNumber = 0;
591 m_parentType = PQNodeType::Undefined;
594 m_firstFull =
nullptr;
596 m_sibRight =
nullptr;
597 m_referenceChild =
nullptr;
598 m_referenceParent =
nullptr;
599 m_leftEndmost =
nullptr;
600 m_rightEndmost =
nullptr;
605 m_pointerToInfo =
nullptr;
PQNode< T, X, Y > * referenceChild() const
Returns a pointer to the reference child if node is a P-node.
The namespace for all OGDF objects.
void parentType(PQNodeType newParentType)
Sets the type of the parent of a node.
int m_identificationNumber
Each node that has been introduced once into the tree gets a unique number.
PQNode< T, X, Y > * m_referenceChild
Stores a pointer to one child, the reference child of the doubly linked cirkular list of children of ...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
PQNode< T, X, Y > * getSib(SibDirection side) const
The function getSib() returns one of the siblings of the node.
List< PQNode< T, X, Y > * > * fullChildren
Stores all full children of a node during a reduction.
The class template PQLeafKey is a derived class of class template PQBasicKey.
bool setNodeInfo(PQNodeKey< T, X, Y > *pointerToInfo)
Sets the pointer m_pointerToInfo to the specified adress of pointerToInfo.
PQNode< T, X, Y > * m_referenceParent
Is a pointer to the parent, in case that the parent is a P-node and the node itself is its reference ...
virtual PQNodeMark mark() const =0
mark() returns the variable PQLeaf::m_mark in the derived class PQLeaf and PQInternalNode.
Declaration and implementation of the class PQNodeRoot.
virtual bool setInternal(PQInternalKey< T, X, Y > *pointerToInternal)=0
PQNode< T, X, Y > * m_rightEndmost
Stores the right endmost child of a Q-node.
PQNode< T, X, Y > * m_sibLeft
Stores a pointer ot the left sibling of PQNode.
The class template PQInternalKey is a derived class of class template PQBasicKey.
virtual PQLeafKey< T, X, Y > * getKey() const =0
getKey() returns a pointer to the PQLeafKeyof a node, in case that the node is supposed to have a key...
virtual PQInternalKey< T, X, Y > * getInternal() const =0
getInternal() returns a pointer to the PQInternalKey information of a node, in case that the node is ...
int pertChildCount() const
Returs the number of pertinent children of a node.
void childCount(int count)
Sets the number of children of a node.
PQNode< T, X, Y > * getEndmost(SibDirection side) const
Returns one of the endmost children of node, if node is a Q-node.
List< PQNode< T, X, Y > * > * partialChildren
Stores all partial children of a node during a reduction.
PQNodeType m_parentType
Stores the type of the parent which can be either a P- or Q-node.
virtual PQNodeStatus status() const =0
Returns the variable PQLeaf::m_status in the derived class PQLeaf and PQInternalNode.
PQNode< T, X, Y > * getNextSib(PQNode< T, X, Y > *other) const
The function getNextSib() returns one of the siblings of the node.
int m_debugTreeNumber
Needed for debuging purposes.
bool changeSiblings(PQNode< T, X, Y > *oldSib, PQNode< T, X, Y > *newSib)
The function changeSiblings() replaces the old sibling oldSib of the node by a new sibling newSib.
PQNode< T, X, Y > * getEndmost(PQNode< T, X, Y > *other) const
Returns one of the endmost children of node, if node is a Q-node.
Doubly linked lists (maintaining the length of the list).
SibDirection putSibling(PQNode< T, X, Y > *newSib)
The default function putSibling() stores a new sibling at a free sibling pointer of the node.
virtual PQNodeType type() const =0
Returns the variable PQInternalNode::m_type in the derived class PQLeaf and PQInternalNode.
The class template PQNodeKey is a derived class of class template PQBasicKey.
PQNodeKey< T, X, Y > * m_pointerToInfo
Stores a pointer to the corresponding information of the node.
void pertChildCount(int count)
Sets the number of pertinent children of a node.
virtual ~PQNode()
The destructor does not delete any accompanying information class as PQLeafKey, PQNodeKey and PQInter...
PQNodeKey< T, X, Y > * getNodeInfo() const
Returns the identification number of a node.
int m_pertChildCount
Stores the number of pertinent children of the node.
Basic declarations, included by all source files.
int m_pertLeafCount
Stores the number of pertinent leaves in the frontier of the node.
PQNode< T, X, Y > * referenceParent() const
Returns the pointer to the parent if node is a reference child.
PQNode(int count, PQNodeKey< T, X, Y > *infoPtr)
The (first) constructor combines the node with its information and will automatically set the PQBasic...
virtual bool setKey(PQLeafKey< T, X, Y > *pointerToKey)=0
Sets a specified pointer variable in a derived class to the specified adress of pointerToKey that is ...
Declaration of doubly linked lists and iterators.
SibDirection putSibling(PQNode< T, X, Y > *newSib, SibDirection preference)
The function putSibling() with preference stores a new sibling at a free sibling pointer of the node.
int identificationNumber() const
Returns the identification number of a node.
PQNode< T, X, Y > * parent(PQNode< T, X, Y > *newParent)
Sets the parent pointer of a node.
PQNode< T, X, Y > * m_leftEndmost
bool endmostChild() const
The function endmostChild() checks if a node is endmost child of a Q-node.
PQNodeType parentType() const
Returns the type of the parent of a node.
PQNode< T, X, Y > * m_firstFull
Stores a pointer to the first full child of a Q-node.
int childCount() const
Returns the number of children of a node.
PQNode< T, X, Y > * m_sibRight
Stores a pointer ot the right sibling of PQNode.
PQNode< T, X, Y > * parent() const
The function parent() returns a pointer to the parent of a node.
PQNode< T, X, Y > * m_parent
Is a pointer to the parent.
bool changeEndmost(PQNode< T, X, Y > *oldEnd, PQNode< T, X, Y > *newEnd)
The function changeEndmost() replaces the old endmost child oldEnd of the node by a new child newEnd.
The class template PQBasicKey is an abstract base class.
The class PQNodeRoot is used as a base class of the class PQNode.