MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / box_example

Function box_example

website/examples/Box.cpp:3–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <Imath/ImathBox.h>
2
3void
4box_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}

Callers

nothing calls this directly

Calls 3

extendByMethod · 0.80
majorAxisMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected