7#ifndef PXR_USD_USD_GEOM_XFORM_OP_H
8#define PXR_USD_USD_GEOM_XFORM_OP_H
13#include "pxr/usd/usdGeom/api.h"
14#include "pxr/usd/usd/attribute.h"
15#include "pxr/usd/usd/attributeQuery.h"
25PXR_NAMESPACE_OPEN_SCOPE
29#define USDGEOM_XFORM_OP_TYPES \
49 ((resetXformStack, "!resetXformStack!"))
268 template <
typename T>
271 if (!
Get(&v, time)) {
278 "requested type %s.",
GetAttr().GetPath().GetText(),
299 bool isInverseOp=
false);
320 return std::visit(_GetMightBeTimeVarying(), _attr);
334 return std::visit(_GetAttr(), _attr);
347 explicit operator bool()
const {
362 return !(lhs == rhs);
384 template <
typename T>
386 return std::visit(_Get<T>(value, time), _attr);
395 template <
typename T>
401 "Please set value on the paired non-inverse xformOp instead.",
412 return std::visit(_GetTimeSamples(times), _attr);
418 std::vector<double> *times)
const {
420 _GetTimeSamplesInInterval(interval, times), _attr);
425 return std::visit(_GetNumTimeSamples(), _attr);
429 struct _ValidAttributeTagType {};
436 _ValidAttributeTagType);
439 _ValidAttributeTagType);
447 static Type _GetOpTypeEnumFromCString(
char const *str,
size_t len);
457 const TfToken &opName,
bool *isInverseOp);
461 void _CreateAttributeQuery()
const {
493 mutable std::variant<UsdAttribute, UsdAttributeQuery> _attr;
508 return attr.
Get(value, time);
513 return attrQuery.
Get(value, time);
537 struct _GetTimeSamples {
539 _GetTimeSamples(std::vector<double> *times_) : times(times_) {}
551 std::vector<double> *times;
555 struct _GetTimeSamplesInInterval {
557 _GetTimeSamplesInInterval(
const GfInterval &interval_,
558 std::vector<double> *times_)
559 : interval(interval_), times(times_)
573 std::vector<double> *times;
577 struct _GetNumTimeSamples {
579 _GetNumTimeSamples() {}
593 struct _GetMightBeTimeVarying {
595 _GetMightBeTimeVarying() {}
612PXR_NAMESPACE_CLOSE_SCOPE
A basic mathematical interval class.
Stores a 4x4 matrix of double elements.
Represents a value type name, i.e.
SDF_API const TfType & GetType() const
Returns the TfType of the type.
Token for efficient comparison, assignment, and hashing of known strings.
TfType represents a dynamic runtime type.
TF_API const std::string & GetTypeName() const
Return the machine-independent name for this type.
static TF_API std::string GetCanonicalTypeName(const std::type_info &)
Return the canonical typeName used for a given std::type_info.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
USD_API bool GetTimeSamples(std::vector< double > *times) const
Populates a vector with authored sample times.
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Populates a vector with authored sample times in interval.
bool Set(const T &value, UsdTimeCode time=UsdTimeCode::Default()) const
Set the value of this attribute in the current UsdEditTarget to value at UsdTimeCode time,...
USD_API SdfValueTypeName GetTypeName() const
Return the "scene description" value type name for this attribute.
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Perform value resolution to fetch the value of this attribute at the requested UsdTimeCode time,...
USD_API size_t GetNumTimeSamples() const
Returns the number of time samples that have been authored.
USD_API bool ValueMightBeTimeVarying() const
Return true if it is possible, but not certain, that this attribute's value changes over time,...
Object for efficiently making repeated queries for attribute values.
USD_API bool GetTimeSamples(std::vector< double > *times) const
Populates a vector with authored sample times.
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Populates a vector with authored sample times in interval.
USD_API const UsdAttribute & GetAttribute() const
Return the attribute associated with this query.
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...
USD_API size_t GetNumTimeSamples() const
Returns the number of time samples that have been authored.
USD_API bool ValueMightBeTimeVarying() const
Return true if it is possible, but not certain, that this attribute's value changes over time,...
const TfToken & GetName() const
Return the full name of this object, i.e.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
USD_API TfToken GetBaseName() const
Return this property's name with all namespace prefixes removed, i.e.
USD_API TfToken GetNamespace() const
Return this property's complete namespace prefix.
USD_API std::vector< std::string > SplitName() const
Return this property's name elements including namespaces and its base name as the final element.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
bool IsEmpty() const
Returns true iff this value is empty.
static VtValue Cast(VtValue const &val)
Return a VtValue holding val cast to hold T.
T const & UncheckedGet() const &
Returns a const reference to the held object if the held object is of type T.
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.