| 1 | #include <Imath/ImathBox.h> |
| 2 | |
| 3 | void |
| 4 | box_example () |
| 5 | { |
| 6 | Imath::V3f a (0, 0, 0); |
| 7 | Imath::V3f b (1, 1, 1); |
| 8 | Imath::V3f c (2, 9, 2); |
| 9 | |
| 10 | Imath::Box3f box (a); |
| 11 | |
| 12 | assert (box.isEmpty ()); |
| 13 | assert (!box.isInfinite ()); |
| 14 | assert (!box.hasVolume ()); |
| 15 | |
| 16 | box.extendBy (c); |
| 17 | |
| 18 | assert (box.size () == (c - a)); |
| 19 | assert (box.intersects (b)); |
| 20 | assert (box.max[0] > box.min[0]); |
| 21 | assert (box.max[1] > box.min[1]); |
| 22 | assert (box.max[2] > box.min[2]); |
| 23 | assert (box.hasVolume ()); |
| 24 | assert (box.majorAxis () == 1); |
| 25 | } |