Go to the documentation of this file. 1 #ifndef __GfxTL_AABOX_HEADER__
2 #define __GfxTL_AABOX_HEADER__
17 template<
class Po
int >
46 template<
class Po
ints >
48 template<
class Po
intForwardIterator >
49 void Bound(PointForwardIterator begin, PointForwardIterator end);
61 template<
class Po
intT >
63 template<
class Po
intT >
65 template<
class Po
intT >
72 template<
class Po
int >
73 template<
class Po
ints >
76 for (
unsigned int i = 0; i < Dim; ++i)
78 _pmin[i] = -std::numeric_limits< ScalarType >::infinity();
79 _pmax[i] = std::numeric_limits< ScalarType >::infinity();
83 for (
unsigned int i = 0; i < Dim; ++i)
85 _pmax[i] = _pmin[i] = points[0][i];
87 for (
size_t i = 1; i < size; ++i)
89 for (
unsigned int j = 0; j < Dim; ++j)
91 if (_pmin[j] > points[i][j])
93 _pmin[j] = points[i][j];
95 else if (_pmax[j] < points[i][j])
97 _pmax[j] = points[i][j];
104 template<
class Po
int >
105 template<
class Po
intForwardIterator >
107 PointForwardIterator end)
109 for (
unsigned int i = 0; i < Dim; ++i)
111 _pmin[i] = -std::numeric_limits< ScalarType >::infinity();
112 _pmax[i] = std::numeric_limits< ScalarType >::infinity();
118 for (
unsigned int i = 0; i < Dim; ++i)
120 _pmax[i] = _pmin[i] = (*begin)[i];
122 for (++begin; begin != end; ++begin)
124 for (
unsigned int j = 0; j < Dim; ++j)
126 if (_pmin[j] > (*begin)[j])
128 _pmin[j] = (*begin)[j];
130 else if (_pmax[j] < (*begin)[j])
132 _pmax[j] = (*begin)[j];
138 template<
class Po
int >
141 for (
unsigned int j = 0; j < Dim; ++j)
148 template<
class Po
int >
151 for (
unsigned int i = 0; i < Dim; ++i)
165 template<
class Po
int >
170 for (
unsigned int j = 0; j < Dim; ++j)
172 if (_pmin[j] > (
v = p[j] - r))
176 if (_pmax[j] < (
v = p[j] + r))
184 template<
class Po
int >
187 IncrementalBound(box.
Min());
188 IncrementalBound(box.
Max());
192 template<
class Po
int >
193 template<
class Po
intT >
198 for (
unsigned int i = 0; i < Dim; ++i)
205 template<
class Po
int >
206 template<
class Po
intT >
211 for (
unsigned int i = 0; i < Dim; ++i)
218 else if (p[i] > Max()[i])
227 template<
class Po
int >
228 template<
class Po
intT >
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
Point operator[](unsigned int index) const
ScalarType MinSqrDist(const PointT &p) const
AABox< Point > & IncrementalBound(const PointType &p)
AABox< Point > & operator=(const AACube< PointType > &cube)
std::vector< Point > Points
bool IsInside(const Point &p) const
void Split(unsigned int axis, ScalarType s, AABox< Point > *left, AABox< Point > *right) const
AABox< Point > & operator+=(const PointType &p)
ScalarType Distance(const PointT &p) const
void Center(Point *center) const
void Bound(const Points &points, size_t size)
ScalarType DiagLength() const
const Point & Min() const
double v(double t, double v0, double a0, double j)
AABox(const AACube< PointType > &cube)
Point::ScalarType ScalarType
double s(double t, double s0, double v0, double a0, double j)
ScalarType MaxSqrDist(const PointT &p) const