24 #ifndef PXR_USD_USD_ATTRIBUTE_QUERY_H
25 #define PXR_USD_USD_ATTRIBUTE_QUERY_H
28 #include "pxr/usd/usd/api.h"
29 #include "pxr/usd/usd/attribute.h"
33 #include "pxr/usd/usd/timeCode.h"
39 PXR_NAMESPACE_OPEN_SCOPE
107 explicit operator bool()
const {
123 template <
typename T>
125 static_assert(SdfValueTypeTraits<T>::IsValueType,
126 "T must be an SdfValueType.");
127 return _Get(value, time);
149 std::vector<double>* times)
const;
165 const std::vector<UsdAttributeQuery> &attrQueries,
166 std::vector<double> *times);
181 const std::vector<UsdAttributeQuery> &attrQueries,
183 std::vector<double> *times);
199 bool* hasTimeSamples)
const;
247 template <
typename T>
256 PXR_NAMESPACE_CLOSE_SCOPE
258 #endif // PXR_USD_USD_ATTRIBUTE_QUERY_H
USD_API size_t GetNumTimeSamples() const
Returns the number of time samples that have been authored.
USD_API UsdAttributeQuery()
Construct an invalid query object.
bool IsValid() const
Return true if this is a valid object, false otherwise.
USD_API bool HasFallbackValue() const
Return true if the attribute associated with this query has a fallback value provided by a registered...
Object for efficiently making repeated queries for attribute values.
static USD_API bool GetUnionedTimeSamplesInInterval(const std::vector< UsdAttributeQuery > &attrQueries, const GfInterval &interval, std::vector< double > *times)
Populates the given vector, times with the union of all the authored sample times in the GfInterval...
USD_API bool ValueMightBeTimeVarying() const
Return true if it is possible, but not certain, that this attribute's value changes over time...
Container for information about the source of an attribute's value, i.e.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
USD_API bool HasValue() const
Return true if the attribute associated with this query has an authored default value, authored time samples or a fallback value provided by a registered schema.
USD_API bool GetTimeSamples(std::vector< double > *times) const
Populates a vector with authored sample times.
bool IsValid() const
Return true if this query is valid (i.e.
Token for efficient comparison, assignment, and hashing of known strings.
static USD_API std::vector< UsdAttributeQuery > CreateQueries(const UsdPrim &prim, const TfTokenVector &attrNames)
Construct new queries for the attributes named in attrNames under the prim prim.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
USD_API bool HasAuthoredValueOpinion() const
USD_API bool GetBracketingTimeSamples(double desiredTime, double *lower, double *upper, bool *hasTimeSamples) const
Populate lower and upper with the next greater and lesser value relative to the desiredTime.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
std::vector< TfToken > TfTokenVector
Convenience types.
A basic mathematical interval class.
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Perform value resolution to fetch the value of the attribute associated with this query at the reques...
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Populates a vector with authored sample times in interval.
USD_API bool HasAuthoredValue() const
Return true if this attribute has either an authored default value or authored time samples...
USD_API const UsdAttribute & GetAttribute() const
Return the attribute associated with this query.
static USD_API bool GetUnionedTimeSamples(const std::vector< UsdAttributeQuery > &attrQueries, std::vector< double > *times)
Populates the given vector, times with the union of all the authored sample times on all of the given...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...