|
1 | 1 | /* ************************************************************************** */ |
2 | 2 | /* */ |
3 | 3 | /* ::: :::::::: */ |
4 | | -/* bvh_vis.h :+: :+: :+: */ |
| 4 | +/* bvh_debug.h :+: :+: :+: */ |
5 | 5 | /* +:+ +:+ +:+ */ |
6 | 6 | /* By: yoshin <yoshin@student.42gyeongsan.kr> +#+ +:+ +#+ */ |
7 | 7 | /* +#+#+#+#+#+ +#+ */ |
|
10 | 10 | /* */ |
11 | 11 | /* ************************************************************************** */ |
12 | 12 |
|
13 | | -#ifndef BVH_VIS_H |
14 | | -# define BVH_VIS_H |
| 13 | +#ifndef BVH_DEBUG_H |
| 14 | +# define BVH_DEBUG_H |
15 | 15 |
|
16 | 16 | # include "spatial.h" |
17 | 17 |
|
@@ -65,39 +65,39 @@ typedef struct s_traverse_ctx |
65 | 65 | } t_traverse_ctx; |
66 | 66 |
|
67 | 67 | /* Public API */ |
68 | | -void bvh_visualize(t_bvh *bvh, t_vis_config *config, void *scene); |
69 | | -t_vis_config bvh_vis_default_config(void); |
| 68 | +void bvhd_run(t_bvh *bvh, t_vis_config *config, void *scene); |
| 69 | +t_vis_config bvhd_default_config(void); |
70 | 70 |
|
71 | 71 | /* Initialization and configuration */ |
72 | | -int bvh_vis_get_terminal_width(void); |
73 | | -void check_edge_cases(t_bvh *bvh, t_vis_config *config); |
| 72 | +int bvhd_get_terminal_width(void); |
| 73 | +void bvhd_check_edges(t_bvh *bvh, t_vis_config *config); |
74 | 74 |
|
75 | 75 | /* Tree traversal and display */ |
76 | | -void bvh_visualize_tree(t_bvh_node *node, t_traverse_ctx *ctx, |
| 76 | +void bvhd_print_tree(t_bvh_node *node, t_traverse_ctx *ctx, |
77 | 77 | t_bvh_stats *stats); |
78 | 78 |
|
79 | 79 | /* Node formatting */ |
80 | | -t_node_info format_node_info(t_bvh_node *node); |
81 | | -int is_leaf_node(t_bvh_node *node); |
82 | | -void format_object_list(t_object_ref *objects, int count, |
| 80 | +t_node_info bvhd_format_node(t_bvh_node *node); |
| 81 | +int bvhd_is_leaf(t_bvh_node *node); |
| 82 | +void bvhd_format_objects(t_object_ref *objects, int count, |
83 | 83 | char *buffer, void *scene); |
84 | 84 |
|
85 | 85 | /* Statistics */ |
86 | | -void bvh_collect_statistics(t_bvh_node *node, t_bvh_stats *stats); |
87 | | -void collect_stats_recursive(t_bvh_node *node, t_bvh_stats *stats, |
| 86 | +void bvhd_collect_stats(t_bvh_node *node, t_bvh_stats *stats); |
| 87 | +void bvhd_collect_recursive(t_bvh_node *node, t_bvh_stats *stats, |
88 | 88 | int depth); |
89 | | -void print_statistics_summary(t_bvh_stats *stats); |
| 89 | +void bvhd_print_stats(t_bvh_stats *stats); |
90 | 90 |
|
91 | 91 | /* Prefix management */ |
92 | | -t_prefix_state prefix_init(void); |
93 | | -int prefix_push(t_prefix_state *state, int is_last); |
94 | | -void prefix_pop(t_prefix_state *state); |
95 | | -void prefix_print(t_prefix_state *state); |
96 | | -void prefix_destroy(t_prefix_state *state); |
| 92 | +t_prefix_state bvhd_prefix_init(void); |
| 93 | +int bvhd_prefix_push(t_prefix_state *state, int is_last); |
| 94 | +void bvhd_prefix_pop(t_prefix_state *state); |
| 95 | +void bvhd_prefix_print(t_prefix_state *state); |
| 96 | +void bvhd_prefix_destroy(t_prefix_state *state); |
97 | 97 |
|
98 | 98 | /* Output primitives */ |
99 | | -void print_node_line(t_prefix_state *prefix, t_node_info *info, |
| 99 | +void bvhd_print_node(t_prefix_state *prefix, t_node_info *info, |
100 | 100 | int is_last); |
101 | | -void print_warning_message(const char *message); |
| 101 | +void bvhd_warn(const char *message); |
102 | 102 |
|
103 | 103 | #endif |
0 commit comments