25 #ifndef DIALECT_PEELING_H 26 #define DIALECT_PEELING_H 31 #include "libdialect/commontypes.h" 32 #include "libdialect/graphs.h" 39 typedef std::shared_ptr<PeeledNode> PeeledNode_SP;
40 typedef std::shared_ptr<Stem> Stem_SP;
75 m_treeSerialNumber(nextTreeSerialNumber++) {}
79 static id_type nextTreeSerialNumber;
80 id_type m_treeSerialNumber;
81 void updateSerialNumber(
void) { m_treeSerialNumber = nextTreeSerialNumber++; }
88 Stem(
const Node_SP &leaf,
const Node_SP &root) : m_plain_leaf(leaf), m_plain_root(root) {}
91 void addSelfToGraph(
Graph &H);
118 bool moveNode(id_type
id,
unsigned oldDegree,
unsigned newDegree);
131 unsigned m_maxDegree;
132 std::vector<NodesById> m_buckets;
161 #endif // DIALECT_PEELING_H The Graph class represents graphs consisting of nodes and edges.
Definition: graphs.h:180
bool moveNode(id_type id, unsigned oldDegree, unsigned newDegree)
Move a node from one bucket to another.
Definition: peeling.cpp:137
NodesById takeLeaves(void)
Return a copy of the bucket of leaves, and clear the latter.
Definition: peeling.cpp:128
libdialect: A library for computing human-like orthogonal network (DiAlEcT) layouts.
Definition: cola.h:44
NodeBuckets(Graph &graph)
Initialize a set of node buckets for the given Graph.
Definition: peeling.cpp:115
void severNodes(const NodesById &nodes)
Sever the given Nodes from our Graph.
Definition: peeling.cpp:152
Trees peel(Graph &G)
Perform the "peeling" process, in which the exterior trees are removed from the given Graph...
Definition: peeling.cpp:168
PeeledNode_SP identifyRootNode(const Graph &graph)
Mark as "root" the PeeledNode having largest serial number.
Definition: peeling.cpp:92
std::vector< Stem_SP > makeStemsFromLeaves(const NodesById &leaves)
Make a Stem object to represent each leaf.
Definition: peeling.cpp:72
static PeeledNode_SP allocate(const Node &node)
Factory function.
Definition: peeling.h:57
Definition: peeling.h:101
friend PeeledNode_SP identifyRootNode(const Graph &graph)
Mark as "root" the PeeledNode having largest serial number.
A PeeledNode is a type of GhostNode, used in the peeling process.
Definition: peeling.h:50
virtual ~PeeledNode(void)=default
Destructor.
A GhostNode represents another Node.
Definition: graphs.h:939
The Node class represents nodes in a graph.
Definition: graphs.h:713
Represents a leaf node, along with its one edge and neighbour.
Definition: peeling.h:87
PeeledNode & operator=(const PeeledNode &)=default
Copy-assignment operator.