Class LeftBalancedKdNodeImpl

java.lang.Object
cz.fidentis.analyst.data.kdtree.impl.LeftBalancedKdNodeImpl
All Implemented Interfaces:
KdNode, LeftBalancedKdNode, Serializable

public class LeftBalancedKdNodeImpl extends Object implements LeftBalancedKdNode
Implementation of a kd-tree node used in the left-balanced kd-tree. Doesn't support the lesser and greater points.
See Also:
  • Constructor Details

    • LeftBalancedKdNodeImpl

      public LeftBalancedKdNodeImpl(MeshPoint point, MeshFacet meshFacet, int meshFacetIndex)
      Constructor. Used during initial loading of data, before the Kd-tree is built.
      Parameters:
      point - - MeshPoint
      meshFacet - - MeshFacet on which the point is located
      meshFacetIndex - - Index of the MeshPoint in the MeshFacet
  • Method Details

    • setKdTreeValues

      public void setKdTreeValues(int index, int depth)
      Description copied from interface: LeftBalancedKdNode
      Sets the values of the Node in the Kd-Tree array. Used during the building of the KdTree
      Specified by:
      setKdTreeValues in interface LeftBalancedKdNode
      Parameters:
      index - - Index of node in the Kd-Tree array
      depth - - Depth of node in the Kd-Tree
    • getKdTreeIndex

      public int getKdTreeIndex()
      Description copied from interface: LeftBalancedKdNode
      Gets the index of the Node in the Kd-tree array.
      Specified by:
      getKdTreeIndex in interface LeftBalancedKdNode
      Returns:
      index of the Node in the Kd-tree array.
    • getDepth

      public int getDepth()
      Description copied from interface: KdNode
      Returns depth of the node in the tree.
      Specified by:
      getDepth in interface KdNode
      Returns:
      depth of the node in the tree.
    • getLocation

      public javax.vecmath.Point3d getLocation()
      Description copied from interface: KdNode
      Returns 3D location of vertices stored in this node
      Specified by:
      getLocation in interface KdNode
      Returns:
      3D location of vertices stored in this node
    • getMeshPoint

      public MeshPoint getMeshPoint()
      Description copied from interface: LeftBalancedKdNode
      Gets the MeshPoint of node.
      Specified by:
      getMeshPoint in interface LeftBalancedKdNode
      Returns:
      MeshPoint of node.
    • getFacet

      public MeshFacet getFacet()
      Description copied from interface: LeftBalancedKdNode
      Gets the MeshFacet of node.
      Specified by:
      getFacet in interface LeftBalancedKdNode
      Returns:
      MeshFacet of node.
    • getMeshFacetIndex

      public int getMeshFacetIndex()
      Description copied from interface: LeftBalancedKdNode
      Gets the index of the MeshPoint in the MeshFacet.
      Specified by:
      getMeshFacetIndex in interface LeftBalancedKdNode
      Returns:
      index of the MeshPoint in the MeshFacet.
    • getSurroundingTriangles

      public List<MeshTriangle> getSurroundingTriangles()
      Description copied from interface: LeftBalancedKdNode
      Gets the one ring neighborhood of the MeshPoint on the MeshFacet saved in node.
      Specified by:
      getSurroundingTriangles in interface LeftBalancedKdNode
      Returns:
      List of MeshTriangle surrounding the MeshPoint on the MeshFacet.
    • isOnBoundary

      public boolean isOnBoundary()
      Description copied from interface: LeftBalancedKdNode
      Check if the MeshPoint stored in this node is on the boundary of the MeshFacet stored in this node.
      Specified by:
      isOnBoundary in interface LeftBalancedKdNode
      Returns:
      true - when the MeshPoint is on the boundary of the MeshFacet, false otherwise
    • getLesser

      public KdNode getLesser()
      Description copied from interface: KdNode
      Tree traversal - go to the "lesser" child.
      Specified by:
      getLesser in interface KdNode
      Returns:
      lesser node, null if current node is leaf
    • getGreater

      public KdNode getGreater()
      Description copied from interface: KdNode
      Tree traversal - go to the "grater" child.
      Specified by:
      getGreater in interface KdNode
      Returns:
      greater node, null if current node is leaf
    • setLesser

      public KdNode setLesser(KdNode lesser)
      Description copied from interface: KdNode
      Set lesser node.
      Specified by:
      setLesser in interface KdNode
      Parameters:
      lesser - Node to be set as lesser
      Returns:
      current node
    • setGreater

      public KdNode setGreater(KdNode greater)
      Description copied from interface: KdNode
      Set lesser node.
      Specified by:
      setGreater in interface KdNode
      Parameters:
      greater - Node to be set as greater
      Returns:
      current node
    • getFacets

      public Map<MeshFacet,Integer> getFacets()
      Description copied from interface: KdNode
      Returns a map of all mesh facets that share the stored vertex. Value in the map contains the index which the vertex is stored in the mesh facet.
      Specified by:
      getFacets in interface KdNode
      Returns:
      Map of facets sharing the stored mesh vertex