/** * Recursively builds a binary tree with leaf quad nodes. */ private void buildTree(int[] ijkl, float[] xyz, float[] uvw, float[] rgb) { float[] c = computeCenters(ijkl,xyz); BoundingBoxTree bbt = new BoundingBoxTree(MIN_QUAD_PER_NODE,c); buildTree(this,bbt.getRoot(),ijkl,xyz,uvw,rgb); } private void buildTree(Group parent, BoundingBoxTree.Node bbtNode,
/** * Recursively builds a binary tree with leaf triangle nodes. */ private void buildTree(int[] ijk, float[] xyz, float[] uvw, float[] rgb) { float[] c = computeCenters(ijk,xyz); BoundingBoxTree bbt = new BoundingBoxTree(MIN_TRI_PER_NODE,c); buildTree(this,bbt.getRoot(),ijk,xyz,uvw,rgb); } private void buildTree(Group parent, BoundingBoxTree.Node bbtNode,
public void testRandom() { int minSize = 10; int n = 10000; float[] x = randfloat(n); float[] y = randfloat(n); float[] z = randfloat(n); BoundingBoxTree bbt = new BoundingBoxTree(minSize,x,y,z); BoundingBoxTree.Node root = bbt.getRoot(); test(root,minSize,x,y,z); }
private void buildTree( Group parent, BoundingBoxTree.Node bbtNode, float[] xyz, float[] rgb) { if (bbtNode.isLeaf()) { PointNode pn; if (_size>0.0f) { pn = new PointNode(bbtNode,_size,xyz,rgb); } else { pn = new PointNode(bbtNode,xyz,rgb); } parent.addChild(pn); } else { Group group = new Group(); parent.addChild(group); buildTree(group,bbtNode.getLeft(),xyz,rgb); buildTree(group,bbtNode.getRight(),xyz,rgb); } }