Detailed Description
- See also:
- Advanced Topics sections on Intervals and Time.
- Description:
- An Interval is a
class that represents a length of time. It has two private data
members, start and end that are each TimeValues. A TimeValue is a
single instant in time. For more explanation see the Advanced
Topics section on Intervals. All the methods of this
class are implemented by the system.
Definitions:
#define FOREVER Interval(TIME_NegInfinity,
TIME_PosInfinity)
#define NEVER Interval(TIME_NegInfinity,
TIME_NegInfinity)
#include <interval.h>
List of all
members.
Constructor & Destructor Documentation
CoreExport Interval |
( |
TimeValue |
s, |
|
|
TimeValue |
e |
|
) |
|
|
- Parameters:
- TimeValue s
Specifies the start time.
TimeValue e
Specifies the end time.
Member Function Documentation
int operator== |
( |
const Interval & |
i |
) |
[inline] |
- Returns:
- Nonzero if the intervals are equal; otherwise 0.
{ return( i.start==start && i.end==end ); }
CoreExport int InInterval |
( |
const TimeValue |
t |
) |
const |
- Parameters:
- const TimeValue t
- Returns:
- Nonzero if the TimeValue passed is greater than or equal to the
start value and less than or equal to the end value and not equal
to TIME_NegInfinity; otherwise 0.
int InInterval |
( |
const Interval |
interval |
) |
const [inline] |
- Parameters:
- const Interval
interval
The interval to check.
- Returns:
- Returns nonzero if the interval passed is contained within the
interval; otherwise 0.
{ return (start == TIME_NegInfinity) && (end == TIME_NegInfinity); }
void Set |
( |
TimeValue |
s, |
|
|
TimeValue |
e |
|
) |
|
[inline] |
- Parameters:
- TimeValue s
Start time for the interval.
TimeValue e
End time for the interval.
void SetStart |
( |
TimeValue |
s |
) |
[inline] |
- Parameters:
- TimeValue s
Start time for the interval.
void SetEnd |
( |
TimeValue |
e |
) |
[inline] |
- Parameters:
- TimeValue e
End time for the interval.
void SetEmpty |
( |
|
) |
[inline] |
{ start = TIME_NegInfinity; end = TIME_NegInfinity; }
void SetInfinite |
( |
|
) |
[inline] |
{ start = TIME_NegInfinity; end = TIME_PosInfinity; }
void SetInstant |
( |
const TimeValue |
t |
) |
[inline] |
TimeValue Start |
( |
|
) |
const [inline] |
TimeValue End |
( |
|
) |
const [inline] |
TimeValue Duration |
( |
|
) |
const [inline] |
- Operators:
{ return end-start+TimeValue(1); }
- Returns:
- An Interval that
is the intersection of the intervals.
{ return (*this = (*this&i)); }
Interval& operator+= |
( |
const TimeValue |
t |
) |
[inline] |
{ if (t<start) start=t; if (t>end) end=t; return *this; }
Interval Interval Interval Interval
Interval Interval Interval Interval Interval Interval
Interval Interval Interval Interval
Interval Interval Interval Interval Interval Interval