Class LeftBalancedKdNodeImpl
java.lang.Object
cz.fidentis.analyst.data.kdtree.impl.LeftBalancedKdNodeImpl
- All Implemented Interfaces:
KdNode
,LeftBalancedKdNode
,Serializable
Implementation of a kd-tree node used in the left-balanced kd-tree.
Doesn't support the lesser and greater points.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLeftBalancedKdNodeImpl
(MeshPoint point, MeshFacet meshFacet, int meshFacetIndex) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
getDepth()
Returns depth of the node in the tree.getFacet()
Gets theMeshFacet
of node.Returns a map of all mesh facets that share the stored vertex.Tree traversal - go to the "grater" child.int
Gets the index of the Node in the Kd-tree array.Tree traversal - go to the "lesser" child.javax.vecmath.Point3d
Returns 3D location of vertices stored in this nodeint
Gets the index of theMeshPoint
in theMeshFacet
.Gets theMeshPoint
of node.Gets the one ring neighborhood of theMeshPoint
on theMeshFacet
saved in node.boolean
Check if theMeshPoint
stored in this node is on the boundary of theMeshFacet
stored in this node.setGreater
(KdNode greater) Set lesser node.void
setKdTreeValues
(int index, int depth) Sets the values of the Node in the Kd-Tree array.Set lesser node.
-
Constructor Details
-
LeftBalancedKdNodeImpl
Constructor. Used during initial loading of data, before the Kd-tree is built.- Parameters:
point
- - MeshPointmeshFacet
- - MeshFacet on which the point is locatedmeshFacetIndex
- - 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 interfaceLeftBalancedKdNode
- Parameters:
index
- - Index of node in the Kd-Tree arraydepth
- - 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 interfaceLeftBalancedKdNode
- 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. -
getLocation
public javax.vecmath.Point3d getLocation()Description copied from interface:KdNode
Returns 3D location of vertices stored in this node- Specified by:
getLocation
in interfaceKdNode
- Returns:
- 3D location of vertices stored in this node
-
getMeshPoint
Description copied from interface:LeftBalancedKdNode
Gets theMeshPoint
of node.- Specified by:
getMeshPoint
in interfaceLeftBalancedKdNode
- Returns:
MeshPoint
of node.
-
getFacet
Description copied from interface:LeftBalancedKdNode
Gets theMeshFacet
of node.- Specified by:
getFacet
in interfaceLeftBalancedKdNode
- Returns:
MeshFacet
of node.
-
getMeshFacetIndex
public int getMeshFacetIndex()Description copied from interface:LeftBalancedKdNode
Gets the index of theMeshPoint
in theMeshFacet
.- Specified by:
getMeshFacetIndex
in interfaceLeftBalancedKdNode
- Returns:
- index of the
MeshPoint
in theMeshFacet
.
-
getSurroundingTriangles
Description copied from interface:LeftBalancedKdNode
Gets the one ring neighborhood of theMeshPoint
on theMeshFacet
saved in node.- Specified by:
getSurroundingTriangles
in interfaceLeftBalancedKdNode
- Returns:
- List of
MeshTriangle
surrounding theMeshPoint
on theMeshFacet
.
-
isOnBoundary
public boolean isOnBoundary()Description copied from interface:LeftBalancedKdNode
Check if theMeshPoint
stored in this node is on the boundary of theMeshFacet
stored in this node.- Specified by:
isOnBoundary
in interfaceLeftBalancedKdNode
- Returns:
true
- when theMeshPoint
is on the boundary of theMeshFacet
,false
otherwise
-
getLesser
Description copied from interface:KdNode
Tree traversal - go to the "lesser" child. -
getGreater
Description copied from interface:KdNode
Tree traversal - go to the "grater" child.- Specified by:
getGreater
in interfaceKdNode
- Returns:
- greater node, null if current node is leaf
-
setLesser
Description copied from interface:KdNode
Set lesser node. -
setGreater
Description copied from interface:KdNode
Set lesser node.- Specified by:
setGreater
in interfaceKdNode
- Parameters:
greater
- Node to be set as greater- Returns:
- current node
-
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.
-