36 #ifndef INCLUDED_IMATHBOX_H 37 #define INCLUDED_IMATHBOX_H 88 Box (
const T &minT,
const T &maxT);
170 return (min == src.
min && max == src.
max);
178 return (min != src.
min || max != src.
max);
185 min = T(T::baseTypeMax());
186 max = T(T::baseTypeMin());
194 for (
unsigned int i = 0; i < min.dimensions(); i++)
196 if (point[i] < min[i])
199 if (point[i] > max[i])
209 for (
unsigned int i = 0; i < min.dimensions(); i++)
211 if (box.
min[i] < min[i])
214 if (box.
max[i] > max[i])
224 for (
unsigned int i = 0; i < min.dimensions(); i++)
226 if (point[i] < min[i] || point[i] > max[i])
238 for (
unsigned int i = 0; i < min.dimensions(); i++)
240 if (box.
max[i] < min[i] || box.
min[i] > max[i])
263 return (max + min) / 2;
271 for (
unsigned int i = 0; i < min.dimensions(); i++)
285 for (
unsigned int i = 0; i < min.dimensions(); i++)
287 if (max[i] <= min[i])
299 unsigned int major = 0;
302 for (
unsigned int i = 1; i < min.dimensions(); i++)
317 template <
typename T>
class Box;
404 return (min == src.min && max == src.max);
412 return (min != src.min || max != src.max);
428 if (point[0] < min[0])
431 if (point[0] > max[0])
434 if (point[1] < min[1])
437 if (point[1] > max[1])
446 if (box.min[0] < min[0])
449 if (box.max[0] > max[0])
452 if (box.min[1] < min[1])
455 if (box.max[1] > max[1])
464 if (point[0] < min[0] || point[0] > max[0] ||
465 point[1] < min[1] || point[1] > max[1])
476 if (box.max[0] < min[0] || box.min[0] > max[0] ||
477 box.max[1] < min[1] || box.min[1] > max[1])
499 return (max + min) / 2;
507 if (max[0] < min[0] ||
519 if (max[0] <= min[0] ||
531 unsigned int major = 0;
627 return (min == src.min && max == src.max);
635 return (min != src.min || max != src.max);
651 if (point[0] < min[0])
654 if (point[0] > max[0])
657 if (point[1] < min[1])
660 if (point[1] > max[1])
663 if (point[2] < min[2])
666 if (point[2] > max[2])
675 if (box.min[0] < min[0])
678 if (box.max[0] > max[0])
681 if (box.min[1] < min[1])
684 if (box.max[1] > max[1])
687 if (box.min[2] < min[2])
690 if (box.max[2] > max[2])
699 if (point[0] < min[0] || point[0] > max[0] ||
700 point[1] < min[1] || point[1] > max[1] ||
701 point[2] < min[2] || point[2] > max[2])
712 if (box.max[0] < min[0] || box.min[0] > max[0] ||
713 box.max[1] < min[1] || box.min[1] > max[1] ||
714 box.max[2] < min[2] || box.min[2] > max[2])
736 return (max + min) / 2;
744 if (max[0] < min[0] ||
757 if (max[0] <= min[0] ||
770 unsigned int major = 0;
bool intersects(const T &point) const
Definition: ImathBox.h:222
Definition: ImathBox.h:71
bool operator==(const Box< T > &src) const
Definition: ImathBox.h:168
Definition: ImathFrame.h:42
void makeEmpty()
Definition: ImathBox.h:183
Vec2< T > min
Definition: ImathBox.h:328
T max
Definition: ImathBox.h:80
Box< V2s > Box2s
Definition: ImathBox.h:129
Box< V3i > Box3i
Definition: ImathBox.h:134
bool operator!=(const Box< T > &src) const
Definition: ImathBox.h:176
T center() const
Definition: ImathBox.h:261
bool hasVolume() const
Definition: ImathBox.h:283
Box< V3d > Box3d
Definition: ImathBox.h:136
Box< V2d > Box2d
Definition: ImathBox.h:132
Box()
Definition: ImathBox.h:144
bool intersects(const Box< Vec3< T > > &b, const Line3< T > &r, Vec3< T > &ip)
Definition: ImathBoxAlgo.h:582
void extendBy(const T &point)
Definition: ImathBox.h:192
T size() const
Definition: ImathBox.h:250
static T baseTypeMin()
Definition: ImathVec.h:458
Vec3< T > max
Definition: ImathBox.h:551
Definition: ImathVec.h:61
static T baseTypeMax()
Definition: ImathVec.h:247
Vec2< T > max
Definition: ImathBox.h:329
T min
Definition: ImathBox.h:79
bool isEmpty() const
Definition: ImathBox.h:269
Box< V2i > Box2i
Definition: ImathBox.h:130
Box< V2f > Box2f
Definition: ImathBox.h:131
Vec3< T > min
Definition: ImathBox.h:550
Definition: ImathBox.h:67
unsigned int majorAxis() const
Definition: ImathBox.h:297
Box< V3f > Box3f
Definition: ImathBox.h:135
static T baseTypeMax()
Definition: ImathVec.h:459
Box< V3s > Box3s
Definition: ImathBox.h:133
static T baseTypeMin()
Definition: ImathVec.h:246