|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
76 PCNode *predPartial =
nullptr, *nextPartial =
nullptr;
79 size_t tpPartialHeight = 0;
82 PCNode *ebEnd1 =
nullptr, *fbEnd1 =
nullptr, *fbEnd2 =
nullptr, *ebEnd2 =
nullptr;
85 if (tpPred == oldNeigh) {
88 if (tpPartialPred == oldNeigh) {
89 tpPartialPred = newNeigh;
91 if (tpSucc == oldNeigh) {
94 if (ebEnd1 == oldNeigh) {
97 if (ebEnd2 == oldNeigh) {
100 if (fbEnd1 == oldNeigh) {
103 if (fbEnd2 == oldNeigh) {
109 nextPartial = predPartial =
nullptr;
110 tpPred = tpPartialPred = tpSucc =
nullptr;
111 ebEnd1 = fbEnd1 = fbEnd2 = ebEnd2 =
nullptr;
113 fullNeighbors.clear();
135 size_t m_childCount = 0;
137 mutable size_t m_timestamp = 0;
172 void appendChild(
PCNode* child,
bool begin =
false);
187 void replaceWith(
PCNode* repl);
192 void mergeIntoParent();
197 void flip() { std::swap(m_child1, m_child2); }
208 void rotateChildOutside(
bool child1 =
true);
218 void setParent(
PCNode* parent);
236 m_nodeType = newType;
267 void proceedToNextNeighbor(
PCNode*& pred,
PCNode*& curr)
const;
272 PCNode* getParent()
const;
308 bool isValidNode(
const PCTreeForest* ofForest =
nullptr)
const;
327 return this->getParent() == other->
getParent();
336 return m_sibling1 == sibling || m_sibling2 == sibling;
343 bool areNeighborsAdjacent(
const PCNode* neigh1,
const PCNode* neigh2)
const;
350 return m_child1 == child || m_child2 == child;
356 bool isOuterChild()
const {
return m_sibling1 ==
nullptr || m_sibling2 ==
nullptr; }
415 void checkTimestamp()
const;
427 m_temp.fullNeighbors.push_back(fullNeigh);
428 return m_temp.fullNeighbors.size();
435 if (nonFullNeigh == m_temp.ebEnd1) {
436 OGDF_ASSERT(areNeighborsAdjacent(m_temp.ebEnd1, m_temp.fbEnd1));
437 return m_temp.fbEnd1;
440 OGDF_ASSERT(areNeighborsAdjacent(m_temp.ebEnd2, m_temp.fbEnd2));
441 return m_temp.fbEnd2;
451 size_t index()
const {
return m_id; }
458 size_t getDegree()
const {
return isDetached() ? m_childCount : m_childCount + 1; }
LeafUserData & leafUserData()
bool isOuterChild() const
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
bool isParentOf(const PCNode *other) const
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
A PC-tree represents a set of cyclic orders of its leaves by labeling its inner nodes as either P- or...
PCNode * getChild1() const
An intrusive list for the leaves of a PCTree. TODO should be moved to a central location; merge with ...
void changeType(PCNodeType newType)
Overwrite the type of this node without updating any other data structures.
Temporary information used during each step of the PCTree::makeConsecutive() update operation.
bool isSiblingAdjacent(const PCNode *sibling) const
bool isSiblingOf(const PCNode *other) const
bool isChildOuter(const PCNode *child) const
PCNodeType getNodeType() const
const LeafUserData & leafUserData() const
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
void proceedToNextSibling(PCNode *&pred, PCNode *&curr)
Iteration-convenience version of PCNode::getNextSibling() that updates the variables pred to curr and...
PCNode(PCTreeForest *forest, size_t id, PCNodeType nodeType)
PCNode * getParent() const
const TempInfo & constTempInfo() const
PCNode * getChild2() const
size_t getChildCount() const
void setLabel(NodeLabel l)
NodeLabel getLabelUnchecked() const
Multiple PCTrees can be created within the same PCTreeForest, which allows merging the trees later on...
PCNode * getOnlyChild() const
Check whether this node has only one child and return it.
size_t addFullNeighbor(PCNode *fullNeigh)
NodeLabel getLabel() const
std::vector< PCNode * > fullNeighbors
const UnionFindIndex UNIONFINDINDEX_EMPTY
void replaceNeighbor(PCNode *oldNeigh, PCNode *newNeigh)
PCTreeForest * getForest() const
PCNode *& getFullNeighInsertionPoint(PCNode *nonFullNeigh)
void setLabelUnchecked(NodeLabel l)
Predeclaration of various PC-tree related classes and enums.
PCNode * getSibling2() const
A node in a PC-tree that is either a P-node, C-node or leaf.
Basic declarations, included by all source files.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
PCNode * getSibling1() const
PCTreeForests contain multiple PCTrees that can be merged with each other.
std::array< void *, sizeof(TempInfo)/sizeof(void *)> LeafUserData
Class for the representation of nodes.
Declaration of memory manager for allocating small pieces of memory.
void flip()
Reverse the stored order of children.