aabb3.h
992 Bytes
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
56
57
58
59
60
61
62
#ifndef STIM_AABB3_H
#define STIM_AABB3_H
#include <stim/cuda/cudatools/callable.h>
#include <stim/visualization/aabbn.h>
namespace stim{
//template<typename T>
//using aabb3 = aabbn<T, 3>;
/// Structure for a 3D axis aligned bounding box
template<typename T>
struct aabb3 : public aabbn<T, 3>{
CUDA_CALLABLE aabb3() : aabbn() {}
CUDA_CALLABLE aabb3(T x0, T y0, T z0, T x1, T y1, T z1){
low[0] = x0;
low[1] = y0;
low[2] = z0;
high[0] = x0;
high[1] = x1;
high[2] = x2;
}
CUDA_CALLABLE aabb3(T x, T y, T z) {
low[0] = high[0] = x;
low[1] = high[1] = y;
low[2] = high[2] = z;
}
CUDA_CALLABLE void insert(T x, T y, T z) {
T p[3];
p[0] = x;
p[1] = y;
p[2] = z;
aabbn<T, 3>::insert(p);
}
CUDA_CALLABLE void trim_low(T x, T y, T z) {
T p[3];
p[0] = x;
p[1] = y;
p[2] = z;
aabbn<T, 3>::trim_low(p);
}
CUDA_CALLABLE void trim_high(T x, T y, T z) {
T p[3];
p[0] = x;
p[1] = y;
p[2] = z;
aabbn<T, 3>::trim_high(p);
}
};
}
#endif