/** Get the node corresponding to the first interval boundary. * @return smallest internal node, * or null if there are no internal nodes (i.e. the set is either empty or covers the real line) */ private BSPTree<Euclidean1D> getFirstIntervalBoundary() { // start search at the tree root BSPTree<Euclidean1D> node = getTree(false); if (node.getCut() == null) { return null; } // walk tree until we find the smallest internal node node = getFirstLeaf(node).getParent(); // walk tree until we find an interval boundary while (node != null && !(isIntervalStart(node) || isIntervalEnd(node))) { node = nextInternalNode(node); } return node; }
/** Get the node corresponding to the first interval boundary. * @return smallest internal node, * or null if there are no internal nodes (i.e. the set is either empty or covers the real line) */ private BSPTree<Euclidean1D> getFirstIntervalBoundary() { // start search at the tree root BSPTree<Euclidean1D> node = getTree(false); if (node.getCut() == null) { return null; } // walk tree until we find the smallest internal node node = getFirstLeaf(node).getParent(); // walk tree until we find an interval boundary while (node != null && !(isIntervalStart(node) || isIntervalEnd(node))) { node = nextInternalNode(node); } return node; }