HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xformOp.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_USD_GEOM_XFORM_OP_H
8 #define PXR_USD_USD_GEOM_XFORM_OP_H
9 
10 /// \file usdGeom/xformOp.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdGeom/api.h"
14 #include "pxr/usd/usd/attribute.h"
16 #include "pxr/usd/usdGeom/tokens.h"
17 
18 #include <string>
19 #include <variant>
20 #include <vector>
21 #include <typeinfo>
22 
24 
26 
27 
28 /// \hideinitializer
29 #define USDGEOM_XFORM_OP_TYPES \
30  (translateX) \
31  (translateY) \
32  (translateZ) \
33  (translate) \
34  (scaleX) \
35  (scaleY) \
36  (scaleZ) \
37  (scale) \
38  (rotateX) \
39  (rotateY) \
40  (rotateZ) \
41  (rotateXYZ) \
42  (rotateXZY) \
43  (rotateYXZ) \
44  (rotateYZX) \
45  (rotateZXY) \
46  (rotateZYX) \
47  (orient) \
48  (transform) \
49  ((resetXformStack, "!resetXformStack!"))
50 
51 /// \anchor UsdGeomXformOpTypes
52 /// Provides TfToken's for use in conjunction with UsdGeomXformable::Add
53 /// XformOp() and UsdGeomXformOp::GetOpType(), to establish op type.
54 ///
55 /// The component operation names and their meanings are:
56 /// \li <b>translateX</b> - translation along the X axis
57 /// \li <b>translateY</b> - translation along the Y axis
58 /// \li <b>translateZ</b> - translation along the Z axis
59 /// \li <b>translate</b> - XYZ translation
60 /// \li <b>scaleX</b> - scale along the X axis
61 /// \li <b>scaleY</b> - scale along the Y axis
62 /// \li <b>scaleZ</b> - scale along the Z axis
63 /// \li <b>scale</b> - XYZ scale
64 /// \li <b>rotateX</b> - rotation about the X axis, <b>in degrees</b>
65 /// \li <b>rotateY</b> - rotation about the Y axis, <b>in degrees</b>
66 /// \li <b>rotateZ</b> - rotation about the Z axis, <b>in degrees</b>
67 /// \li <b>rotateXYZ, rotateXZY, rotateYXZ, rotateYZX, rotateZXY, rotateZYX</b>
68 /// - a set of three canonical Euler rotations, packed into a single
69 /// Vec3, for conciseness and efficiency of reading. The \\em first
70 /// axis named is the most local, so a single rotateXYZ is equivalent to
71 /// the ordered ops "rotateZ rotateY rotateX". See also
72 /// \ref usdGeom_rotationPackingOrder "note on rotation packing order."
73 /// \li <b>orient</b> - arbitrary axis/angle rotation, expressed as a quaternion
74 /// \li <b>transform</b> - 4x4 matrix transformation
75 /// \li <b>resetXformStack</b> - when appearing as the first op, instructs
76 /// client that the transform stack should be cleared of any inherited
77 /// transformation prior to processing the rest of the prims ops. It is
78 /// an error for resetXformStack to appear anywhere other than as the
79 /// first element in \em xformOpOrder.
81 
82 /// \class UsdGeomXformOp
83 ///
84 /// Schema wrapper for UsdAttribute for authoring and computing
85 /// transformation operations, as consumed by UsdGeomXformable schema.
86 ///
87 /// The semantics of an op are determined primarily by its name, which allows
88 /// us to decode an op very efficiently. All ops are independent attributes,
89 /// which must live in the "xformOp" property namespace. The op's primary name
90 /// within the namespace must be one of \ref UsdGeomXformOpTypes, which
91 /// determines the type of transformation operation, and its secondary name
92 /// (or suffix) within the namespace (which is not required to exist), can be
93 /// any name that distinguishes it from other ops of the same type. Suffixes
94 /// are generally imposed by higher level xform API schemas.
95 ///
96 /// \anchor usdGeom_rotationPackingOrder
97 /// \note
98 /// <b>On packing order of rotateABC triples</b><br>
99 /// The order in which the axis rotations are recorded in a Vec3* for the
100 /// six \em rotateABC Euler triples <b>is always the same:</b> vec[0] = X,
101 /// vec[1] = Y, vec[2] = Z . The \em A, \em B, \em C in the op name dictate
102 /// the order in which their corresponding elements are consumed by the
103 /// rotation, not how they are laid out.
104 ///
106 {
107 public:
108 
109  /// Enumerates the set of all transformation operation types.
110  enum Type {
111  TypeInvalid, ///< Represents an invalid xformOp.
112  TypeTranslateX,///< Translation along the X-axis.
113  TypeTranslateY,///< Translation along the Y-axis.
114  TypeTranslateZ,///< Translation along the Z-axis.
115  TypeTranslate, ///< XYZ translation.
116  TypeScaleX, ///< Scale along the X-axis.
117  TypeScaleY, ///< Scale along the Y-axis.
118  TypeScaleZ, ///< Scale along the Z-axis.
119  TypeScale, ///< XYZ scale.
120  TypeRotateX, ///< Rotation about the X-axis, <b>in degrees</b>.
121  TypeRotateY, ///< Rotation about the Y-axis, <b>in degrees</b>.
122  TypeRotateZ, ///< Rotation about the Z-axis, <b>in degrees</b>.
123  TypeRotateXYZ, ///< Set of 3 canonical Euler rotations
124  /// \ref usdGeom_rotationPackingOrder "in XYZ order"
125  TypeRotateXZY, ///< Set of 3 canonical Euler rotations
126  /// \ref usdGeom_rotationPackingOrder "in XZY order"
127  TypeRotateYXZ, ///< Set of 3 canonical Euler rotations
128  /// \ref usdGeom_rotationPackingOrder "in YXZ order"
129  TypeRotateYZX, ///< Set of 3 canonical Euler rotations
130  /// \ref usdGeom_rotationPackingOrder "in YZX order"
131  TypeRotateZXY, ///< Set of 3 canonical Euler rotations
132  /// \ref usdGeom_rotationPackingOrder "in ZXY order"
133  TypeRotateZYX, ///< Set of 3 canonical Euler rotations
134  /// \ref usdGeom_rotationPackingOrder "in ZYX order"
135  TypeOrient, ///< Arbitrary axis/angle rotation, expressed as a quaternion.
136  TypeTransform ///< A 4x4 matrix transformation.
137  };
138 
139  /// Precision of the encoded transformation operation's value.
140  enum Precision {
141  PrecisionDouble, ///< Double precision
142  PrecisionFloat, ///< Floating-point precision
143  PrecisionHalf ///< Half-float precision
144  };
145 
146  // Default constructor returns an invalid XformOp. Exists for
147  // container classes
149  {
150  /* NOTHING */
151  }
152 
153  /// Speculative constructor that will produce a valid UsdGeomXformOp when
154  /// \p attr already represents an attribute that is XformOp, and
155  /// produces an \em invalid XformOp otherwise (i.e.
156  /// explicit-bool conversion operator will return false).
157  ///
158  /// Calling \c UsdGeomXformOp::IsXformOp(attr) will return the same truth
159  /// value as this constructor, but if you plan to subsequently use the
160  /// XformOp anyways, just use this constructor.
161  ///
162  /// \p isInverseOp is set to true to indicate an inverse transformation
163  /// op.
164  ///
165  /// This constructor exists mainly for internal use. Clients should use
166  /// AddXformOp API (or one of Add*Op convenience API) to create and retain
167  /// a copy of an UsdGeomXformOp object.
168  ///
170  explicit UsdGeomXformOp(const UsdAttribute &attr, bool isInverseOp=false);
171 
172  // -------------------------------------------------------
173  /// \name Static Helper API
174  // -------------------------------------------------------
175 
176  /// Test whether a given UsdAttribute represents valid XformOp, which
177  /// implies that creating a UsdGeomXformOp from the attribute will succeed.
178  ///
179  /// Success implies that \c attr.IsDefined() is true.
181  static bool IsXformOp(const UsdAttribute &attr);
182 
183  /// Test whether a given attribute name represents a valid XformOp, which
184  /// implies that creating a UsdGeomXformOp from the corresponding
185  /// UsdAttribute will succeed.
186  ///
188  static bool IsXformOp(const TfToken &attrName);
189 
190  /// Returns the TfToken used to encode the given \p opType.
191  /// Note that an empty TfToken is used to represent TypeInvalid
193  static TfToken const &GetOpTypeToken(Type const opType);
194 
195  /// Returns the Type enum associated with the given \p opTypeToken.
197  static Type GetOpTypeEnum(TfToken const &opTypeToken);
198 
199  /// Returns the precision corresponding to the given value typeName.
202  const SdfValueTypeName& typeName);
203 
204  /// Returns the value typeName token that corresponds to the given
205  /// combination of \p opType and \p precision.
207  static const SdfValueTypeName &GetValueTypeName(const Type opType,
208  const Precision precision);
209 
210  /// Returns the xformOp's name as it appears in xformOpOrder, given
211  /// the opType, the (optional) suffix and whether it is an inverse
212  /// operation.
214  static TfToken GetOpName(const Type opType,
215  const TfToken &opSuffix=TfToken(),
216  bool inverse=false);
217 
218  // -------------------------------------------------------
219  /// \name Data Encoding Queries
220  // -------------------------------------------------------
221 
222  /// Return the operation type of this op, one of \ref UsdGeomXformOp::Type
223  Type GetOpType() const {
224  return _opType;
225  }
226 
227  /// Returns the precision level of the xform op.
229  Precision GetPrecision() const;
230 
231  /// Returns whether the xformOp represents an inverse operation.
232  bool IsInverseOp() const {
233  return _isInverseOp;
234  }
235 
236  /// Returns the opName as it appears in the xformOpOrder attribute.
237  ///
238  /// This will begin with "!invert!:xformOp:" if it is an inverse xform
239  /// operation. If it is not an inverse xformOp, it will begin with
240  /// 'xformOp:'.
241  ///
242  /// This will be empty for an invalid xformOp.
243  ///
245  TfToken GetOpName() const;
246 
247  /// Does this op have the given suffix in its name.
249  bool HasSuffix(TfToken const &suffix) const;
250 
251  // ---------------------------------------------------------------
252  /// \name Computing with Ops
253  // ---------------------------------------------------------------
254 
255  /// We allow ops to be encoded with varying degrees of precision,
256  /// depending on the clients needs and constraints. GetAs() will
257  /// attempt to convert the stored data to the requested datatype.
258  ///
259  /// Note this accessor incurs some overhead beyond Get()'ing the
260  /// value as a VtValue and dealing with the results yourself.
261  ///
262  /// \return true if a value was successfully read \em and converted
263  /// to the requested datatype (see \ref VtValue::Cast()), false
264  /// otherwise. A problem reading or failure to convert will cause
265  /// an error to be emitted.
266  ///
267  /// \note the requested type \p T must be constructable by assignment
268  template <typename T>
269  bool GetAs(T* value, UsdTimeCode time) const {
270  VtValue v;
271  if (!Get(&v, time)) {
272  return false;
273  }
274  v.Cast<T>();
275  if (v.IsEmpty()){
276  TfType thisType = GetTypeName().GetType();
277  TF_CODING_ERROR("Unable to convert xformOp %s's value from %s to "
278  "requested type %s.", GetAttr().GetPath().GetText(),
279  thisType.GetTypeName().c_str(),
280  TfType::GetCanonicalTypeName(typeid(*value)).c_str());
281  return false;
282  }
283  *value = v.UncheckedGet<T>();
284  return true;
285  }
286 
287  /// Return the 4x4 matrix that applies the transformation encoded
288  /// by op \p opType and data value \p opVal.
289  ///
290  /// If \p isInverseOp is true, then the inverse of the transformation
291  /// represented by the op/value pair is returned.
292  ///
293  /// An error will be issued if \p opType is not one of the values in the enum
294  /// \ref UsdGeomXformOp::Type or if \p opVal cannot be converted
295  /// to a suitable input to \p opType
297  static GfMatrix4d GetOpTransform(Type const opType,
298  VtValue const &opVal,
299  bool isInverseOp=false);
300 
301 
302  /// Return the 4x4 matrix that applies the transformation encoded
303  /// in this op at \p time.
304  ///
305  /// Returns the identity matrix and issues a coding error if the op is
306  /// invalid.
307  ///
308  /// If the op is valid, but has no authored value, the identity
309  /// matrix is returned and no error is issued.
310  ///
313 
314  /// Determine whether there is any possibility that this op's value
315  /// may vary over time.
316  ///
317  /// The determination is based on a snapshot of the authored state of the
318  /// op, and may become invalid in the face of further authoring.
319  bool MightBeTimeVarying() const {
320  return std::visit(_GetMightBeTimeVarying(), _attr);
321  }
322 
323  // ---------------------------------------------------------------
324  /// \name UsdAttribute API
325  // ---------------------------------------------------------------
326 
327  /// Allow UsdGeomXformOp to auto-convert to UsdAttribute, so you can
328  /// pass a UsdGeomXformOp to any function that accepts a UsdAttribute or
329  /// const-ref thereto.
330  operator UsdAttribute const& () const { return GetAttr(); }
331 
332  /// Explicit UsdAttribute extractor
333  UsdAttribute const &GetAttr() const {
334  return std::visit(_GetAttr(), _attr);
335  }
336 
337  /// Return true if the wrapped UsdAttribute::IsDefined(), and in
338  /// addition the attribute is identified as a XformOp.
339  bool IsDefined() const { return IsXformOp(GetAttr()); }
340 
341 public:
342  /// \anchor UsdGeomXformOp_explicit_bool
343  /// Explicit bool conversion operator. An XformOp object converts to
344  /// \c true iff it is valid for querying and authoring values and metadata,
345  /// (which is identically equivalent to IsDefined()), and converts to
346  /// \c false otherwise.
347  explicit operator bool() const {
348  return IsDefined();
349  }
350 
351  /// Equality comparison. Return true if \a lhs and \a rhs represent the
352  /// same underlying UsdAttribute, false otherwise.
353  friend bool operator==(const UsdGeomXformOp &lhs,
354  const UsdGeomXformOp &rhs) {
355  return lhs.GetAttr() == rhs.GetAttr();
356  }
357 
358  /// Inequality comparison. Return false if \a lhs and \a rhs represent the
359  /// same underlying UsdAttribute, true otherwise.
360  friend bool operator!=(const UsdGeomXformOp &lhs,
361  const UsdGeomXformOp &rhs) {
362  return !(lhs == rhs);
363  }
364 
365  /// \sa UsdAttribute::GetName()
366  TfToken const &GetName() const { return GetAttr().GetName(); }
367 
368  /// \sa UsdAttribute::GetBaseName()
369  TfToken GetBaseName() const { return GetAttr().GetBaseName(); }
370 
371  /// \sa UsdAttribute::GetNamespace()
372  TfToken GetNamespace() const { return GetAttr().GetNamespace(); }
373 
374  /// \sa UsdAttribute::SplitName()
375  std::vector<std::string> SplitName() const { return GetAttr().SplitName(); };
376 
377  /// \sa UsdAttribute::GetTypeName()
379 
380  /// Get the attribute value of the XformOp at \p time.
381  ///
382  /// \note For inverted ops, this returns the raw, uninverted value.
383  ///
384  template <typename T>
386  return std::visit(_Get<T>(value, time), _attr);
387  }
388 
389  /// Set the attribute value of the XformOp at \p time
390  ///
391  /// \note This only works on non-inverse operations. If invoked on
392  /// an inverse xform operation, a coding error is issued and no value is
393  /// authored.
394  ///
395  template <typename T>
396  bool Set(T const & value, UsdTimeCode time = UsdTimeCode::Default()) const {
397  // Issue a coding error and return without setting value,
398  // if this is an inverse op.
399  if (_isInverseOp) {
400  TF_CODING_ERROR("Cannot set a value on the inverse xformOp '%s'. "
401  "Please set value on the paired non-inverse xformOp instead.",
402  GetOpName().GetText());
403  return false;
404  }
405 
406  return GetAttr().Set(value, time);
407  }
408 
409  /// Populates the list of time samples at which the associated attribute
410  /// is authored.
411  bool GetTimeSamples(std::vector<double> *times) const {
412  return std::visit(_GetTimeSamples(times), _attr);
413  }
414 
415  /// Populates the list of time samples within the given \p interval,
416  /// at which the associated attribute is authored.
417  bool GetTimeSamplesInInterval(const GfInterval &interval,
418  std::vector<double> *times) const {
419  return std::visit(
420  _GetTimeSamplesInInterval(interval, times), _attr);
421  }
422 
423  /// Returns the number of time samples authored for this xformOp.
424  size_t GetNumTimeSamples() const {
425  return std::visit(_GetNumTimeSamples(), _attr);
426  }
427 
428 private:
429  struct _ValidAttributeTagType {};
430 
431 public:
432  // Allow clients that guarantee \p attr is valid avoid having
433  // UsdGeomXformOp's ctor check again.
435  UsdGeomXformOp(const UsdAttribute &attr, bool isInverseOp,
436  _ValidAttributeTagType);
438  UsdGeomXformOp(UsdAttributeQuery &&query, bool isInverseOp,
439  _ValidAttributeTagType);
440 private:
441  friend class UsdGeomXformable;
442 
443  // Shared initialization function.
444  void _Init();
445 
446  // Return the op-type for the string value \p str.
447  static Type _GetOpTypeEnumFromCString(char const *str, size_t len);
448 
449  // Returns the attribute belonging to \p prim that corresponds to the
450  // given \p opName. It also populates the output parameter \p isInverseOp
451  // appropriately.
452  //
453  // The attribute that's returned will be invalid if the
454  // corresponding xformOp attribute doesn't exist on the prim.
455  //
456  static UsdAttribute _GetXformOpAttr(UsdPrim const& prim,
457  const TfToken &opName, bool *isInverseOp);
458 
459  // Private method for creating and using an attribute query internally for
460  // this xformOp.
461  void _CreateAttributeQuery() const {
462  _attr = UsdAttributeQuery(GetAttr());
463  }
464 
465  // Factory for UsdGeomXformable's use, so that we can encapsulate the
466  // logic of what discriminates XformOp in this class, while
467  // preserving the pattern that attributes can only be created
468  // via their container objects.
469  //
470  // \p opType must be one of UsdGeomXformOp::Type
471  //
472  // \p precision must be one of UsdGeomXformOp::Precision.
473  //
474  // \return an invalid UsdGeomXformOp if we failed to create a valid
475  // attribute, a valid UsdGeomXformOp otherwise. It is not an
476  // error to create over an existing, compatible attribute.
477  //
478  // It is a failed verification for \p prim to be invalid/expired
479  //
480  // \sa UsdPrim::CreateAttribute()
481  UsdGeomXformOp(UsdPrim const& prim, Type const opType,
482  Precision const precision, TfToken const &opSuffix=TfToken(),
483  bool inverse=false);
484 
485  // UsdAttributeQuery already contains a copy of the associated UsdAttribute.
486  // To minimize the memory usage, we only store one or the other.
487  //
488  // The lifetime of a UsdAttributeQuery needs to be managed very carefully as
489  // it gets invalidated whenever the associated attribute is authored.
490  // Hence, access to the creation of an attribute query is restricted inside
491  // a private member function named _CreateAttributeQuery().
492  //
493  mutable std::variant<UsdAttribute, UsdAttributeQuery> _attr;
494 
495  Type _opType;
496  bool _isInverseOp;
497 
498  // Visitor for getting xformOp value.
499  template <class T>
500  struct _Get
501  {
502  _Get(T *value_,
503  UsdTimeCode time_ = UsdTimeCode::Default()) : value (value_), time(time_)
504  {}
505 
506  bool operator()(const UsdAttribute &attr) const
507  {
508  return attr.Get(value, time);
509  }
510 
511  bool operator()(const UsdAttributeQuery &attrQuery) const
512  {
513  return attrQuery.Get(value, time);
514  }
515 
516  T *value;
518  };
519 
520  // Visitor for getting a const-reference to the UsdAttribute.
521  struct _GetAttr {
522 
523  _GetAttr() {}
524 
525  const UsdAttribute &operator()(const UsdAttribute &attr) const
526  {
527  return attr;
528  }
529 
530  const UsdAttribute &operator()(const UsdAttributeQuery &attrQuery) const
531  {
532  return attrQuery.GetAttribute();
533  }
534  };
535 
536  // Visitor for getting all the time samples.
537  struct _GetTimeSamples {
538 
539  _GetTimeSamples(std::vector<double> *times_) : times(times_) {}
540 
541  bool operator()(const UsdAttribute &attr) const
542  {
543  return attr.GetTimeSamples(times);
544  }
545 
546  bool operator()(const UsdAttributeQuery &attrQuery) const
547  {
548  return attrQuery.GetTimeSamples(times);
549  }
550 
551  std::vector<double> *times;
552  };
553 
554  // Visitor for getting all the time samples within a given interval.
555  struct _GetTimeSamplesInInterval {
556 
557  _GetTimeSamplesInInterval(const GfInterval &interval_,
558  std::vector<double> *times_)
559  : interval(interval_), times(times_)
560  {}
561 
562  bool operator()(const UsdAttribute &attr) const
563  {
564  return attr.GetTimeSamplesInInterval(interval, times);
565  }
566 
567  bool operator()(const UsdAttributeQuery &attrQuery) const
568  {
569  return attrQuery.GetTimeSamplesInInterval(interval, times);
570  }
571 
572  const GfInterval &interval;
573  std::vector<double> *times;
574  };
575 
576  // Visitor for getting the number of time samples.
577  struct _GetNumTimeSamples {
578 
579  _GetNumTimeSamples() {}
580 
581  size_t operator()(const UsdAttribute &attr) const
582  {
583  return attr.GetNumTimeSamples();
584  }
585 
586  size_t operator()(const UsdAttributeQuery &attrQuery) const
587  {
588  return attrQuery.GetNumTimeSamples();
589  }
590  };
591 
592  // Visitor for determining whether the op might vary over time.
593  struct _GetMightBeTimeVarying {
594 
595  _GetMightBeTimeVarying() {}
596 
597  bool operator()(const UsdAttribute &attr) const
598  {
599  return attr.ValueMightBeTimeVarying();
600  }
601 
602  bool operator()(const UsdAttributeQuery &attrQuery) const
603  {
604  return attrQuery.ValueMightBeTimeVarying();
605  }
606  };
607 
608 };
609 
610 
611 
613 
614 #endif // USD_XFORMOP_H
static USDGEOM_API Precision GetPrecisionFromValueTypeName(const SdfValueTypeName &typeName)
Returns the precision corresponding to the given value typeName.
GLenum query
Definition: glad.h:2772
Arbitrary axis/angle rotation, expressed as a quaternion.
Definition: xformOp.h:135
static USDGEOM_API bool IsXformOp(const UsdAttribute &attr)
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Double precision.
Definition: xformOp.h:141
static constexpr UsdTimeCode Default()
Definition: timeCode.h:113
T const & UncheckedGet() const &
Definition: value.h:1104
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Definition: attribute.h:452
USD_API TfToken GetBaseName() const
A 4x4 matrix transformation.
Definition: xformOp.h:136
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:837
Scale along the X-axis.
Definition: xformOp.h:116
static USDGEOM_API TfToken const & GetOpTypeToken(Type const opType)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
static TF_API std::string GetCanonicalTypeName(const std::type_info &)
bool IsDefined() const
Definition: xformOp.h:339
TF_DECLARE_PUBLIC_TOKENS(UsdGeomXformOpTypes, USDGEOM_API, USDGEOM_XFORM_OP_TYPES)
TfToken const & GetName() const
Definition: xformOp.h:366
USD_API size_t GetNumTimeSamples() const
Represents an invalid xformOp.
Definition: xformOp.h:111
#define TF_CODING_ERROR
bool MightBeTimeVarying() const
Definition: xformOp.h:319
USD_API SdfValueTypeName GetTypeName() const
Return the "scene description" value type name for this attribute.
Translation along the Y-axis.
Definition: xformOp.h:113
Half-float precision.
Definition: xformOp.h:143
Rotation about the Y-axis, in degrees.
Definition: xformOp.h:121
bool IsEmpty() const
Returns true iff this value is empty.
Definition: value.h:1285
Rotation about the X-axis, in degrees.
Definition: xformOp.h:120
static USDGEOM_API const SdfValueTypeName & GetValueTypeName(const Type opType, const Precision precision)
OutGridT const XformOp bool bool
friend bool operator!=(const UsdGeomXformOp &lhs, const UsdGeomXformOp &rhs)
Definition: xformOp.h:360
Definition: token.h:70
Type GetOpType() const
Return the operation type of this op, one of UsdGeomXformOp::Type.
Definition: xformOp.h:223
USD_API bool ValueMightBeTimeVarying() const
USD_API std::vector< std::string > SplitName() const
TfToken GetBaseName() const
Definition: xformOp.h:369
Scale along the Y-axis.
Definition: xformOp.h:117
static USDGEOM_API GfMatrix4d GetOpTransform(Type const opType, VtValue const &opVal, bool isInverseOp=false)
#define USDGEOM_XFORM_OP_TYPES
Definition: xformOp.h:29
USD_API bool GetTimeSamples(std::vector< double > *times) const
USD_API size_t GetNumTimeSamples() const
TfToken GetNamespace() const
Definition: xformOp.h:372
Floating-point precision.
Definition: xformOp.h:142
Definition: prim.h:116
Scale along the Z-axis.
Definition: xformOp.h:118
bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Definition: xformOp.h:417
friend bool operator==(const UsdGeomXformOp &lhs, const UsdGeomXformOp &rhs)
Definition: xformOp.h:353
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Definition: xformOp.h:385
std::vector< std::string > SplitName() const
Definition: xformOp.h:375
USD_API TfToken GetNamespace() const
bool Set(const T &value, UsdTimeCode time=UsdTimeCode::Default()) const
Definition: attribute.h:495
const TfToken & GetName() const
Definition: object.h:221
bool IsInverseOp() const
Returns whether the xformOp represents an inverse operation.
Definition: xformOp.h:232
bool GetAs(T *value, UsdTimeCode time) const
Definition: xformOp.h:269
GLenum GLint GLint * precision
Definition: glcorearb.h:1925
USD_API bool GetTimeSamples(std::vector< double > *times) const
bool Set(T const &value, UsdTimeCode time=UsdTimeCode::Default()) const
Definition: xformOp.h:396
Rotation about the Z-axis, in degrees.
Definition: xformOp.h:122
bool GetTimeSamples(std::vector< double > *times) const
Definition: xformOp.h:411
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
XYZ translation.
Definition: xformOp.h:115
static VtValue Cast(VtValue const &val)
Definition: value.h:1189
TF_API const std::string & GetTypeName() const
size_t GetNumTimeSamples() const
Returns the number of time samples authored for this xformOp.
Definition: xformOp.h:424
static USDGEOM_API Type GetOpTypeEnum(TfToken const &opTypeToken)
Returns the Type enum associated with the given opTypeToken.
UsdAttribute const & GetAttr() const
Explicit UsdAttribute extractor.
Definition: xformOp.h:333
SdfValueTypeName GetTypeName() const
Definition: xformOp.h:378
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Type
Enumerates the set of all transformation operation types.
Definition: xformOp.h:110
USD_API const UsdAttribute & GetAttribute() const
Return the attribute associated with this query.
#define USDGEOM_API
Definition: api.h:23
Translation along the X-axis.
Definition: xformOp.h:112
SDF_API const TfType & GetType() const
Returns the TfType of the type.
USD_API bool ValueMightBeTimeVarying() const
Definition: value.h:146
Translation along the Z-axis.
Definition: xformOp.h:114
USDGEOM_API TfToken GetOpName() const
USDGEOM_API bool HasSuffix(TfToken const &suffix) const
Does this op have the given suffix in its name.
Precision
Precision of the encoded transformation operation's value.
Definition: xformOp.h:140
USDGEOM_API Precision GetPrecision() const
Returns the precision level of the xform op.