Package cz.fidentis.analyst.data.kdtree
Interface LeftBalancedKdTree
- All Superinterfaces:
KdTree
,Serializable
- All Known Implementing Classes:
LeftBalancedKdTreeImpl
Left-balanced Kd-tree. Currently used by GPU-accelerated mesh distance nearest-neighbor methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LeftBalancedKdTree
Constructor.static LeftBalancedKdTree
create
(Collection<MeshFacet> facets) Constructor.Gets the Kd-tree stored in an array.getLeftChild
(int index) Returns left child of node at index.List
<javax.vecmath.Point3d> Gets the Kd-tree as an array ofPoint3d
, instead ofLeftBalancedKdNode
.Gets the Kd-tree as an array ofMeshPoint
, instead ofLeftBalancedKdNode
.getNode
(int index) Returns node of the tree at the specified index of the tree array.getRightChild
(int index) Returns right child of node at index.boolean
hasLeftChild
(int index) True if there exists a left child of node at index.boolean
hasRightChild
(int index) True if there exists a right child of node at index.
-
Method Details
-
create
Constructor.- Parameters:
facets
- MeshFacets from which Kd-tree is built- Returns:
- built Kd-tree
-
create
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
Gets the Kd-tree as an array ofMeshPoint
, instead ofLeftBalancedKdNode
.- Returns:
- Kd-tree as an array of
MeshPoint
.
-
getLocationsArray
List<javax.vecmath.Point3d> getLocationsArray()Gets the Kd-tree as an array ofPoint3d
, instead ofLeftBalancedKdNode
.- Returns:
- Kd-tree as an array of
Point3d
.
-
getNode
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
Returns left child of node at index.- Parameters:
index
- - Index of node- Throws:
ArrayIndexOutOfBoundsException
- - If index is too big
-
getRightChild
Returns right child of node at index.- Parameters:
index
- - Index of node- Throws:
ArrayIndexOutOfBoundsException
- - If index is too big
-