more tweak
This commit is contained in:
parent
24b7709b4c
commit
c9bab10f6b
1 changed files with 0 additions and 10 deletions
|
|
@ -5,9 +5,7 @@ use bevy::{
|
||||||
|
|
||||||
use crate::geom::Point;
|
use crate::geom::Point;
|
||||||
|
|
||||||
/// An entry in the R*‑tree, which can be either a leaf or a node.
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
||||||
pub enum Entry {
|
pub enum Entry {
|
||||||
Leaf { mbr: Aabb2d, object: Point },
|
Leaf { mbr: Aabb2d, object: Point },
|
||||||
Node { mbr: Aabb2d, child: TreeNode },
|
Node { mbr: Aabb2d, child: TreeNode },
|
||||||
|
|
@ -22,20 +20,12 @@ impl Entry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A node in the R*‑tree.
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct TreeNode {
|
pub struct TreeNode {
|
||||||
/// The entries stored in this node.
|
|
||||||
pub entries: Vec<Entry>,
|
pub entries: Vec<Entry>,
|
||||||
/// Indicates whether this node is a leaf.
|
|
||||||
pub is_leaf: bool,
|
pub is_leaf: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// R*‑tree data structure for indexing 2D or 3D points.
|
|
||||||
///
|
|
||||||
/// The tree is initialized with a maximum number of entries per node. If a node
|
|
||||||
/// exceeds this number, it will split. The tree supports insertion, deletion,
|
|
||||||
/// and range searches.
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct RStarTree {
|
pub struct RStarTree {
|
||||||
root: TreeNode,
|
root: TreeNode,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue