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