HDK
|
#include <timeCode.h>
Public Member Functions | |
constexpr | UsdTimeCode (double t=0.0) noexcept |
Construct with optional time value. Impilicitly convert from double. More... | |
constexpr | UsdTimeCode (const SdfTimeCode &timeCode) noexcept |
Construct and implicitly cast from SdfTimeCode. More... | |
bool | IsEarliestTime () const |
bool | IsDefault () const |
bool | IsNumeric () const |
double | GetValue () const |
Static Public Member Functions | |
static constexpr UsdTimeCode | EarliestTime () |
static constexpr UsdTimeCode | Default () |
static constexpr double | SafeStep (double maxValue=1e6, double maxCompression=10.0) |
Friends | |
bool | operator== (const UsdTimeCode &lhs, const UsdTimeCode &rhs) |
Equality comparison. More... | |
bool | operator!= (const UsdTimeCode &lhs, const UsdTimeCode &rhs) |
Inequality comparison. More... | |
bool | operator< (const UsdTimeCode &lhs, const UsdTimeCode &rhs) |
bool | operator>= (const UsdTimeCode &lhs, const UsdTimeCode &rhs) |
bool | operator<= (const UsdTimeCode &lhs, const UsdTimeCode &rhs) |
bool | operator> (const UsdTimeCode &lhs, const UsdTimeCode &rhs) |
size_t | hash_value (const UsdTimeCode &time) |
Hash function. More... | |
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdTimeCode::Default().
A UsdTimeCode does not represent an SMPTE timecode, although we may, in future, support conversion functions between the two. Instead, UsdTimeCode is an abstraction that acknowledges that in the principal domains of use for USD, there are many different ways of encoding time, and USD must be able to capture and translate between all of them for interchange, retaining as much intent of the authoring application as possible.
A UsdTimeCode is therefore a unitless, generic time measurement that serves as the ordinate for time-sampled data in USD files. A client of USD relies on the UsdStage (which in turn consults metadata authored in its root layer) to define the mapping of TimeCodes to units like seconds and frames.
As described in Usd_ValueResolution , USD optionally provides an unvarying, 'default' value for every attribute. UsdTimeCode embodies a time value that can either be a floating-point sample time, or the default.
All UsdAttribute and derived API that requires a time parameter defaults to UsdTimeCode::Default() if the parameter is left unspecified, and auto-constructs from a floating-point argument.
UsdTimeCode::EarliestTime() is provided to aid clients who wish to retrieve the first authored timesample for any attribute.
Definition at line 85 of file timeCode.h.
|
inlinenoexcept |
Construct with optional time value. Impilicitly convert from double.
Definition at line 88 of file timeCode.h.
|
inlinenoexcept |
Construct and implicitly cast from SdfTimeCode.
Definition at line 91 of file timeCode.h.
|
inlinestatic |
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition at line 113 of file timeCode.h.
|
inlinestatic |
Produce a UsdTimeCode representing the lowest/earliest possible timeCode. Thus, for any given timeSample s, its time ordinate t will obey: t >= UsdTimeCode::EarliestTime()
This is useful for clients that wish to retrieve the first authored timeSample for an attribute, as they can use UsdTimeCode::EarliestTime() as the time argument to UsdAttribute::Get() and UsdAttribute::GetBracketingTimeSamples()
Definition at line 102 of file timeCode.h.
|
inline |
Return the numeric value for this time. If this time IsDefault(), return a quiet NaN value.
Definition at line 152 of file timeCode.h.
|
inline |
Return true if this time represents the 'default' sentinel value, false otherwise. This is equivalent to !IsNumeric().
Definition at line 140 of file timeCode.h.
|
inline |
Return true if this time represents the lowest/earliest possible timeCode, false otherwise.
Definition at line 134 of file timeCode.h.
|
inline |
Return true if this time represents a numeric value, false otherwise. This is equivalent to !IsDefault().
Definition at line 146 of file timeCode.h.
|
inlinestatic |
Produce a safe step value such that for any numeric UsdTimeCode t in [-maxValue, maxValue], t +/- (step / maxCompression) != t with a safety factor of 2. This is shorthand for std::numeric_limits<double>::epsilon() * maxValue * maxCompression * 2.0. Such a step value is recommended for simulating jump discontinuities in time samples. For example, author value x at time t, and value y at time t + SafeStep(). This ensures that as the sample times are shifted and scaled, t and t + SafeStep() remain distinct so long as they adhere to the maxValue
and maxCompression
limits.
Definition at line 127 of file timeCode.h.
|
friend |
Hash function.
Definition at line 197 of file timeCode.h.
|
friend |
Inequality comparison.
Definition at line 165 of file timeCode.h.
|
friend |
Less-than. Default() times are less than all numeric times, including EarliestTime()
Definition at line 171 of file timeCode.h.
|
friend |
Less-equal. Default() times are less than all numeric times, including EarliestTime().
Definition at line 185 of file timeCode.h.
|
friend |
Equality comparison.
Definition at line 159 of file timeCode.h.
|
friend |
Greater-than. Default() times are less than all numeric times, including EarliestTime().
Definition at line 192 of file timeCode.h.
|
friend |
Greater-equal. Default() times are less than all numeric times, including EarliestTime().
Definition at line 179 of file timeCode.h.