/// <summary> /// Impresion recursiva /// </summary> private void doPrintDebugQuadtree(QuadtreeNode node, int index, StringBuilder sb) { String lineas = ""; for (int i = 0; i < index; i++) { lineas += "-"; } if (node.isLeaf()) { if (node.models.Length > 0) { sb.Append(lineas + "Models [" + node.models.Length + "]" + "\n"); } else { sb.Append(lineas + "[0]" + "\n"); } } else { sb.Append(lineas + "\n"); index++; for (int i = 0; i < node.children.Length; i++) { doPrintDebugQuadtree(node.children[i], index, sb); } } }
private void obtenerEstadisticas(QuadtreeNode node, ref int minModels, ref int maxModels) { if (node.isLeaf()) { int n = node.models.Length; if (n < minModels) { minModels = n; } if (n > maxModels) { maxModels = n; } } else { for (int i = 0; i < node.children.Length; i++) { obtenerEstadisticas(node.children[i], ref minModels, ref maxModels); } } }