pub struct Node<'a, N: IndexableNum, T: KDTreeIndex<N>> { /* private fields */ }
Expand description
An internal node in the KDTree.
Implementations§
Source§impl<'a, N: IndexableNum, T: KDTreeIndex<N>> Node<'a, N, T>
impl<'a, N: IndexableNum, T: KDTreeIndex<N>> Node<'a, N, T>
Sourcepub fn left_child(&self) -> Option<Node<'_, N, T>>
pub fn left_child(&self) -> Option<Node<'_, N, T>>
The child node representing the “left” half.
Returns None
if Self::is_parent
is false
.
Sourcepub fn left_child_unchecked(&self) -> Node<'_, N, T>
pub fn left_child_unchecked(&self) -> Node<'_, N, T>
The child node representing the “left” half.
Note that this does not include the middle index of the current node.
Sourcepub fn right_child(&self) -> Option<Node<'_, N, T>>
pub fn right_child(&self) -> Option<Node<'_, N, T>>
The child node representing the “right” half.
Returns None
if Self::is_parent
is false
.
Sourcepub fn right_child_unchecked(&self) -> Node<'_, N, T>
pub fn right_child_unchecked(&self) -> Node<'_, N, T>
The child node representing the “right” half.
Note that this does not include the middle index of the current node.
Sourcepub fn middle_insertion_index(&self) -> Option<u32>
pub fn middle_insertion_index(&self) -> Option<u32>
The original insertion index of the “middle child” of this node. This is only valid when
this is a parent node, which you can check with Self::is_parent
.
Returns None
if Self::is_parent
is false
.
Sourcepub fn middle_insertion_index_unchecked(&self) -> u32
pub fn middle_insertion_index_unchecked(&self) -> u32
The original insertion index of the “middle child” of this node. This is only valid when
this is a parent node, which you can check with Self::is_parent
.
Sourcepub fn leaf_insertion_indices(&self) -> Option<Vec<u32>>
pub fn leaf_insertion_indices(&self) -> Option<Vec<u32>>
The original insertion indices. This is only valid when this is a leaf node, which you can
check with Self::is_leaf
.
Returns None
if Self::is_leaf
is false
.
Sourcepub fn leaf_insertion_indices_unchecked(&self) -> Vec<u32>
pub fn leaf_insertion_indices_unchecked(&self) -> Vec<u32>
The original insertion indices. This is only valid when this is a leaf node, which you can
check with Self::is_leaf
.
Trait Implementations§
Source§impl<'a, N: Clone + IndexableNum, T: Clone + KDTreeIndex<N>> Clone for Node<'a, N, T>
impl<'a, N: Clone + IndexableNum, T: Clone + KDTreeIndex<N>> Clone for Node<'a, N, T>
Source§impl<'a, N: Debug + IndexableNum, T: Debug + KDTreeIndex<N>> Debug for Node<'a, N, T>
impl<'a, N: Debug + IndexableNum, T: Debug + KDTreeIndex<N>> Debug for Node<'a, N, T>
Source§impl<N: IndexableNum, T: KDTreeIndex<N>> GeometryTrait for Node<'_, N, T>
impl<N: IndexableNum, T: KDTreeIndex<N>> GeometryTrait for Node<'_, N, T>
Source§type PointType<'a> = UnimplementedPoint<N>
where
Self: 'a
type PointType<'a> = UnimplementedPoint<N> where Self: 'a
Source§type LineStringType<'a> = UnimplementedLineString<N>
where
Self: 'a
type LineStringType<'a> = UnimplementedLineString<N> where Self: 'a
Source§type PolygonType<'a> = UnimplementedPolygon<N>
where
Self: 'a
type PolygonType<'a> = UnimplementedPolygon<N> where Self: 'a
Source§type MultiPointType<'a> = UnimplementedMultiPoint<N>
where
Self: 'a
type MultiPointType<'a> = UnimplementedMultiPoint<N> where Self: 'a
Source§type MultiLineStringType<'a> = UnimplementedMultiLineString<N>
where
Self: 'a
type MultiLineStringType<'a> = UnimplementedMultiLineString<N> where Self: 'a
Source§type MultiPolygonType<'a> = UnimplementedMultiPolygon<N>
where
Self: 'a
type MultiPolygonType<'a> = UnimplementedMultiPolygon<N> where Self: 'a
Source§type GeometryCollectionType<'a> = UnimplementedGeometryCollection<N>
where
Self: 'a
type GeometryCollectionType<'a> = UnimplementedGeometryCollection<N> where Self: 'a
Source§type RectType<'a> = Node<'a, N, T>
where
Self: 'a
type RectType<'a> = Node<'a, N, T> where Self: 'a
Source§type TriangleType<'a> = UnimplementedTriangle<N>
where
Self: 'a
type TriangleType<'a> = UnimplementedTriangle<N> where Self: 'a
Source§type LineType<'a> = UnimplementedLine<N>
where
Self: 'a
type LineType<'a> = UnimplementedLine<N> where Self: 'a
Source§fn dim(&self) -> Dimensions
fn dim(&self) -> Dimensions
Source§fn as_type(
&self,
) -> GeometryType<'_, Self::PointType<'_>, Self::LineStringType<'_>, Self::PolygonType<'_>, Self::MultiPointType<'_>, Self::MultiLineStringType<'_>, Self::MultiPolygonType<'_>, Self::GeometryCollectionType<'_>, Self::RectType<'_>, Self::TriangleType<'_>, Self::LineType<'_>>
fn as_type( &self, ) -> GeometryType<'_, Self::PointType<'_>, Self::LineStringType<'_>, Self::PolygonType<'_>, Self::MultiPointType<'_>, Self::MultiLineStringType<'_>, Self::MultiPolygonType<'_>, Self::GeometryCollectionType<'_>, Self::RectType<'_>, Self::TriangleType<'_>, Self::LineType<'_>>
GeometryType
enum, which allows for downcasting to a specific
type