aabb3.h 992 Bytes
#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