29 if (set_membership == ~
uint64_t(0)) {
32 return std::to_string(set_membership);
39 string label =
string_printf(
"<f%d> node @%p", field++, &node);
54 label +=
string_printf(
"| <f%d> set membership:ALL", field++);
73 fprintf(file,
"\"%s\" [\n",
get_node_id(node).c_str());
74 fprintf(file,
" label = \"%s\"\n", label.c_str());
75 fprintf(file,
" shape = \"record\"\n");
76 fprintf(file,
"];\n");
89 const size_t num_emitters =
tree.num_emitters();
91 for (
size_t i = 0;
i < num_emitters; ++
i) {
96 string label =
string_printf(
"<f%d> emitter %s", field++, std::to_string(
i).c_str());
113 label +=
string_printf(
"|<f%d> set membership:ALL", field++);
146 fprintf(file,
" label = \"%s\"\n", label.c_str());
147 fprintf(file,
" shape = \"record\"\n");
148 fprintf(file,
"];\n");
161 for (
int i = 0;
i < node.
get_leaf().num_emitters;
i++) {
164 "\"%s\":<emitters> -> \"%s\":f0 [ id = %d ];\n",
165 from_node_id.c_str(),
179 const string left_node_id =
get_node_id(left_node);
180 const string right_node_id =
get_node_id(right_node);
183 "\"%s\":left -> \"%s\":f0 [ id = %d ];\n",
184 from_node_id.c_str(),
185 left_node_id.c_str(),
189 "\"%s\":right -> \"%s\":f0 [ id = %d ];\n",
190 from_node_id.c_str(),
191 right_node_id.c_str(),
201 const string &filename)
210 fprintf(file,
"digraph g {\n");
211 fprintf(file,
"graph [\n");
212 fprintf(file,
" rankdir = \"LR\"\n");
213 fprintf(file,
"];\n");
217 fprintf(file,
"}\n");
228 const uint knode_index,
236 const bool is_inner = !
is_leaf;
242 string label =
string_printf(
"<f%d> knode %u", field++, knode_index);
285 fprintf(file,
"\"%s\" [\n", knode_id.c_str());
286 fprintf(file,
" label = \"%s\"\n", label.c_str());
287 fprintf(file,
" shape = \"record\"\n");
288 fprintf(file,
"];\n");
296 "\"%s\":left -> \"%s\":f0 [ id = %d ];\n",
301 "\"%s\":right -> \"%s\":f0 [ id = %d ];\n",
317 fprintf(file,
"digraph g {\n");
318 fprintf(file,
"graph [\n");
319 fprintf(file,
" rankdir = \"LR\"\n");
320 fprintf(file,
"];\n");
322 fprintf(file,
"}\n");
unsigned long long int uint64_t
#define CCL_NAMESPACE_END
#define assert(assertion)
void klight_tree_plot_to_file(uint root, const KernelLightTreeNode *knodes, const string &filename)
static CCL_NAMESPACE_BEGIN string get_node_id(const LightTreeNode &node)
static void recursive_print_node_relations(FILE *file, const LightTree &tree, const LightTreeNode &node, int &relation_id)
static string set_membership_str(const uint64_t set_membership)
static void recursive_print_knode(FILE *file, const uint knode_index, const KernelLightTreeNode *knodes, int &relation_id)
static void recursive_print_node(FILE *file, const LightTreeNode &node)
void light_tree_plot_to_file(const Scene &scene, const LightTree &tree, const LightTreeNode &root_node, const string &filename)
static string get_emitter_id(const LightTreeEmitter &emitter)
static void print_emitters(FILE *file, const Scene &scene, const LightTree &tree)
static string get_knode_id(const KernelLightTreeNode &knode)
FILE * path_fopen(const string &path, const string &mode)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
struct KernelLightTreeNode::@075060275333356206225201163255143122031204113015::@121232343267032302300332005257270111102366024356 inner
struct KernelLightTreeNode::@075060275333356206225201163255143122031204113015::@354167317357124241334100100220231122277063225056 leaf
__forceinline bool is_mesh() const
__forceinline bool is_triangle() const
uint64_t light_set_membership
__forceinline bool is_light() const
unique_ptr< LightTreeNode > children[2]
__forceinline Inner & get_inner()
__forceinline bool is_leaf() const
__forceinline bool is_inner() const
LightTreeLightLink light_link
__forceinline bool is_instance() const
__forceinline Leaf & get_leaf()
__forceinline bool is_distant() const
unique_ptr_vector< Object > objects
ccl_device_inline bool is_leaf(const ccl_global KernelLightTreeNode *knode)