Go to the documentation of this file. 1 #ifndef __GfxTL_AABOX_HEADER__
2 #define __GfxTL_AABOX_HEADER__
18 template <
class Po
int>
57 template <
class Po
ints>
59 template <
class Po
intForwardIterator>
60 void Bound(PointForwardIterator begin, PointForwardIterator end);
75 template <
class Po
intT>
77 template <
class Po
intT>
79 template <
class Po
intT>
86 template <
class Po
int>
87 template <
class Po
ints>
91 for (
unsigned int i = 0; i < Dim; ++i)
93 _pmin[i] = -std::numeric_limits<ScalarType>::infinity();
94 _pmax[i] = std::numeric_limits<ScalarType>::infinity();
98 for (
unsigned int i = 0; i < Dim; ++i)
100 _pmax[i] = _pmin[i] = points[0][i];
102 for (
size_t i = 1; i < size; ++i)
104 for (
unsigned int j = 0; j < Dim; ++j)
106 if (_pmin[j] > points[i][j])
108 _pmin[j] = points[i][j];
110 else if (_pmax[j] < points[i][j])
112 _pmax[j] = points[i][j];
119 template <
class Po
int>
120 template <
class Po
intForwardIterator>
124 for (
unsigned int i = 0; i < Dim; ++i)
126 _pmin[i] = -std::numeric_limits<ScalarType>::infinity();
127 _pmax[i] = std::numeric_limits<ScalarType>::infinity();
133 for (
unsigned int i = 0; i < Dim; ++i)
135 _pmax[i] = _pmin[i] = (*begin)[i];
137 for (++begin; begin != end; ++begin)
139 for (
unsigned int j = 0; j < Dim; ++j)
141 if (_pmin[j] > (*begin)[j])
143 _pmin[j] = (*begin)[j];
145 else if (_pmax[j] < (*begin)[j])
147 _pmax[j] = (*begin)[j];
153 template <
class Po
int>
157 for (
unsigned int j = 0; j < Dim; ++j)
164 template <
class Po
int>
168 for (
unsigned int i = 0; i < Dim; ++i)
182 template <
class Po
int>
187 for (
unsigned int j = 0; j < Dim; ++j)
189 if (_pmin[j] > (
v = p[j] - r))
193 if (_pmax[j] < (
v = p[j] + r))
201 template <
class Po
int>
205 IncrementalBound(box.
Min());
206 IncrementalBound(box.
Max());
210 template <
class Po
int>
211 template <
class Po
intT>
216 for (
unsigned int i = 0; i < Dim; ++i)
223 template <
class Po
int>
224 template <
class Po
intT>
229 for (
unsigned int i = 0; i < Dim; ++i)
236 else if (p[i] > Max()[i])
245 template <
class Po
int>
246 template <
class Po
intT>
state::Type right(state::Type previous)
Point operator[](unsigned int index) const
ScalarType MinSqrDist(const PointT &p) const
AABox< Point > & IncrementalBound(const PointType &p)
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 AACube< PointType > &cube)
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
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
double v(double t, double v0, double a0, double j)
AABox(const AACube< PointType > &cube)
state::Type center(state::Type previous)
state::Type left(state::Type previous)
Point::ScalarType ScalarType
double s(double t, double s0, double v0, double a0, double j)
ScalarType MaxSqrDist(const PointT &p) const