org.jmol.bspt
Class Node

java.lang.Object
  extended by org.jmol.bspt.Element
      extended by org.jmol.bspt.Node

 class Node
extends Element

Nodes of the bspt. It is a binary tree so nodes contain two children, called left and right. Nodes split along one dimension. The instance variable dim holds the dimension along which this node is split. Each child holds the minimum and maximum values for its subtree when split along the specified dim.

The current implementation allows for the case where the maximum left value is == the minimum right value. This can happen when the tree is filled with coordinate values that contain the same value along one dimension ... as with very regular crystals

The tree is not kept balanced.

Author:
Miguel, miguel@jmol.org

Field Summary
(package private)  int dim
           
(package private)  Element eleLeft
           
(package private)  Element eleRight
           
(package private)  float maxLeft
           
(package private)  float maxRight
           
(package private)  float minLeft
           
(package private)  float minRight
           
 
Fields inherited from class org.jmol.bspt.Element
bspt, count
 
Constructor Summary
Node(Bspt bspt, int level, Leaf leafLeft)
           
 
Method Summary
(package private)  Element addTuple(int level, Point3f tuple)
           
(package private)  void dump(int level, StringBuffer sb)
           
(package private) static float getDimensionValue(Point3f pt, int dim)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dim

int dim

minLeft

float minLeft

maxLeft

float maxLeft

eleLeft

Element eleLeft

minRight

float minRight

maxRight

float maxRight

eleRight

Element eleRight
Constructor Detail

Node

Node(Bspt bspt,
     int level,
     Leaf leafLeft)
Method Detail

addTuple

Element addTuple(int level,
                 Point3f tuple)
Specified by:
addTuple in class Element

dump

void dump(int level,
          StringBuffer sb)
Specified by:
dump in class Element

toString

public String toString()
Overrides:
toString in class Object

getDimensionValue

static float getDimensionValue(Point3f pt,
                               int dim)