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 \
43 ((resetXformStack, "!resetXformStack!"))
248 template <
typename T>
251 if (!
Get(&v, time)) {
258 "requested type %s.",
GetAttr().GetPath().GetText(),
279 bool isInverseOp=
false);
300 return std::visit(_GetMightBeTimeVarying(), _attr);
314 return std::visit(_GetAttr(), _attr);
327 explicit operator bool()
const {
342 return !(lhs == rhs);
364 template <
typename T>
366 return std::visit(_Get<T>(value, time), _attr);
375 template <
typename T>
381 "Please set value on the paired non-inverse xformOp instead.",
392 return std::visit(_GetTimeSamples(times), _attr);
398 std::vector<double> *times)
const {
400 _GetTimeSamplesInInterval(interval, times), _attr);
405 return std::visit(_GetNumTimeSamples(), _attr);
409 struct _ValidAttributeTagType {};
416 _ValidAttributeTagType);
419 _ValidAttributeTagType);
427 static Type _GetOpTypeEnumFromCString(
char const *str,
size_t len);
437 const TfToken &opName,
bool *isInverseOp);
441 void _CreateAttributeQuery()
const {
473 mutable std::variant<UsdAttribute, UsdAttributeQuery> _attr;
488 return attr.
Get(value, time);
493 return attrQuery.
Get(value, time);
517 struct _GetTimeSamples {
519 _GetTimeSamples(std::vector<double> *times_) : times(times_) {}
531 std::vector<double> *times;
535 struct _GetTimeSamplesInInterval {
537 _GetTimeSamplesInInterval(
const GfInterval &interval_,
538 std::vector<double> *times_)
539 : interval(interval_), times(times_)
553 std::vector<double> *times;
557 struct _GetNumTimeSamples {
559 _GetNumTimeSamples() {}
573 struct _GetMightBeTimeVarying {
575 _GetMightBeTimeVarying() {}
592PXR_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.