142 struct DumpTraversalContext {
151 if (
node->is_leaf()) {
153 " node_%p [label=\"%d\",fillcolor=\"#ccccee\",style=filled]\n",
159 " node_%p [label=\"%d\",fillcolor=\"#cceecc\",style=filled]\n",
163 if (parent !=
NULL) {
164 fprintf(
context->stream,
" node_%p -> node_%p;\n", parent,
node);
167 for (
int i = 0; i <
node->num_children(); ++i) {
177 context.stream = fopen(filename,
"w");
182 fprintf(
context.stream,
"digraph BVH {\n");
184 fprintf(
context.stream,
"}\n");
192 for (
int i = 0; i < depth; i++)
195 printf(
"inner node %p\n", (
void *)
this);
205 for (
int i = 0; i < depth; i++)
208 printf(
"leaf node %d to %d\n",
lo,
hi);
@ BVH_STAT_TRIANGLE_COUNT
@ BVH_STAT_CHILDNODE_COUNT
@ BVH_STAT_ALIGNED_INNER_COUNT
@ BVH_STAT_ALIGNED_LEAF_COUNT
@ BVH_STAT_UNALIGNED_COUNT
@ BVH_STAT_UNALIGNED_LEAF_COUNT
@ BVH_STAT_UNALIGNED_INNER_COUNT
__forceinline float cost(int num_nodes, int num_primitives) const
void print(int depth) const
BVHNode * children[kNumMaxChildren]
void print(int depth) const
#define CCL_NAMESPACE_END
int getSubtreeSize(BVH_STAT stat=BVH_STAT_NODE_COUNT) const
virtual int num_children() const =0
float computeSubtreeSAHCost(const BVHParams &p, float probability=1.0f) const
virtual bool is_leaf() const =0
bool has_unaligned() const
virtual BVHNode * get_child(int i) const =0
virtual int num_triangles() const
virtual void print(int depth=0) const =0
void dump_graph(const char *filename)
__forceinline float safe_area() const