40
40
static void draw_internal_load_coords (int type_descrip_index, t_pb_graph_node* pb_graph_node, float parent_width, float parent_height);
41
41
static int draw_internal_find_max_lvl (const t_pb_type& pb_type);
42
42
static void draw_internal_calc_coords (int type_descrip_index, t_pb_graph_node* pb_graph_node, int num_pb_types, int type_index, int num_pb, int pb_index, float parent_width, float parent_height, float * blk_width, float * blk_height);
43
- static bool is_top_lvl_block_highlighted (const ClusterBlockId blk_id);
44
43
std::vector<AtomBlockId> collect_pb_atoms (const t_pb* pb);
45
44
void collect_pb_atoms_recurr (const t_pb* pb, std::vector<AtomBlockId>& atoms);
46
45
t_pb* highlight_sub_block_helper (const ClusterBlockId clb_index, t_pb* pb, const ezgl::point2d& local_pt, int max_depth);
@@ -141,6 +140,7 @@ void draw_internal_init_blk() {
141
140
draw_state->max_sub_blk_lvl = std::max (draw_internal_find_max_lvl (*type.pb_type ),
142
141
draw_state->max_sub_blk_lvl );
143
142
}
143
+ // draw_state->max_sub_blk_lvl -= 1;
144
144
}
145
145
146
146
# ifndef NO_GRAPHICS
@@ -338,47 +338,33 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
338
338
if (pb_type->depth > draw_state->show_blk_internal ) {
339
339
return ;
340
340
}
341
- // / first draw box ///
342
341
343
- if (pb_type->depth == 0 ) {
344
- if (!is_top_lvl_block_highlighted (clb_index)) {
345
- // if this is a top level pb, and only if it isn't selected (ie. a funny colour),
346
- // overwrite it. (but stil draw the text)
342
+ // / first draw box ///
347
343
348
- g->set_color (ezgl::WHITE);
349
- g->fill_rectangle (abs_bbox);
350
- g->set_color (ezgl::BLACK);
351
- g->set_line_dash (ezgl::line_dash::none);
352
- g->draw_rectangle (abs_bbox);
344
+ if (pb->name != nullptr ) {
345
+ // If block is used, draw it in colour with solid border.
346
+ g->set_line_dash (ezgl::line_dash::none);
347
+
348
+ // determine default background color
349
+ if (sel_sub_info.is_selected (pb->pb_graph_node , clb_index)) {
350
+ g->set_color (SELECTED_COLOR);
351
+ } else if (sel_sub_info.is_sink_of_selected (pb->pb_graph_node , clb_index)) {
352
+ g->set_color (DRIVES_IT_COLOR);
353
+ } else if (sel_sub_info.is_source_of_selected (pb->pb_graph_node , clb_index)) {
354
+ g->set_color (DRIVEN_BY_IT_COLOR);
355
+ } else {
356
+ g->set_color (draw_state->block_color [clb_index]);
353
357
}
354
358
} else {
355
- if (pb->name != nullptr ) {
356
- // If block is used, draw it in colour with solid border.
357
- g->set_line_dash (ezgl::line_dash::none);
358
-
359
- // determine default background color
360
- if (sel_sub_info.is_selected (pb->pb_graph_node , clb_index)) {
361
- g->set_color (SELECTED_COLOR);
362
- } else if (sel_sub_info.is_sink_of_selected (pb->pb_graph_node , clb_index)) {
363
- g->set_color (DRIVES_IT_COLOR);
364
- } else if (sel_sub_info.is_source_of_selected (pb->pb_graph_node , clb_index)) {
365
- g->set_color (DRIVEN_BY_IT_COLOR);
366
- } else if (pb_type->depth != draw_state->show_blk_internal && pb->child_pbs != nullptr ) {
367
- g->set_color (ezgl::WHITE); // draw anything else that will have a child as white
368
- } else {
369
- g->set_color (draw_state->block_color [clb_index]);
370
- }
371
- } else {
372
- // If block is not used, draw as empty block (ie. white
373
- // background with dashed border).
359
+ // If block is not used, draw as empty block (ie. white
360
+ // background with dashed border).
374
361
375
- g->set_line_dash (ezgl::line_dash::asymmetric_5_3);
376
- g->set_color (ezgl::WHITE);
377
- }
378
- g->fill_rectangle (abs_bbox);
379
- g->set_color (ezgl::BLACK);
380
- g->draw_rectangle (abs_bbox);
362
+ g->set_line_dash (ezgl::line_dash::asymmetric_5_3);
363
+ g->set_color (ezgl::WHITE);
381
364
}
365
+ g->fill_rectangle (abs_bbox);
366
+ g->set_color (ezgl::BLACK);
367
+ g->draw_rectangle (abs_bbox);
382
368
383
369
// / then draw text ///
384
370
@@ -393,7 +379,7 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
393
379
int tot_len = type_len + name_len;
394
380
char * blk_tag = (char *)vtr::malloc ((tot_len + 8 ) * sizeof (char ));
395
381
396
- sprintf (blk_tag, " %s(%s)" , pb_type->name , pb->name );
382
+ sprintf (blk_tag, " %s (%s)" , pb_type->name , pb->name );
397
383
398
384
g->draw_text (
399
385
abs_bbox.center (),
@@ -444,10 +430,10 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
444
430
445
431
t_pb_type* pb_child_type = child_pb->pb_graph_node ->pb_type ;
446
432
447
- // don't go farther if 0 modes
448
- if (pb_child_type == nullptr || pb_child_type->num_modes == 0 ) {
433
+ if (pb_child_type == nullptr ) {
449
434
continue ;
450
435
}
436
+
451
437
// now recurse
452
438
draw_internal_pb (clb_index, child_pb, abs_bbox, type, g);
453
439
}
@@ -662,22 +648,6 @@ void draw_one_logical_connection(const AtomPinId src_pin, const AtomPinId sink_p
662
648
}
663
649
# endif /* NO_GRAPHICS */
664
650
665
- /* This function checks whether a top-level clb has been highlighted. It does
666
- * so by checking whether the color in this block is default color.
667
- */
668
- static bool is_top_lvl_block_highlighted (const ClusterBlockId blk_id) {
669
- t_draw_state* draw_state;
670
-
671
- /* Call accessor function to retrieve global variables. */
672
- draw_state = get_draw_state_vars ();
673
-
674
- if (draw_state->block_color [blk_id] == get_block_type_color (get_physical_tile_type (blk_id))) {
675
- return false ;
676
- }
677
-
678
- return true ;
679
- }
680
-
681
651
int highlight_sub_block (const ezgl::point2d& point_in_clb, ClusterBlockId clb_index, t_pb* pb) {
682
652
t_draw_state* draw_state = get_draw_state_vars ();
683
653
0 commit comments