static void _traverse_check_local_counts (VsgPRTree3dNodeInfo *node_info, gint pcounts[2][64]) { if (! node_info->isleaf) { if (pcounts[0][node_info->depth] != node_info->point_count) { g_printerr ("%d: Point count error on node ", rk); vsg_prtree_key3d_write (&node_info->id, stderr); g_printerr (" node_info=%d children=%d\n", node_info->point_count, pcounts[0][node_info->depth]); } if ((pcounts[1][node_info->depth] + g_slist_length (node_info->region_list)) != node_info->region_count) { g_printerr ("%d: Region count error on node ", rk); vsg_prtree_key3d_write (&node_info->id, stderr); g_printerr (" node_info=%d children=%d\n", node_info->region_count, pcounts[1][node_info->depth]); } } pcounts[0][node_info->depth] = 0; pcounts[1][node_info->depth] = 0; if (node_info->father_info == NULL) return; // *** PRIVATE-REMOTE if (! VSG_PRTREE3D_NODE_INFO_IS_PRIVATE_REMOTE (node_info)) { pcounts[0][node_info->depth-1] += node_info->point_count; pcounts[1][node_info->depth-1] += node_info->region_count; } }
static void _traverse_fg_write (VsgPRTree3dNodeInfo *node_info, FILE *file) { gchar *indent = alloca (node_info->depth * 2 * sizeof (gchar)+1); memset (indent, ' ', node_info->depth * 2 * sizeof (gchar)); indent[node_info->depth * 2 * sizeof (gchar)] = '\0'; fprintf (file, "%snode c=", indent); vsg_prtree_key3d_write (&node_info->id, file); if (!VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) { FileAndIndent fai = {file, indent}; /* fprintf (file, " dev="); */ /* aran_development3d_write ((AranDevelopment3d *) node_info->user_data, */ /* file); */ /* fprintf (file, "\n"); */ if (node_info->point_count >0) { fprintf (file, "\n"); g_slist_foreach (node_info->point_list, (GFunc) _pt_write, &fai); } } else fprintf (file, "remote"); fprintf (file, "\n"); }