Go to the documentation of this file. 1 #ifndef __AACUBE_HEADER__
2 #define __AACUBE_HEADER__
10 template <
class Po
int>
28 template <
class Po
ints>
30 template <
class IteratorT>
31 void Bound(IteratorT begin, IteratorT end);
32 template <
class IteratorT>
34 template <
class Po
ints>
58 return _backBottomLeft;
64 return _backBottomLeft;
70 Point m(_backBottomLeft);
71 for (
unsigned int i = 0; i <
Dim; ++i)
79 Point _backBottomLeft;
83 template <
class Po
int>
84 template <
class Po
ints>
92 for (
unsigned int u = 0; u < Dim; ++u)
94 pmax[u] = pmin[u] = points[0][u];
96 for (
size_t i = 1; i < size; ++i)
98 for (
unsigned int j = 0; j < Dim; ++j)
100 if (pmin[j] > points[i][j])
102 pmin[j] = points[i][j];
104 else if (pmax[j] < points[i][j])
106 pmax[j] = points[i][j];
111 Point r = pmax - center;
113 for (
unsigned int u = 1; u < Dim; ++u)
118 _backBottomLeft = center;
119 for (
unsigned int u = 0; u < Dim; ++u)
121 _backBottomLeft[u] -= rmax;
127 template <
class Po
int>
128 template <
class IteratorT>
136 for (
unsigned int u = 0; u < Dim; ++u)
138 pmax[u] = pmin[u] = (*begin)[u];
141 for (++i; i != end; ++i)
143 for (
unsigned int j = 0; j < Dim; ++j)
145 if (pmin[j] > (*i)[j])
149 else if (pmax[j] < (*i)[j])
156 Point r = pmax - center;
158 for (
unsigned int u = 1; u < Dim; ++u)
163 _backBottomLeft = center;
164 for (
unsigned int u = 0; u < Dim; ++u)
166 _backBottomLeft[u] -= rmax;
172 template <
class Po
int>
173 template <
class IteratorT>
182 for (
unsigned int u = 0; u < Dim; ++u)
184 pmax[u] = pmin[u] = (*begin)[u];
187 for (++i; i != end; ++i)
189 for (
unsigned int j = 0; j < Dim; ++j)
191 if (pmin[j] > (*i)[j])
195 else if (pmax[j] < (*i)[j])
201 _backBottomLeft = pmin;
202 _width = pmax[0] - pmin[0];
203 for (
unsigned int i = 1; i < Dim; ++i)
205 _width =
max(_width, pmax[i] - pmin[i]);
210 template <
class Po
int>
211 template <
class Po
ints>
219 pmax = pmin = points[0];
220 for (
size_t i = 1; i < size; ++i)
222 for (
unsigned int j = 0; j < Dim; ++j)
224 if (pmin[j] > points[i][j])
226 pmin[j] = points[i][j];
228 else if (pmax[j] < points[i][j])
230 pmax[j] = points[i][j];
234 _width = (pmax - pmin).Length();
236 _backBottomLeft = center;
237 for (
unsigned int u = 0; u < Dim; ++u)
239 _backBottomLeft[u] -= _width / 2;
const Point & LeftBottomBack() const
MatrixXX< C, R, T > max(const MatrixXX< C, R, T > &a, const MatrixXX< C, R, T > &b)
void SubCube(unsigned int box, AACube< Point > *cube) const
std::vector< Point > Points
void Bound(const Points &points, size_t size)
void BoundNonCentered(IteratorT begin, IteratorT end)
ScalarType DiagLength() const
void Center(Point *c) const
void DividingPlane(unsigned int axis, Point *n, ScalarType *d) const
void BoundRotationInvariant(const Points &points, size_t size)
void Translate(const PointType &t)
Point operator[](int index) const
bool IsInside(const Point &p) const
const Point & Min() const
double v(double t, double v0, double a0, double j)
bool IsSubCube(unsigned int *box, const AACube< Point > &cube) const
ScalarType Distance(const PointType &p) const
Point::ScalarType ScalarType
ScalarType SqrDistance(const PointType &p) const
double s(double t, double s0, double v0, double a0, double j)
void Inflate(ScalarType v)