From: <ha...@us...> - 2012-08-25 23:42:19
|
Revision: 17478 http://jmol.svn.sourceforge.net/jmol/?rev=17478&view=rev Author: hansonr Date: 2012-08-25 23:42:13 +0000 (Sat, 25 Aug 2012) Log Message: ----------- unused code removed Modified Paths: -------------- trunk/Jmol/src/org/jmol/bspt/Bspt.java Modified: trunk/Jmol/src/org/jmol/bspt/Bspt.java =================================================================== --- trunk/Jmol/src/org/jmol/bspt/Bspt.java 2012-08-25 23:40:08 UTC (rev 17477) +++ trunk/Jmol/src/org/jmol/bspt/Bspt.java 2012-08-25 23:42:13 UTC (rev 17478) @@ -82,21 +82,6 @@ int index; Element eleRoot; - /* - static float distance(int dim, Point3f t1, Point3f t2) { - return Math.sqrt(distance2(dim, t1, t2)); - } - - static float distance2(int dim, Point3f t1, Point3f t2) { - float distance2 = 0.0; - while (--dim >= 0) { - float distT = t1.getDimensionValue(dim) - t2.getDimensionValue(dim); - distance2 += distT*distT; - } - return distance2; - } - */ - /** * Create a bspt with the specified number of dimensions. For a 3-dimensional * tree (x,y,z) call new Bspt(3). @@ -146,122 +131,6 @@ // return eleRoot.toString(); // } - /* - Enumeration enum() { - return new EnumerateAll(); - } - - class EnumerateAll implements Enumeration { - Node[] stack; - int sp; - int i; - Leaf leaf; - - EnumerateAll() { - stack = new Node[stackDepth]; - sp = 0; - Element ele = eleRoot; - while (ele instanceof Node) { - Node node = (Node) ele; - if (sp == stackDepth) - Logger.debug("Bspt.EnumerateAll tree stack overflow"); - stack[sp++] = node; - ele = node.eleLE; - } - leaf = (Leaf)ele; - i = 0; - } - - boolean hasMoreElements() { - return (i < leaf.count) || (sp > 0); - } - - Object nextElement() { - if (i == leaf.count) { - //Logger.debug("-->" + stack[sp-1].splitValue); - Element ele = stack[--sp].eleGE; - while (ele instanceof Node) { - Node node = (Node) ele; - stack[sp++] = node; - ele = node.eleLE; - } - leaf = (Leaf)ele; - i = 0; - } - return leaf.tuples[i++]; - } - } - - Enumeration enumNear(Point3f center, float distance) { - return new EnumerateNear(center, distance); - } - - class EnumerateNear implements Enumeration { - Node[] stack; - int sp; - int i; - Leaf leaf; - float distance; - Point3f center; - - EnumerateNear(Point3f center, float distance) { - this.distance = distance; - this.center = center; - - stack = new Node[stackDepth]; - sp = 0; - Element ele = eleRoot; - while (ele instanceof Node) { - Node node = (Node) ele; - if (center.getDimensionValue(node.dim) - distance <= node.splitValue) { - if (sp == stackDepth) - Logger.debug("Bspt.EnumerateNear tree stack overflow"); - stack[sp++] = node; - ele = node.eleLE; - } else { - ele = node.eleGE; - } - } - leaf = (Leaf)ele; - i = 0; - } - - boolean hasMoreElements() { - if (i < leaf.count) - return true; - if (sp == 0) - return false; - Element ele = stack[--sp]; - while (ele instanceof Node) { - Node node = (Node) ele; - if (center.getDimensionValue(node.dim) + distance < node.splitValue) { - if (sp == 0) - return false; - ele = stack[--sp]; - } else { - ele = node.eleGE; - while (ele instanceof Node) { - Node nodeLeft = (Node) ele; - stack[sp++] = nodeLeft; - ele = nodeLeft.eleLE; - } - } - } - leaf = (Leaf)ele; - i = 0; - return true; - } - - Object nextElement() { - return leaf.tuples[i++]; - } - } - */ - - /* public SphereIterator allocateSphereIterator() { - return new SphereIterator(this); - } - */ public CubeIterator allocateCubeIterator() { return new CubeIterator(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |