41 #include <cugar/basic/numbers.h> 42 #include <cugar/linalg/vector.h> 58 template <
typename Vector_t>
61 typedef typename Vector_t::value_type value_type;
62 typedef typename Vector_t vector_type;
66 CUGAR_HOST CUGAR_DEVICE
Bbox();
71 CUGAR_HOST CUGAR_DEVICE
Bbox(
78 CUGAR_HOST CUGAR_DEVICE
Bbox(
86 CUGAR_HOST CUGAR_DEVICE
Bbox(
93 CUGAR_HOST CUGAR_DEVICE
Bbox(
99 CUGAR_HOST CUGAR_DEVICE
void insert(
const Vector_t& v);
104 CUGAR_HOST CUGAR_DEVICE
void insert(
const Bbox& v);
108 CUGAR_HOST CUGAR_DEVICE
void clear();
113 CUGAR_HOST CUGAR_DEVICE
const Vector_t&
operator[](
const size_t i)
const {
return (&
m_min)[i]; }
145 inline CUGAR_HOST_DEVICE
float area(
const Bbox2f& bbox);
150 inline CUGAR_HOST_DEVICE
float area(
const Bbox3f& bbox);
156 template <
typename Vector_t>
163 template <
typename Vector_t>
170 template <
typename Vector_t>
176 template <
typename Vector_t>
182 template <
typename Vector_t>
187 template <u
int32 DIM>
193 typedef float result_type;
195 CUGAR_FORCEINLINE CUGAR_HOST_DEVICE
196 result_type operator() (
const bbox_type& bbox)
const {
return area(bbox); }
204 #include <cugar/linalg/bbox_inline.h> CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float sq_distance(const Bbox< Vector_t > &bbox, const Vector_t &p)
Definition: bbox_inline.h:186
Vector_t m_max
max corner
Definition: bbox.h:126
CUGAR_HOST CUGAR_DEVICE void clear()
Definition: bbox_inline.h:85
CUGAR_HOST_DEVICE bool contains(const Bbox< Vector_t > &bbox, const Vector_t &p)
Definition: bbox_inline.h:154
CUGAR_HOST CUGAR_DEVICE Vector_t & operator[](const size_t i)
Definition: bbox.h:118
CUGAR_HOST CUGAR_DEVICE Bbox< Vector_t > & operator=(const Bbox< Vector_t > &bb)
Definition: bbox_inline.h:95
CUGAR_HOST CUGAR_DEVICE const Vector_t & operator[](const size_t i) const
Definition: bbox.h:113
Vector_t m_min
min corner
Definition: bbox.h:125
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE size_t largest_axis(const Bbox< Vector_t > &bbox)
Definition: bbox_inline.h:103
CUGAR_HOST_DEVICE float area(const Bbox2f &bbox)
Definition: bbox_inline.h:134
CUGAR_HOST CUGAR_DEVICE Bbox()
Definition: bbox_inline.h:31
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector_t extents(const Bbox< Vector_t > &bbox)
Definition: bbox_inline.h:126
CUGAR_HOST CUGAR_DEVICE void insert(const Vector_t &v)
Definition: bbox_inline.h:65