Class KdNodeImpl
java.lang.Object
cz.fidentis.analyst.data.kdtree.impl.KdNodeImpl
- All Implemented Interfaces:
KdNode
,Serializable
Implementation of k-D node.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionKdNodeImpl
(MeshFacet facet, int index, int depth) Constructor for storing a vertex of a mesh facet.KdNodeImpl
(MeshPoint point, int depth) Constructor for storing an independent mesh point.KdNodeImpl
(List<MeshFacet> facets, List<Integer> indices, int depth) Constructor for storing a vertex belonging to multiple mesh facets.KdNodeImpl
(javax.vecmath.Point3d point, int depth) Constructor for storing an independent point. -
Method Summary
Modifier and TypeMethodDescriptionint
getDepth()
Returns depth of the node in the tree.Returns a map of all mesh facets that share the stored vertex.Tree traversal - go to the "grater" child.Tree traversal - go to the "lesser" child.javax.vecmath.Point3d
Returns 3D location of vertices stored in this nodesetGreater
(KdNode greater) Set lesser node.Set lesser node.toString()
-
Constructor Details
-
KdNodeImpl
Constructor for storing a vertex of a mesh facet.- Parameters:
facet
- Mesh facet containing the mesh vertex. Must not be nullindex
- The index under which the vertex is stored in the mesh facet. Must be >= 0depth
- Depth of the node in the kd-tree. Must be >= 0- Throws:
IllegalArgumentException
- if some parameter is wrong
-
KdNodeImpl
Constructor for storing a vertex belonging to multiple mesh facets.- Parameters:
facets
- Mesh facets containing the mesh vertex. Must not be null or emptyindices
- Indices under which the vertex is stored in the mesh facet. Must be >= 0 and their unmber has to correspond to the number of facets.depth
- Depth of the node in the kd-tree. Must be >= 0- Throws:
IllegalArgumentException
- if some parameter is wrong
-
KdNodeImpl
public KdNodeImpl(javax.vecmath.Point3d point, int depth) Constructor for storing an independent point.- Parameters:
point
- A 3D point. Must not be nulldepth
- Depth of the node in the kd-tree. Must be >= 0- Throws:
IllegalArgumentException
- if some parameter is wrong
-
KdNodeImpl
Constructor for storing an independent mesh point.- Parameters:
point
- A meshpoint. Must not be nulldepth
- Depth of the node in the kd-tree. Must be >= 0- Throws:
IllegalArgumentException
- if some parameter is wrong
-
-
Method Details
-
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
-
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. -
toString
-