7#ifndef PXR_EXEC_EF_TIME_INTERVAL_H
8#define PXR_EXEC_EF_TIME_INTERVAL_H
14#include "pxr/exec/ef/api.h"
20#include <initializer_list>
25PXR_NAMESPACE_OPEN_SCOPE
41 bool defaultTime =
false) :
42 _timeMultiInterval(timeMultiInterval),
43 _defaultTime(defaultTime)
48 bool defaultTime =
false) :
49 _timeMultiInterval(timeInterval),
50 _defaultTime(defaultTime)
56 const std::vector<double> ×,
57 bool defaultTime =
false) :
58 _defaultTime(defaultTime)
67 const std::initializer_list<double> ×,
68 bool defaultTime =
false) :
69 _defaultTime(defaultTime)
78 _timeMultiInterval.
Clear();
85 return !_defaultTime && _timeMultiInterval.
IsEmpty();
92 return _timeMultiInterval;
113 : _ContainsTime(time);
135 return _defaultTime &&
146 return _timeMultiInterval == rhs._timeMultiInterval &&
147 _defaultTime == rhs._defaultTime;
151 return !(*
this == rhs);
157 _timeMultiInterval.
Add(rhs._timeMultiInterval);
158 _defaultTime |= rhs._defaultTime;
164 _timeMultiInterval.
Add(interval);
181 _timeMultiInterval.Intersect(rhs._timeMultiInterval);
182 _defaultTime &= rhs._defaultTime;
187 if (_timeMultiInterval < rhs._timeMultiInterval)
return true;
188 if (_timeMultiInterval != rhs._timeMultiInterval)
return false;
189 if (_defaultTime != rhs._defaultTime)
return _defaultTime;
203 const GfInterval extension( -leftFrames, +rightFrames,
true,
true);
217 bool _ContainsTime(
const EfTime &time)
const;
231PXR_NAMESPACE_CLOSE_SCOPE
A class that represents a point in time for execution.
const UsdTimeCode GetTimeCode() const
Returns the time code.
A class that represents an interval in EfTime.
static EfTimeInterval GetFullInterval()
Returns the full time interval: (-inf, inf) with the default time.
void operator|=(const GfInterval &interval)
Unions this time interval and the GfInterval interval.
bool Contains(const EfTime &time) const
Returns true if this time interval contains time, with special treatment for the default time and for...
EfTimeInterval & Extend(double leftFrames, double rightFrames)
Extends the interval by the specified number of frames in each direction.
bool Contains(const EfTimeInterval &rhs) const
Returns true if this time interval fully contains the time interval rhs.
bool IsFullInterval() const
Returns true if the time interval is the full interval.
EfTimeInterval(const std::vector< double > ×, bool defaultTime=false)
For convenience, constructs a multiInterval from the discrete times.
bool IsEmpty() const
Returns true if the interval is empty.
void Clear()
Clears the time interval to an empty interval.
bool operator<(const EfTimeInterval &rhs) const
Less-than operator.
void operator|=(const EfTime &time)
Unions this time interval and the EfTime time.
EfTimeInterval(const std::initializer_list< double > ×, bool defaultTime=false)
For convenience, constructs a multiInterval from the discrete times.
void operator&=(const EfTimeInterval &rhs)
Computes the intersection of this and the EfTimeInterval rhs.
EF_API std::string GetAsString() const
Get time interval as string, for debugging.
void operator|=(const EfTimeInterval &rhs)
Unions this time interval and the EfTimeInterval rhs.
const GfMultiInterval & GetTimeMultiInterval() const
Returns the multi interval that represents intervals on the frame timeline.
bool IsDefaultTimeSet() const
Returns true if the interval contains the default time.
A basic mathematical interval class.
GfMultiInterval represents a subset of the real number line as an ordered set of non-intersecting GfI...
GF_API void Add(const GfInterval &i)
Add the given interval to the multi-interval.
GF_API void Clear()
Clear the multi-interval.
GF_API bool Contains(double d) const
Returns true if the multi-interval contains the given value.
GF_API void ArithmeticAdd(const GfInterval &i)
Uses the given interval to extend the multi-interval in the interval arithmetic sense.
GF_API bool IsEmpty() const
Returns true if the multi-interval is empty.
static GfMultiInterval GetFullInterval()
Returns the full interval (-inf, inf).
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
double GetValue() const
Return the numeric value for this time.
bool IsDefault() const
Return true if this time represents the 'default' sentinel value, false otherwise.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].