24 #ifndef PXR_USD_USD_GEOM_XFORM_OP_H 25 #define PXR_USD_USD_GEOM_XFORM_OP_H 30 #include "pxr/usd/usdGeom/api.h" 31 #include "pxr/usd/usd/attribute.h" 32 #include "pxr/usd/usd/attributeQuery.h" 39 #include <boost/variant.hpp> 43 PXR_NAMESPACE_OPEN_SCOPE
47 #define USDGEOM_XFORM_OP_TYPES \ 61 ((resetXformStack, "!resetXformStack!")) 266 template <
typename T>
269 if (!
Get(&v, time)) {
276 "requested type %s.",
GetAttr().GetPath().GetText(),
297 bool isInverseOp=
false);
318 return boost::apply_visitor(_GetMightBeTimeVarying(), _attr);
332 return boost::apply_visitor(_GetAttr(), _attr);
345 explicit operator bool()
const {
360 return !(lhs == rhs);
382 template <
typename T>
384 return boost::apply_visitor(_Get<T>(value, time), _attr);
393 template <
typename T>
399 "Please set value on the paired non-inverse xformOp instead.",
410 return boost::apply_visitor(_GetTimeSamples(times), _attr);
416 std::vector<double> *times)
const {
417 return boost::apply_visitor(
418 _GetTimeSamplesInInterval(interval, times), _attr);
423 return boost::apply_visitor(_GetNumTimeSamples(), _attr);
427 struct _ValidAttributeTagType {};
434 _ValidAttributeTagType);
437 _ValidAttributeTagType);
445 static Type _GetOpTypeEnumFromCString(
char const *str,
size_t len);
455 const TfToken &opName,
bool *isInverseOp);
459 void _CreateAttributeQuery()
const {
491 mutable boost::variant<UsdAttribute, UsdAttributeQuery> _attr;
498 struct _Get :
public boost::static_visitor<bool>
506 return attr.
Get(value, time);
511 return attrQuery.
Get(value, time);
519 struct _GetAttr :
public boost::static_visitor<const UsdAttribute &> {
535 struct _GetTimeSamples :
public boost::static_visitor<bool> {
537 _GetTimeSamples(std::vector<double> *times_) : times(times_) {}
549 std::vector<double> *times;
553 struct _GetTimeSamplesInInterval :
public boost::static_visitor<bool> {
555 _GetTimeSamplesInInterval(
const GfInterval &interval_,
556 std::vector<double> *times_)
557 : interval(interval_), times(times_)
571 std::vector<double> *times;
575 struct _GetNumTimeSamples :
public boost::static_visitor<size_t> {
577 _GetNumTimeSamples() {}
591 struct _GetMightBeTimeVarying :
public boost::static_visitor<bool> {
593 _GetMightBeTimeVarying() {}
610 PXR_NAMESPACE_CLOSE_SCOPE
612 #endif // USD_XFORMOP_H
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Perform value resolution to fetch the value of this attribute at the requested UsdTimeCode time,...
T const & UncheckedGet() const &
Returns a const reference to the held object if the held object is of type T.
Object for efficiently making repeated queries for attribute values.
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
USD_API bool GetTimeSamples(std::vector< double > *times) const
Populates a vector with authored sample times.
Represents a value type name, i.e.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
USD_API size_t GetNumTimeSamples() const
Returns the number of time samples that have been authored.
TF_API const std::string & GetTypeName() const
Return the machine-independent name for this type.
USD_API const UsdAttribute & GetAttribute() const
Return the attribute associated with this query.
Token for efficient comparison, assignment, and hashing of known strings.
static TF_API std::string GetCanonicalTypeName(const std::type_info &)
Return the canonical typeName used for a given std::type_info.
Stores a 4x4 matrix of double elements.
bool IsEmpty() const
Returns true iff this value is empty.
USD_API bool ValueMightBeTimeVarying() const
Return true if it is possible, but not certain, that this attribute's value changes over time,...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
USD_API std::vector< std::string > SplitName() const
Return this property's name elements including namespaces and its base name as the final element.
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Populates a vector with authored sample times in interval.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
A basic mathematical interval class.
static VtValue Cast(VtValue const &val)
Return a VtValue holding val cast to hold T.
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 bool GetTimeSamples(std::vector< double > *times) const
Populates a vector with authored sample times.
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 bool ValueMightBeTimeVarying() const
Return true if it is possible, but not certain, that this attribute's value changes over time,...
This file defines some macros that are useful for declaring and using static TfTokens.
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
USD_API size_t GetNumTimeSamples() const
Returns the number of time samples that have been authored.
const TfToken & GetName() const
Return the full name of this object, i.e.
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Populates a vector with authored sample times in interval.
TfType represents a dynamic runtime type.
USD_API SdfValueTypeName GetTypeName() const
Return the "scene description" value type name for this attribute.
USD_API TfToken GetBaseName() const
Return this property's name with all namespace prefixes removed, i.e.
SDF_API const TfType & GetType() const
Returns the TfType of the type.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
USD_API TfToken GetNamespace() const
Return this property's complete namespace prefix.