Interface LeftBalancedKdTree

All Superinterfaces:
KdTree, Serializable
All Known Implementing Classes:
LeftBalancedKdTreeImpl

public interface LeftBalancedKdTree extends KdTree
Left-balanced Kd-tree. Currently used by GPU-accelerated mesh distance nearest-neighbor methods.
  • Method Details

    • create

      static LeftBalancedKdTree create(Collection<MeshFacet> facets)
      Constructor.
      Parameters:
      facets - MeshFacets from which Kd-tree is built
      Returns:
      built Kd-tree
    • create

      static LeftBalancedKdTree create(MeshModel mesh)
      Constructor.
      Parameters:
      mesh - MeshModel from which Kd-tree is built
      Returns:
      built Kd-tree
    • getKdTreeArray

      List<LeftBalancedKdNode> getKdTreeArray()
      Gets the Kd-tree stored in an array.
      Returns:
      Kd-tree array.
    • getMeshPointsArray

      List<MeshPoint> getMeshPointsArray()
      Gets the Kd-tree as an array of MeshPoint, instead of LeftBalancedKdNode.
      Returns:
      Kd-tree as an array of MeshPoint.
    • getLocationsArray

      List<javax.vecmath.Point3d> getLocationsArray()
      Gets the Kd-tree as an array of Point3d, instead of LeftBalancedKdNode.
      Returns:
      Kd-tree as an array of Point3d.
    • getNode

      LeftBalancedKdNode getNode(int index)
      Returns node of the tree at the specified index of the tree array.
      Parameters:
      index - - Index of node
      Throws:
      ArrayIndexOutOfBoundsException - - If index is too big
    • hasLeftChild

      boolean hasLeftChild(int index)
      True if there exists a left child of node at index.
      Parameters:
      index - - index of parent in kdTree array
    • hasRightChild

      boolean hasRightChild(int index)
      True if there exists a right child of node at index.
      Parameters:
      index - - index of parent in kdTree array
    • getLeftChild

      LeftBalancedKdNode getLeftChild(int index)
      Returns left child of node at index.
      Parameters:
      index - - Index of node
      Throws:
      ArrayIndexOutOfBoundsException - - If index is too big
    • getRightChild

      LeftBalancedKdNode getRightChild(int index)
      Returns right child of node at index.
      Parameters:
      index - - Index of node
      Throws:
      ArrayIndexOutOfBoundsException - - If index is too big