File: Box.cpp

package info (click to toggle)
imath 3.1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,468 kB
  • sloc: cpp: 44,687; ansic: 171; sh: 153; python: 60; makefile: 32
file content (25 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <Imath/ImathBox.h>
        
void
box_example()
{
    Imath::V3f   a (0, 0, 0);
    Imath::V3f   b (1, 1, 1);
    Imath::V3f   c (2, 9, 2);

    Imath::Box3f box (a);

    assert (box.isEmpty());
    assert (!box.isInfinite());
    assert (!box.hasVolume());
    
    box.extendBy (c);

    assert (box.size() == (c-a));
    assert (box.intersects (b));
    assert (box.max[0] > box.min[0]);
    assert (box.max[1] > box.min[1]);
    assert (box.max[2] > box.min[2]);
    assert (box.hasVolume());
    assert (box.majorAxis() == 1);
}