Go to the documentation of this file. 1 #ifndef __AACUBE_HEADER__
2 #define __AACUBE_HEADER__
10 template<
class Po
int >
27 template<
class Po
ints >
29 template<
class IteratorT >
30 void Bound(IteratorT begin, IteratorT end);
31 template<
class IteratorT >
33 template<
class Po
ints >
57 return _backBottomLeft;
61 return _backBottomLeft;
65 Point m(_backBottomLeft);
66 for (
unsigned int i = 0; i <
Dim; ++i)
74 Point _backBottomLeft;
78 template<
class Po
int >
79 template<
class Po
ints >
86 for (
unsigned int u = 0; u < Dim; ++u)
88 pmax[u] = pmin[u] = points[0][u];
90 for (
size_t i = 1; i < size; ++i)
92 for (
unsigned int j = 0; j < Dim; ++j)
94 if (pmin[j] > points[i][j])
96 pmin[j] = points[i][j];
98 else if (pmax[j] < points[i][j])
100 pmax[j] = points[i][j];
104 Point center = pmin +
106 Point r = pmax - center;
108 for (
unsigned int u = 1; u < Dim; ++u)
113 _backBottomLeft = center;
114 for (
unsigned int u = 0; u < Dim; ++u)
116 _backBottomLeft[u] -= rmax;
122 template<
class Po
int >
123 template<
class IteratorT >
130 for (
unsigned int u = 0; u < Dim; ++u)
132 pmax[u] = pmin[u] = (*begin)[u];
135 for (++i; i != end; ++i)
137 for (
unsigned int j = 0; j < Dim; ++j)
139 if (pmin[j] > (*i)[j])
143 else if (pmax[j] < (*i)[j])
149 Point center = pmin +
151 Point r = pmax - center;
153 for (
unsigned int u = 1; u < Dim; ++u)
158 _backBottomLeft = center;
159 for (
unsigned int u = 0; u < Dim; ++u)
161 _backBottomLeft[u] -= rmax;
167 template<
class Po
int >
168 template<
class IteratorT >
176 for (
unsigned int u = 0; u < Dim; ++u)
178 pmax[u] = pmin[u] = (*begin)[u];
181 for (++i; i != end; ++i)
183 for (
unsigned int j = 0; j < Dim; ++j)
185 if (pmin[j] > (*i)[j])
189 else if (pmax[j] < (*i)[j])
195 _backBottomLeft = pmin;
196 _width = pmax[0] - pmin[0];
197 for (
unsigned int i = 1; i < Dim; ++i)
199 _width =
max(_width, pmax[i] - pmin[i]);
204 template<
class Po
int >
205 template<
class Po
ints >
213 pmax = pmin = points[0];
214 for (
size_t i = 1; i < size; ++i)
216 for (
unsigned int j = 0; j < Dim; ++j)
218 if (pmin[j] > points[i][j])
220 pmin[j] = points[i][j];
222 else if (pmax[j] < points[i][j])
224 pmax[j] = points[i][j];
228 _width = (pmax - pmin).Length();
230 _backBottomLeft = center;
231 for (
unsigned int u = 0; u < Dim; ++u)
233 _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)