1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use crate::geom::{Cube, SmoothTriangle};
pub enum Tree<'a, T> {
Root {
boundary: Cube,
children: [Box<Tree<'a, T>>; 8],
},
Branch {
boundary: Cube,
children: [Box<Tree<'a, T>>; 8],
},
Leaf {
boundary: Cube,
tris: Vec<(T, &'a SmoothTriangle)>,
},
Empty {
boundary: Cube,
},
}
impl<'a, T> Tree<'a, T> {
#[allow(clippy::missing_const_for_fn)]
#[inline]
#[must_use]
pub fn boundary(&self) -> &Cube {
match *self {
Self::Root { ref boundary, .. }
| Self::Branch { ref boundary, .. }
| Self::Leaf { ref boundary, .. }
| Self::Empty { ref boundary, .. } => boundary,
}
}
}
pub mod info;
pub mod observe;
pub mod scan;
pub mod search;
pub use self::{info::*, observe::*, scan::*, search::*};