SbTime(3IV)NAMESbTime (SbTime) - class for representation of a time
INHERITS FROMSbTimeSYNOPSIS
#include <Inventor_c/SbTime.h>
Functions from class SbTime:
SbTime * SbTimeCreate()SbTime * SbTimeCreateSec(double sec)
SbTime * SbTimeCreateSecUSec(int32_t sec, long usec)
SbTime * SbTimeCreateTimeval(const struct timeval *tv)
void SbTimeSbTimeDelete(SbTime *this, SbTime *)
SbTimeSbTimeGetTimeOfDay()
void SbTimeSetToTimeOfDay(SbTime *this)
SbTimeSbTimeZero()SbTimeSbTimeMax()
void SbTimeSetSec(SbTime *this, double sec)
void SbTimeSetSecUSec(SbTime *this, int32_t sec, long
usec)
void SbTimeSetTimeval(SbTime *this, const struct timeval
*tv)
void SbTimeSetMSec(SbTime *this, unsigned long msec)
double SbTimeGetSec(const SbTime *this)
void SbTimeGetSecUSec(const SbTime *this, int32_t *sec,
long *usec)
void SbTimeGetTimeval(const SbTime *this, struct timeval
*tv)
unsigned long SbTimeGetMSec(const SbTime *this)
SbString SbTimeFormat(const SbTime *this, const char *fmt =
"%S.%i")
SbString SbTimeFormatDate(const SbTime *this, const char *fmt
= "%A, %D %r")
SbTime SbTimeAdd(SbTime *this, const SbTime *t0, const
SbTime *t1)
SbTime SbTimeSub(SbTime *this, const SbTime *t0, const
SbTime *t1)
SbTime * SbTimeAddTo(SbTime *this, const SbTime *tm)
SbTime * SbTimeSubFrom(SbTime *this, const SbTime *tm)
SbTime SbTimeNegate(const SbTime *this)
SbTime SbTimeMult(SbTime *this, const SbTime *tm, double s)
SbTime SbTimeDiv(SbTime *this, const SbTime *tm, double s)
SbTime * SbTimeMultBy(SbTime *this, double s)
SbTime * SbTimeDivBy(SbTime *this, double s)
double SbTimeDivByTime(const SbTime *this, const SbTime *tm)
SbTime SbTimeModulo(const SbTime *this, const SbTime *tm)
int SbTimeIsEq(const SbTime *this, const SbTime *tm)
int SbTimeIsNEq(const SbTime *this, const SbTime *tm)
Page 1SbTime(3IV)
SbBool SbTimeIsLT(const SbTime *this, const SbTime *tm)
SbBool SbTimeIsGT(const SbTime *this, const SbTime *tm)
SbBool SbTimeIsLEq(const SbTime *this, const SbTime *tm)
SbBool SbTimeIsGEq(const SbTime *this, const SbTime *tm)
DESCRIPTION
This class represents and performs operations on time. Operations may be
done in seconds, seconds and microseconds, or using a struct timeval
(defined in /usr/include/sys/time.h).
FUNCTIONSSbTime * SbTimeCreate()SbTime * SbTimeCreateSec(double sec)
SbTime * SbTimeCreateSecUSec(int32_t sec, long usec)
SbTime * SbTimeCreateTimeval(const struct timeval *tv)
Constructors taking seconds, seconds and microseconds, or a struct
timeval.
void SbTimeSbTimeDelete(SbTime *this, SbTime *)
Destructor.
SbTimeSbTimeGetTimeOfDay()
Get the current time (seconds since Jan 1, 1970).
void SbTimeSetToTimeOfDay(SbTime *this)
Set to the current time (seconds since Jan 1, 1970).
SbTimeSbTimeZero()
Get a zero time.
SbTimeSbTimeMax()
Get a time far, far into the future.
void SbTimeSetSec(SbTime *this, double sec)
Set time from a double (in seconds).
void SbTimeSetSecUSec(SbTime *this, int32_t sec, long
usec)
Set time from seconds + microseconds.
void SbTimeSetTimeval(SbTime *this, const struct timeval
*tv)
Set time from a struct timeval.
void SbTimeSetMSec(SbTime *this, unsigned long msec)
Set time from milliseconds.
double SbTimeGetSec(const SbTime *this)
Get time in seconds as a double.
Page 2SbTime(3IV)
void SbTimeGetSecUSec(const SbTime *this, int32_t *sec,
long *usec)
Get time in seconds and microseconds.
void SbTimeGetTimeval(const SbTime *this, struct timeval
*tv)
Get time in a struct timeval.
unsigned long SbTimeGetMSec(const SbTime *this)
Get time in milliseconds (for Xt).
SbString SbTimeFormat(const SbTime *this, const char *fmt =
"%S.%i")
Convert to a string. The default format is seconds with 3 digits of
fraction precision. fmt is a character string that consists of field
descriptors and text characters, in a manner analogous to cftime
(3C) and printf (3S). Each field descriptor consists of a %
character followed by another character which specifies the
replacement for the field descriptor. All other characters are
copied from fmt into the result. The following field descriptors are
supported:
% the `%' character
D total number of days
H total number of hours
M total number of minutes
S total number of seconds
I total number of milliseconds
U total number of microseconds
h hours remaining after the days (00-23)
m minutes remaining after the hours (00-59)
s seconds remaining after the minutes (00-59)
i milliseconds remaining after the seconds (000-999)
u microseconds remaining after the seconds (000000-999999)
The uppercase descriptors are formatted with a leading `-' for
negative times; the lowercase descriptors are formatted fixed width,
with leading zeros. For example, a reasonable format string might be
"elapsed time: %M minutes, %s seconds". The default value of fmt,
"%S.%i", formats the time as seconds with 3 digits of fractional
precision.
SbString SbTimeFormatDate(const SbTime *this, const char *fmt
= "%A, %D %r")
Convert to a date string, interpreting the time as seconds since Jan
1, 1970. The default format gives "Tuesday, 01/26/93 11:23:41 AM".
See the cftime() reference page for explanation of the format
string.
SbTime SbTimeAdd(SbTime *this, const SbTime *t0, const
SbTime *t1)
Page 3SbTime(3IV)SbTime SbTimeSub(SbTime *this, const SbTime *t0, const
SbTime *t1)
Addition and subtraction of two times.
SbTime * SbTimeAddTo(SbTime *this, const SbTime *tm)
SbTime * SbTimeSubFrom(SbTime *this, const SbTime *tm)
Addition and subtraction of two times which modifies the time
structure.
SbTime SbTimeNegate(const SbTime *this)
Unary negation.
SbTime SbTimeMult(SbTime *this, const SbTime *tm, double s)
SbTime SbTimeDiv(SbTime *this, const SbTime *tm, double s)
Multiplication and division by scalar.
SbTime * SbTimeMultBy(SbTime *this, double s)
SbTime * SbTimeDivBy(SbTime *this, double s)
Destructive multiplication and division by scalar.
double SbTimeDivByTime(const SbTime *this, const SbTime *tm)
Division by another time.
SbTime SbTimeModulo(const SbTime *this, const SbTime *tm)
Modulus for two times (remainder when time1 is divided by time2).
int SbTimeIsEq(const SbTime *this, const SbTime *tm)
int SbTimeIsNEq(const SbTime *this, const SbTime *tm)
Equality operators.
SbBool SbTimeIsLT(const SbTime *this, const SbTime *tm)
SbBool SbTimeIsGT(const SbTime *this, const SbTime *tm)
SbBool SbTimeIsLEq(const SbTime *this, const SbTime *tm)
SbBool SbTimeIsGEq(const SbTime *this, const SbTime *tm)
Relational operators.
FILE FORMAT/DEFAULTS
Time {
}
SEE ALSO
cftime
Page 4