File: Interval.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 (19 lines) | stat: -rw-r--r-- 332 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
#include <Imath/ImathInterval.h>
#include <cassert>

void
interval_example()
{
    Imath::Intervalf v;

    assert (v.isEmpty());
    assert (!v.hasVolume());
    assert (!v.isInfinite());

    v.extendBy (1.0f);
    assert (!v.isEmpty());
    
    v.extendBy (2.0f);
    assert (v.hasVolume());
    assert (v.intersects (1.5f));
}