74 std::unique_ptr<Graph> g = std::make_unique<Graph>();
106 std::vector<std::unique_ptr<FourBlockTree>>
children;
130 template<
typename _F>
134 std::vector<std::unique_ptr<FourBlockTree>>::const_iterator nextChild;
137 std::vector<stackEntry> stack;
138 stack.push_back({
this, children.begin()});
140 while (!stack.empty()) {
141 auto& it = stack.back().nextChild;
142 if (it != stack.back().node->children.end()) {
145 stack.push_back({child, child->
children.begin()});
162 template<
typename _F>
166 std::vector<std::unique_ptr<FourBlockTree>>::iterator nextChild;
169 std::vector<stackEntry> stack;
170 stack.push_back({
this, children.begin()});
172 while (!stack.empty()) {
173 auto& it = stack.back().nextChild;
174 if (it != stack.back().node->children.end()) {
177 stack.push_back({child, child->
children.begin()});
194 template<
typename _F>
198 std::vector<std::unique_ptr<FourBlockTree>>::const_iterator nextChild;
201 std::vector<stackEntry> stack;
202 stack.push_back({
this, children.begin()});
203 while (!stack.empty()) {
204 auto& it = stack.back().nextChild;
205 if (it != stack.back().node->children.end()) {
208 stack.push_back({child, child->
children.begin()});
210 callback(*stack.back().node);
225 template<
typename _F>
229 std::vector<std::unique_ptr<FourBlockTree>>::iterator nextChild;
232 std::vector<stackEntry> stack;
233 stack.push_back({
this, children.begin()});
234 while (!stack.empty()) {
235 auto& it = stack.back().nextChild;
236 if (it != stack.back().node->children.end()) {
239 stack.push_back({child, child->
children.begin()});
241 callback(*stack.back().node);
Includes declaration of graph class.
Basic declarations, included by all source files.
Class for adjacency list elements.
Data type for general directed graphs (adjacency list representation).
Class for the representation of nodes.
RegisteredArray for nodes, edges and adjEntries of a graph.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
The namespace for all OGDF objects.
A node in a 4-block tree.
FourBlockTree(FourBlockTree &&)=delete
FourBlockTree * parent
The parent node of this node in the 4-block tree.
void preorder(_F callback)
Perform a pre-order traversal of the 4-block tree.
NodeArray< node > originalNodes
The nodes in the original graph corresponding to the nodes in g.
void preorder(_F callback) const
Perform a pre-order traversal of the 4-block tree.
FourBlockTree(const FourBlockTree &)=delete
adjEntry externalFace
A half-edge in g such that the external face of g is to its right.
std::vector< std::unique_ptr< FourBlockTree > > children
The child nodes of this nodes.
FourBlockTree & operator=(FourBlockTree &&)=delete
static std::unique_ptr< FourBlockTree > construct(const Graph &g, adjEntry externalFace)
Construct a 4-block tree of the given graph.
FourBlockTree & operator=(const FourBlockTree &)=delete
void postorder(_F callback) const
Perform a post-order traversal of the 4-block tree.
adjEntry parentFace
The half-edge in parent->g corresponding to externalFace.
void postorder(_F callback)
Perform a post-order traversal of the 4-block tree.