Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

QuadTreeNM.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 #include <iostream>
37 
38 namespace ogdf::energybased::fmmm {
39 class ParticleInfo;
40 } // namespace ogdf::energybased::fmmm
41 
42 namespace ogdf {
43 template<class E>
44 class List;
45 
46 namespace energybased {
47 namespace fmmm {
48 
51 class QuadTreeNM {
52 public:
54  QuadTreeNM();
55 
57  void delete_tree(QuadTreeNodeNM* node_ptr);
58 
60  void delete_tree_and_count_nodes(QuadTreeNodeNM* node_ptr, int& nodecounter);
61 
64  void cout_preorder(QuadTreeNodeNM* node_ptr);
65  void cout_preorder(QuadTreeNodeNM* node_ptr, int precision);
66 
68  void init_tree() {
69  root_ptr = new QuadTreeNodeNM();
70  act_ptr = root_ptr;
71  }
72 
75 
77  void go_to_father() {
78  if (act_ptr->get_father_ptr() != nullptr) {
80  } else {
81  std::cout << "Error QuadTreeNM: No father Node exists";
82  }
83  }
84 
87 
90 
93 
96 
99  void create_new_lt_child();
100 
103  void create_new_rt_child();
104 
107  void create_new_lb_child();
108 
111  void create_new_rb_child();
112 
114  QuadTreeNodeNM* get_act_ptr() const { return act_ptr; }
115 
116  QuadTreeNodeNM* get_root_ptr() const { return root_ptr; }
117 
119  void set_root_ptr(QuadTreeNodeNM* r_ptr) { root_ptr = r_ptr; }
120 
122  void set_act_ptr(QuadTreeNodeNM* a_ptr) { act_ptr = a_ptr; }
123 
126 
127 private:
130 };
131 
132 }
133 }
134 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::energybased::fmmm::QuadTreeNM::act_ptr
QuadTreeNodeNM * act_ptr
points to the actual node
Definition: QuadTreeNM.h:129
ogdf::energybased::fmmm::QuadTreeNodeNM::get_father_ptr
QuadTreeNodeNM * get_father_ptr() const
Definition: QuadTreeNodeNM.h:172
ogdf::energybased::fmmm::QuadTreeNM::create_new_rb_child
void create_new_rb_child()
ogdf::energybased::fmmm::QuadTreeNM::create_new_lb_child
void create_new_lb_child()
ogdf::energybased::fmmm
Definition: common.h:43
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_rt_ptr
QuadTreeNodeNM * get_child_rt_ptr() const
Definition: QuadTreeNodeNM.h:176
ogdf::energybased::fmmm::QuadTreeNM::go_to_lt_child
void go_to_lt_child()
Sets act_ptr to the left_top_child_ptr.
Definition: QuadTreeNM.h:86
ogdf::energybased::fmmm::QuadTreeNM::cout_preorder
void cout_preorder(QuadTreeNodeNM *node_ptr)
Pre_order traversal of the tree rooted at node_ptr (with or without output of the M,...
ogdf::energybased::fmmm::QuadTreeNM::delete_tree
void delete_tree(QuadTreeNodeNM *node_ptr)
Deletes the tree starting at node_ptr.
ogdf::energybased::fmmm::QuadTreeNM::start_at_root
void start_at_root()
Sets act_ptr to the root_ptr.
Definition: QuadTreeNM.h:74
ogdf::energybased::fmmm::QuadTreeNM::QuadTreeNM
QuadTreeNM()
Constructor.
ogdf::energybased::fmmm::QuadTreeNM::go_to_father
void go_to_father()
Sets act_ptr to the father_ptr.
Definition: QuadTreeNM.h:77
r
int r[]
Definition: hierarchical-ranking.cpp:13
ogdf::energybased::fmmm::QuadTreeNM
Helping data structure that stores the information needed to represent the modified quadtree in the N...
Definition: QuadTreeNM.h:51
ogdf::energybased::fmmm::QuadTreeNM::create_new_lt_child
void create_new_lt_child()
ogdf::energybased::fmmm::QuadTreeNM::set_act_ptr
void set_act_ptr(QuadTreeNodeNM *a_ptr)
Sets act_ptr to a_ptr.
Definition: QuadTreeNM.h:122
ogdf::energybased::fmmm::QuadTreeNM::init_tree
void init_tree()
Creates the root node and lets act_ptr and root_ptr point to the root node.
Definition: QuadTreeNM.h:68
ogdf::energybased::fmmm::QuadTreeNM::root_ptr
QuadTreeNodeNM * root_ptr
points to the root node
Definition: QuadTreeNM.h:128
ogdf::energybased::fmmm::QuadTreeNM::delete_tree_and_count_nodes
void delete_tree_and_count_nodes(QuadTreeNodeNM *node_ptr, int &nodecounter)
Deletes the tree starting at node_ptr and counts the nodes of the subtree.
ogdf::energybased::fmmm::QuadTreeNM::go_to_rb_child
void go_to_rb_child()
Sets act_ptr to the right_bottom_child_ptr.
Definition: QuadTreeNM.h:95
QuadTreeNodeNM.h
Declaration of class QuadTreeNodeNM.
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::energybased::fmmm::QuadTreeNodeNM
Helping data structure that stores the information needed to represent a node of the reduced quad tre...
Definition: QuadTreeNodeNM.h:52
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_lt_ptr
QuadTreeNodeNM * get_child_lt_ptr() const
Definition: QuadTreeNodeNM.h:174
ogdf::energybased::fmmm::QuadTreeNM::go_to_lb_child
void go_to_lb_child()
Sets act_ptr to the left_bottom_child_ptr.
Definition: QuadTreeNM.h:92
ogdf::energybased::fmmm::QuadTreeNM::set_root_node
void set_root_node(QuadTreeNodeNM &r)
Sets the content of *root_ptr to r.
Definition: QuadTreeNM.h:125
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_lb_ptr
QuadTreeNodeNM * get_child_lb_ptr() const
Definition: QuadTreeNodeNM.h:178
ogdf::energybased::fmmm::QuadTreeNM::get_act_ptr
QuadTreeNodeNM * get_act_ptr() const
Returns the actual/root node pointer of the tree.
Definition: QuadTreeNM.h:114
ogdf::energybased::fmmm::QuadTreeNM::set_root_ptr
void set_root_ptr(QuadTreeNodeNM *r_ptr)
Sets root_ptr to r_ptr.
Definition: QuadTreeNM.h:119
ogdf::energybased::fmmm::QuadTreeNM::get_root_ptr
QuadTreeNodeNM * get_root_ptr() const
Definition: QuadTreeNM.h:116
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_rb_ptr
QuadTreeNodeNM * get_child_rb_ptr() const
Definition: QuadTreeNodeNM.h:180
ogdf::energybased::fmmm::QuadTreeNM::create_new_rt_child
void create_new_rt_child()
ogdf::energybased::fmmm::QuadTreeNM::go_to_rt_child
void go_to_rt_child()
Sets act_ptr to the right_top_child_ptr.
Definition: QuadTreeNM.h:89