12namespace layer1_foundations {
36#define TREEPATHLEN 10000
37#define BUFSIZE_TREE 100000
40 int xmax,
int ymax,
int verbose_level)
42 int f_v = (verbose_level >= 1);
45 cout <<
"tree::init reading tree from file " << Tree_draw_options->
file_name << endl;
47 int f_vv = (verbose_level >= 1);
65 cout <<
"tree::init premature end of file" << endl;
71 cout <<
"tree::init read line '" << buf <<
"'" << endl;
93 cout <<
"tree::init found " <<
nb_nodes
94 <<
" nodes in file " << Tree_draw_options->
file_name << endl;
98 cout <<
"tree::init calling root->init" << endl;
106 cout <<
"tree::init reading the file again" << endl;
109 ifstream f(Tree_draw_options->
file_name);
113 cout <<
"premature end of file" << endl;
126 cout <<
"tree::init overflow, please increase "
127 "the value of TREEPATHLEN" << endl;
128 cout <<
"l=" << l << endl;
132 cout <<
"reading entry at depth " << l << endl;
134 for (i = 0; i < l; i++) {
142 while (*p_buf ==
' ') {
148 for (i = 0; c_data[i]; i++) {
149 if (c_data[i] ==
'#') {
154 label.assign(c_data);
164 cout <<
"tree::init trying to add node: " << buf << endl;
168 cout <<
"node added: " << buf << endl;
175 cout <<
"tree::init finished adding nodes, max_depth = " <<
max_depth << endl;
187 cout <<
"tree::init before compute_DFS_ranks" << endl;
191 cout <<
"tree::init after compute_DFS_ranks" << endl;
195 cout <<
"tree::init before root->calc_weight" << endl;
199 cout <<
"tree::init after root->calc_weight" << endl;
202 cout <<
"tree::init before root->place_xy" << endl;
206 cout <<
"tree::init after root->place_xy" << endl;
209 cout <<
"tree::init before print_depth_first" << endl;
211 cout <<
"tree::init after print_depth_first" << endl;
219 cout <<
"tree::init done" << endl;
229 int f_v = (verbose_level >= 1);
232 cout <<
"tree::draw" << endl;
236 fname_full.assign(fname);
237 fname_full.append(
".mp");
241 strcat(fname_full,
"e");
246 cout <<
"tree::draw before draw_preprocess" << endl;
253 cout <<
"tree::draw after draw_preprocess" << endl;
257 int factor_1000 = 1000;
260 G.
init(fname_full, Opt, verbose_level);
295 G.
circle(x0, y0, radii[l]);
313 cout <<
"tree::draw before root->draw_edges" << endl;
316 G, Tree_draw_options, Opt,
319 this, verbose_level);
321 cout <<
"tree::draw after root->draw_edges" << endl;
328 cout <<
"tree::draw before root->draw_vertices" << endl;
333 this, verbose_level);
335 cout <<
"tree::draw after root->draw_vertices" << endl;
350 cout <<
"written file " << fname_full <<
" of size "
353 cout <<
"tree::draw done" << endl;
363 int f_v = (verbose_level >= 1);
366 cout <<
"tree::draw_preprocess" << endl;
376 cout <<
"tree::draw_preprocess before root->compute_DFS_rank" << endl;
387 cout <<
"tree::draw_preprocess my_path = ";
396 cout <<
"tree::draw_preprocess my_path = ";
398 cout <<
" rk=" << DFS_rk << endl;
406 for (i = 0; i < Rk.size(); i++) {
415 cout <<
"tree::draw_preprocess done" << endl;
421 int max_depth,
int &x0,
int &y0,
int *&rad)
431 dy = (int)((
double)ymax / (double)(
max_depth + 1));
436 rad[l] = y * xmax * 0.5;
442 int f_v = (verbose_level >= 1);
446 cout <<
"tree::compute_DFS_ranks" << endl;
452 cout <<
"tree::compute_DFS_ranks done" << endl;
options for drawing an object of type layered_graph
a general 2D graphical output interface (metapost, tikz, postscript)
void sl_thickness(int line_thickness)
void init(std::string &file_name, layered_graph_draw_options *Draw_options, int verbose_level)
void circle_text(int x, int y, int rad, const char *text)
void circle(int x, int y, int rad)
void begin_figure(int factor_1000)
options for drawing a tree
std::string select_path_text
int restrict_excluded_color
part of the data structure tree
void draw_edges(mp_graphics &G, tree_draw_options *Tree_draw_options, layered_graph_draw_options *Opt, int f_has_parent, int parent_x, int parent_y, int max_depth, tree *T, int verbose_level)
int find_node(int &DFS_rk, int *path, int sz, int verbose_level)
void place_xy(int left, int right, int ymax, int max_depth)
int calc_y_coordinate(int ymax, int l, int max_depth)
void draw_vertices(mp_graphics &G, tree_draw_options *Tree_draw_options, layered_graph_draw_options *Opt, int f_has_parent, int parent_x, int parent_y, int max_depth, tree *T, int verbose_level)
void add_node(int l, int depth, int *path, int color, std::string &label, int verbose_level)
int find_node_and_path(std::vector< int > &Rk, int *path, int sz, int verbose_level)
void compute_DFS_rank(int &rk)
void init(int depth, tree_node *parent, int f_value, int value, int f_has_color, int color, std::string &label, int verbose_level)
void circle_center_and_radii(int xmax, int ymax, int max_depth, int &x0, int &y0, int *&rad)
void compute_DFS_ranks(int &nb_nodes, int verbose_level)
void draw(std::string &fname, graphics::tree_draw_options *Tree_draw_options, layered_graph_draw_options *Opt, int verbose_level)
void draw_preprocess(std::string &fname, graphics::tree_draw_options *Tree_draw_options, layered_graph_draw_options *Opt, int verbose_level)
void init(graphics::tree_draw_options *Tree_draw_options, int xmax, int ymax, int verbose_level)
a collection of functions related to file io
long int file_size(std::string &fname)
#define Int_vec_scan(A, B, C)
#define Int_vec_zero(A, B)
#define Int_vec_print(A, B, C)
the orbiter library for the classification of combinatorial objects