HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xformable.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 USDGEOM_GENERATED_XFORMABLE_H
8 #define USDGEOM_GENERATED_XFORMABLE_H
9 
10 /// \file usdGeom/xformable.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdGeom/api.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
17 #include "pxr/usd/usdGeom/tokens.h"
18 
19 #include "pxr/usd/usdGeom/xformOp.h"
20 #include <vector>
21 
22 #include "pxr/base/vt/value.h"
23 
24 #include "pxr/base/gf/vec3d.h"
25 #include "pxr/base/gf/vec3f.h"
26 #include "pxr/base/gf/matrix4d.h"
27 
28 #include "pxr/base/tf/token.h"
29 #include "pxr/base/tf/type.h"
30 
32 
33 class SdfAssetPath;
34 
35 // -------------------------------------------------------------------------- //
36 // XFORMABLE //
37 // -------------------------------------------------------------------------- //
38 
39 /// \class UsdGeomXformable
40 ///
41 /// Base class for all transformable prims, which allows arbitrary
42 /// sequences of component affine transformations to be encoded.
43 ///
44 /// \note
45 /// You may find it useful to review \ref UsdGeom_LinAlgBasics while reading
46 /// this class description.
47 ///
48 /// <b>Supported Component Transformation Operations</b>
49 ///
50 /// UsdGeomXformable currently supports arbitrary sequences of the following
51 /// operations, each of which can be encoded in an attribute of the proper
52 /// shape in any supported precision:
53 /// \li translateX - 1D
54 /// \li translateY - 1D
55 /// \li translateZ - 1D
56 /// \li translate - 3D
57 /// \li scale - 3D
58 /// \li scaleX - 1D
59 /// \li scaleY - 1D
60 /// \li scaleZ - 1D
61 /// \li rotateX - 1D angle in degrees
62 /// \li rotateY - 1D angle in degrees
63 /// \li rotateZ - 1D angle in degrees
64 /// \li rotateABC - 3D where ABC can be any combination of the six principle
65 /// Euler Angle sets: XYZ, XZY, YXZ, YZX, ZXY, ZYX. See
66 /// \ref usdGeom_rotationPackingOrder "note on rotation packing order"
67 /// \li orient - 4D (quaternion)
68 /// \li transform - 4x4D
69 ///
70 /// <b>Creating a Component Transformation</b>
71 ///
72 /// To add components to a UsdGeomXformable prim, simply call AddXformOp()
73 /// with the desired op type, as enumerated in \ref UsdGeomXformOp::Type,
74 /// and the desired precision, which is one of \ref UsdGeomXformOp::Precision.
75 /// Optionally, you can also provide an "op suffix" for the operator that
76 /// disambiguates it from other components of the same type on the same prim.
77 /// Application-specific transform schemas can use the suffixes to fill a role
78 /// similar to that played by AbcGeom::XformOp's "Hint" enums for their own
79 /// round-tripping logic.
80 ///
81 /// We also provide specific "Add" API for each type, for clarity and
82 /// conciseness, e.g. AddTranslateOp(), AddTranslateXOp(), AddRotateXYZOp() etc.
83 ///
84 /// AddXformOp() will return a UsdGeomXformOp object, which is a schema on a
85 /// newly created UsdAttribute that provides convenience API for authoring
86 /// and computing the component transformations. The UsdGeomXformOp can then
87 /// be used to author any number of timesamples and default for the op.
88 ///
89 /// Each successive call to AddXformOp() adds an operator that will be applied
90 /// "more locally" than the preceding operator, just as if we were pushing
91 /// transforms onto a transformation stack - which is precisely what should
92 /// happen when the operators are consumed by a reader.
93 ///
94 /// \note
95 /// If you can, please try to use the UsdGeomXformCommonAPI, which wraps
96 /// the UsdGeomXformable with an interface in which Op creation is taken
97 /// care of for you, and there is a much higher chance that the data you
98 /// author will be importable without flattening into other DCC's, as it
99 /// conforms to a fixed set of Scale-Rotate-Translate Ops.
100 ///
101 /// \sa \ref usdGeom_xformableExamples "Using the Authoring API"
102 ///
103 /// <b>Data Encoding and Op Ordering</b>
104 ///
105 /// Because there is no "fixed schema" of operations, all of the attributes
106 /// that encode transform operations are dynamic, and are scoped in
107 /// the namespace "xformOp". The second component of an attribute's name provides
108 /// the \em type of operation, as listed above. An "xformOp" attribute can
109 /// have additional namespace components derived from the \em opSuffix argument
110 /// to the AddXformOp() suite of methods, which provides a preferred way of
111 /// naming the ops such that we can have multiple "translate" ops with unique
112 /// attribute names. For example, in the attribute named
113 /// "xformOp:translate:maya:pivot", "translate" is the type of operation and
114 /// "maya:pivot" is the suffix.
115 ///
116 /// The following ordered list of attribute declarations in usda
117 /// define a basic Scale-Rotate-Translate with XYZ Euler angles, wherein the
118 /// translation is double-precision, and the remainder of the ops are single,
119 /// in which we will:
120 ///
121 /// <ol>
122 /// <li> Scale by 2.0 in each dimension
123 /// <li> Rotate about the X, Y, and Z axes by 30, 60, and 90 degrees, respectively
124 /// <li> Translate by 100 units in the Y direction
125 /// </ol>
126 ///
127 /// \code
128 /// float3 xformOp:rotateXYZ = (30, 60, 90)
129 /// float3 xformOp:scale = (2, 2, 2)
130 /// double3 xformOp:translate = (0, 100, 0)
131 /// uniform token[] xformOpOrder = [ "xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale" ]
132 /// \endcode
133 ///
134 /// The attributes appear in the dictionary order in which USD, by default,
135 /// sorts them. To ensure the ops are recovered and evaluated in the correct
136 /// order, the schema introduces the **xformOpOrder** attribute, which
137 /// contains the names of the op attributes, in the precise sequence in which
138 /// they should be pushed onto a transform stack. **Note** that the order is
139 /// opposite to what you might expect, given the matrix algebra described in
140 /// \ref UsdGeom_LinAlgBasics. This also dictates order of op creation,
141 /// since each call to AddXformOp() adds a new op to the end of the
142 /// \b xformOpOrder array, as a new "most-local" operation. See
143 /// \ref usdGeom_xformableExamples "Example 2 below" for C++ code that could
144 /// have produced this USD.
145 ///
146 /// If it were important for the prim's rotations to be independently
147 /// overridable, we could equivalently (at some performance cost) encode
148 /// the transformation also like so:
149 /// \code
150 /// float xformOp:rotateX = 30
151 /// float xformOp:rotateY = 60
152 /// float xformOp:rotateZ = 90
153 /// float3 xformOp:scale = (2, 2, 2)
154 /// double3 xformOp:translate = (0, 100, 0)
155 /// uniform token[] xformOpOrder = [ "xformOp:translate", "xformOp:rotateZ", "xformOp:rotateY", "xformOp:rotateX", "xformOp:scale" ]
156 /// \endcode
157 ///
158 /// Again, note that although we are encoding an XYZ rotation, the three
159 /// rotations appear in the **xformOpOrder** in the opposite order, with Z,
160 /// followed, by Y, followed by X.
161 ///
162 /// Were we to add a Maya-style scalePivot to the above example, it might
163 /// look like the following:
164 /// \code
165 /// float3 xformOp:rotateXYZ = (30, 60, 90)
166 /// float3 xformOp:scale = (2, 2, 2)
167 /// double3 xformOp:translate = (0, 100, 0)
168 /// double3 xformOp:translate:scalePivot
169 /// uniform token[] xformOpOrder = [ "xformOp:translate", "xformOp:rotateXYZ", "xformOp:translate:scalePivot", "xformOp:scale" ]
170 /// \endcode
171 ///
172 /// <b>Paired "Inverted" Ops</b>
173 ///
174 /// We have been claiming that the ordered list of ops serves as a set
175 /// of instructions to a transform stack, but you may have noticed in the last
176 /// example that there is a missing operation - the pivot for the scale op
177 /// needs to be applied in its inverse-form as a final (most local) op! In the
178 /// AbcGeom::Xform schema, we would have encoded an actual "final" translation
179 /// op whose value was authored by the exporter as the negation of the pivot's
180 /// value. However, doing so would be brittle in USD, given that each op can
181 /// be independently overridden, and the constraint that one attribute must be
182 /// maintained as the negation of the other in order for successful
183 /// re-importation of the schema cannot be expressed in USD.
184 ///
185 /// Our solution leverages the **xformOpOrder** member of the schema, which,
186 /// in addition to ordering the ops, may also contain one of two special
187 /// tokens that address the paired op and "stack resetting" behavior.
188 ///
189 /// The "paired op" behavior is encoded as an "!invert!" prefix in
190 /// \b xformOpOrder, as the result of an AddXformOp(isInverseOp=True) call.
191 /// The \b xformOpOrder for the last example would look like:
192 /// \code
193 /// uniform token[] xformOpOrder = [ "xformOp:translate", "xformOp:rotateXYZ", "xformOp:translate:scalePivot", "xformOp:scale", "!invert!xformOp:translate:scalePivot" ]
194 /// \endcode
195 ///
196 /// When asked for its value via UsdGeomXformOp::GetOpTransform(), an
197 /// "inverted" Op (i.e. the "inverted" half of a set of paired Ops) will fetch
198 /// the value of its paired attribute and return its negation. This works for
199 /// all op types - an error will be issued if a "transform" type op is singular
200 /// and cannot be inverted. When getting the authored value of an inverted op
201 /// via UsdGeomXformOp::Get(), the raw, uninverted value of the associated
202 /// attribute is returned.
203 ///
204 /// For the sake of robustness, <b>setting a value on an inverted op is disallowed.</b>
205 /// Attempting to set a value on an inverted op will result in a coding error
206 /// and no value being set.
207 ///
208 /// <b>Resetting the Transform Stack</b>
209 ///
210 /// The other special op/token that can appear in \em xformOpOrder is
211 /// \em "!resetXformStack!", which, appearing as the first element of
212 /// \em xformOpOrder, indicates this prim should not inherit the transformation
213 /// of its namespace parent. See SetResetXformStack()
214 ///
215 /// <b>Expected Behavior for "Missing" Ops</b>
216 ///
217 /// If an importer expects Scale-Rotate-Translate operations, but a prim
218 /// has only translate and rotate ops authored, the importer should assume
219 /// an identity scale. This allows us to optimize the data a bit, if only
220 /// a few components of a very rich schema (like Maya's) are authored in the
221 /// app.
222 ///
223 /// \anchor usdGeom_xformableExamples
224 /// <b>Using the C++ API</b>
225 ///
226 /// #1. Creating a simple transform matrix encoding
227 /// \snippet examples_usdGeom.cpp CreateMatrixWithDefault
228 ///
229 /// #2. Creating the simple SRT from the example above
230 /// \snippet examples_usdGeom.cpp CreateExampleSRT
231 ///
232 /// #3. Creating a parameterized SRT with pivot using UsdGeomXformCommonAPI
233 /// \snippet examples_usdGeom.cpp CreateSRTWithDefaults
234 ///
235 /// #4. Creating a rotate-only pivot transform with animated
236 /// rotation and translation
237 /// \snippet examples_usdGeom.cpp CreateAnimatedTransform
238 ///
239 ///
240 ///
242 {
243 public:
244  /// Compile time constant representing what kind of schema this class is.
245  ///
246  /// \sa UsdSchemaKind
248 
249  /// Construct a UsdGeomXformable on UsdPrim \p prim .
250  /// Equivalent to UsdGeomXformable::Get(prim.GetStage(), prim.GetPath())
251  /// for a \em valid \p prim, but will not immediately throw an error for
252  /// an invalid \p prim
253  explicit UsdGeomXformable(const UsdPrim& prim=UsdPrim())
254  : UsdGeomImageable(prim)
255  {
256  }
257 
258  /// Construct a UsdGeomXformable on the prim held by \p schemaObj .
259  /// Should be preferred over UsdGeomXformable(schemaObj.GetPrim()),
260  /// as it preserves SchemaBase state.
261  explicit UsdGeomXformable(const UsdSchemaBase& schemaObj)
262  : UsdGeomImageable(schemaObj)
263  {
264  }
265 
266  /// Destructor.
268  virtual ~UsdGeomXformable();
269 
270  /// Return a vector of names of all pre-declared attributes for this schema
271  /// class and all its ancestor classes. Does not include attributes that
272  /// may be authored by custom/extended methods of the schemas involved.
274  static const TfTokenVector &
275  GetSchemaAttributeNames(bool includeInherited=true);
276 
277  /// Return a UsdGeomXformable holding the prim adhering to this
278  /// schema at \p path on \p stage. If no prim exists at \p path on
279  /// \p stage, or if the prim at that path does not adhere to this schema,
280  /// return an invalid schema object. This is shorthand for the following:
281  ///
282  /// \code
283  /// UsdGeomXformable(stage->GetPrimAtPath(path));
284  /// \endcode
285  ///
287  static UsdGeomXformable
288  Get(const UsdStagePtr &stage, const SdfPath &path);
289 
290 
291 protected:
292  /// Returns the kind of schema this class belongs to.
293  ///
294  /// \sa UsdSchemaKind
296  UsdSchemaKind _GetSchemaKind() const override;
297 
298 private:
299  // needs to invoke _GetStaticTfType.
300  friend class UsdSchemaRegistry;
302  static const TfType &_GetStaticTfType();
303 
304  static bool _IsTypedSchema();
305 
306  // override SchemaBase virtuals.
308  const TfType &_GetTfType() const override;
309 
310 public:
311  // --------------------------------------------------------------------- //
312  // XFORMOPORDER
313  // --------------------------------------------------------------------- //
314  /// Encodes the sequence of transformation operations in the
315  /// order in which they should be pushed onto a transform stack while
316  /// visiting a UsdStage's prims in a graph traversal that will effect
317  /// the desired positioning for this prim and its descendant prims.
318  ///
319  /// You should rarely, if ever, need to manipulate this attribute directly.
320  /// It is managed by the AddXformOp(), SetResetXformStack(), and
321  /// SetXformOpOrder(), and consulted by GetOrderedXformOps() and
322  /// GetLocalTransformation().
323  ///
324  /// | ||
325  /// | -- | -- |
326  /// | Declaration | `uniform token[] xformOpOrder` |
327  /// | C++ Type | VtArray<TfToken> |
328  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->TokenArray |
329  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
332 
333  /// See GetXformOpOrderAttr(), and also
334  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
335  /// If specified, author \p defaultValue as the attribute's default,
336  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
337  /// the default for \p writeSparsely is \c false.
339  UsdAttribute CreateXformOpOrderAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
340 
341 public:
342  // ===================================================================== //
343  // Feel free to add custom code below this line, it will be preserved by
344  // the code generator.
345  //
346  // Just remember to:
347  // - Close the class declaration with };
348  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
349  // - Close the include guard with #endif
350  // ===================================================================== //
351  // --(BEGIN CUSTOM CODE)--
352 
353  /// \class XformQuery
354  ///
355  /// Helper class that caches the ordered vector of UsGeomXformOps that
356  /// contribute to the local transformation of an xformable prim
357  ///
358  /// Internally, the class initializes UsdAttributeQuery objects for the
359  /// xformOp attributes in order to facilitate efficient querying of their
360  /// values.
361  ///
362  /// \note This object does not listen to change notification. If a
363  /// consumer is holding onto a UsdGeomXformable::XformQuery object, it is
364  /// their responsibility to dispose of it, in response to a resync
365  /// change to the associated xformOp attributes. The class provides the
366  /// convenience method IncludesXformOpAttr for this purpose.
367  ///
368  class XformQuery {
369  public:
371  _resetsXformStack(false)
372  { }
373 
374  /// Constructs an XformQuery object for the given xformable prim.
375  /// Caches the ordered xformOps and initializes an UsdAttributeQuery
376  /// internally for all the associated attributes.
378  XformQuery(const UsdGeomXformable &xformable);
379 
380  /// Utilizes the internally cached UsdAttributeQuery's to efficiently
381  /// compute the transform value at the given \p time.
384  const UsdTimeCode time) const;
385 
386  /// Returns whether the xformable resets its parent's transformation.
387  bool GetResetXformStack() const {
388  return _resetsXformStack;
389  }
390 
391  /// Returns whether the xform value might change over time.
393  bool TransformMightBeTimeVarying() const;
394 
395  /// Returns whether xformOpOrder is non-empty.
397  bool HasNonEmptyXformOpOrder() const;
398 
399  /// Sets the vector of times at which xformOp samples have been
400  /// authored in the cached set of xform ops.
401  ///
402  /// \sa UsdXformable::GetTimeSamples
404  bool GetTimeSamples(std::vector<double> *times) const;
405 
406  /// Sets the vector of times in the \p interval at which xformOp
407  /// samples have been authored in the cached set of xform ops.
408  ///
409  /// \sa UsdXformable::GetTimeSamples
411  bool GetTimeSamplesInInterval(const GfInterval &interval,
412  std::vector<double> *times) const;
413 
414  /// Returns whether the given attribute affects the local
415  /// transformation computed for this query.
418  const TfToken &attrName) const;
419 
420  private:
421  // Cached copy of the vector of ordered xform ops.
422  std::vector<UsdGeomXformOp> _xformOps;
423 
424  // Cache whether the xformable has !resetsXformStack! in its
425  // xformOpOrder.
426  bool _resetsXformStack;
427  };
428 
429  /// Add an affine transformation to the local stack represented by this
430  /// Xformable. This will fail if there is already a transform operation
431  /// of the same name in the ordered ops on this prim (i.e. as returned
432  /// by GetOrderedXformOps()), or if an op of the same name exists at all
433  /// on the prim with a different precision than that specified.
434  ///
435  /// The newly created operation will become the most-locally applied
436  /// transformation on the prim, and will appear last in the list
437  /// returned by GetOrderedXformOps(). It is OK to begin authoring values
438  /// to the returned UsdGeomXformOp immediately, interspersed with
439  /// subsequent calls to AddXformOp() - just note the order of application,
440  /// which \em can be changed at any time (and in stronger layers) via
441  /// SetXformOpOrder().
442  ///
443  /// \param opType is the type of transform operation, one of
444  /// \ref UsdGeomXformOp::Type.
445  /// \param precision allows you to specify the precision with which you
446  /// desire to encode the data. This should be one of the values in
447  /// the enum \ref UsdGeomXformOp::Precision .
448  /// \param opSuffix allows you to specify the purpose/meaning of the op in
449  /// the stack. When opSuffix is specified, the associated attribute's
450  /// name is set to "xformOp:<opType>:<opSuffix>".
451  /// \param isInverseOp is used to indicate an inverse transformation
452  /// operation.
453  ///
454  /// \return a UsdGeomXformOp that can be used to author to the operation.
455  /// An error is issued and the returned object will be invalid
456  /// (evaluate to false) if the op being added already exists in
457  /// \ref GetXformOpOrderAttr() "xformOpOrder" or if the
458  /// arguments supplied are invalid.
459  ///
460  /// \note If the attribute associated with the op already exists, but isn't
461  /// of the requested precision, a coding error is issued, but a valid
462  /// xformOp is returned with the existing attribute.
463  ///
468  TfToken const &opSuffix = TfToken(),
469  bool isInverseOp=false) const;
470 
471  /// Get an affine transformation from the local stack represented by this
472  /// Xformable. This will return an invalid op if there is no transform operation
473  /// of the same name in the ordered ops on this prim (i.e. as returned
474  /// by GetOrderedXformOps())
475  ///
476  /// \param opType is the type of transform operation, one of
477  /// \ref UsdGeomXformOp::Type.
478  /// \param opSuffix specifies the purpose/meaning of the op in
479  /// the stack. When opSuffix is specified, the associated attribute's
480  /// name is "xformOp:<opType>:<opSuffix>".
481  /// \param isInverseOp is used to indicate an inverse transformation
482  /// operation.
483  ///
484  /// \return a UsdGeomXformOp with the specified attributes.
485  /// The returned object will be invalid (evaluate to false)
486  /// if the op requested does not exist in
487  /// \ref GetXformOpOrderAttr() "xformOpOrder" or if the
488  /// arguments supplied are invalid.
489  ///
492  TfToken const &opSuffix = TfToken(),
493  bool isInverseOp=false) const;
494 
495  /// Add a translation about the X-axis to the local stack represented by
496  /// this xformable.
497  ///
498  /// \sa AddXformOp()
502  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
503 
504  /// Add a translation about the Y-axis to the local stack represented by
505  /// this xformable.
506  ///
507  /// \sa AddXformOp()
511  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
512 
513  /// Add a translation about the Z-axis to the local stack represented by
514  /// this xformable.
515  ///
516  /// \sa AddXformOp()
520  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
521 
522  /// Add a translate operation to the local stack represented by this
523  /// xformable.
524  ///
525  /// \sa AddXformOp()
529  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
530 
531  /// Get a translation about the X-axis from the local stack represented by
532  /// this xformable.
533  ///
534  /// \sa GetXformOp()
537  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
538 
539  /// Get a translation about the Y-axis from the local stack represented by
540  /// this xformable.
541  ///
542  /// \sa GetXformOp()
545  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
546 
547  /// Get a translation about the Z-axis from the local stack represented by
548  /// this xformable.
549  ///
550  /// \sa GetXformOp()
553  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
554 
555  /// Get a translate operation from the local stack represented by this
556  /// xformable.
557  ///
558  /// \sa GetXformOp()
561  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
562 
563  /// Add a scale operation about the X-axis to the local stack represented by
564  /// this xformable.
565  ///
566  /// \sa AddXformOp()
570  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
571 
572  /// Add a scale operation about the Y-axis to the local stack represented by
573  /// this xformable.
574  ///
575  /// \sa AddXformOp()
579  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
580 
581  /// Add a scale operation about the Z-axis to the local stack represented by
582  /// this xformable.
583  ///
584  /// \sa AddXformOp()
588  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
589 
590  /// Add a scale operation to the local stack represented by this
591  /// xformable.
592  ///
593  /// \sa AddXformOp()
597  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
598 
599  /// Get a scale operation about the X-axis from the local stack represented
600  /// by this xformable.
601  ///
602  /// \sa GetXformOp()
605  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
606 
607  /// Get a scale operation about the Y-axis from the local stack represented
608  /// by this xformable.
609  ///
610  /// \sa GetXformOp()
613  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
614 
615  /// Get a scale operation about the Z-axis from the local stack represented
616  /// by this xformable.
617  ///
618  /// \sa GetXformOp()
621  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
622 
623  /// Get a scale operation from the local stack represented by this
624  /// xformable.
625  ///
626  /// \sa GetXformOp()
629  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
630 
631  /// Add a rotation about the X-axis to the local stack represented by
632  /// this xformable.
633  ///
634  /// Set the angle value of the resulting UsdGeomXformOp <b>in degrees</b>
635  /// \sa AddXformOp()
639  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
640 
641  /// Get a rotation about the X-axis from the local stack represented by
642  /// this xformable.
643  ///
644  /// \sa GetXformOp()
647  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
648 
649  /// Add a rotation about the Y-axis to the local stack represented by
650  /// this xformable.
651  ///
652  /// Set the angle value of the resulting UsdGeomXformOp <b>in degrees</b>
653  /// \sa AddXformOp()
657  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
658 
659  /// Get a rotation about the Y-axis from the local stack represented by
660  /// this xformable.
661  ///
662  /// \sa GetXformOp()
665  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
666 
667  /// Add a rotation about the Z-axis to the local stack represented by
668  /// this xformable.
669  ///
670  /// \sa AddXformOp()
674  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
675 
676  /// Get a rotation about the Z-axis from the local stack represented by
677  /// this xformable.
678  ///
679  /// \sa GetXformOp()
682  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
683 
684  /// Add a rotation op with XYZ rotation order to the local stack
685  /// represented by this xformable.
686  ///
687  /// Set the angle value of the resulting UsdGeomXformOp <b>in degrees</b>
688  /// \sa AddXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
692  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
693 
694  /// Get a rotation op with XYZ rotation order from the local stack
695  /// represented by this xformable.
696  ///
697  /// \sa GetXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
700  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
701 
702  /// Add a rotation op with XZY rotation order to the local stack
703  /// represented by this xformable.
704  ///
705  /// Set the angle values of the resulting UsdGeomXformOp <b>in degrees</b>
706  /// \sa AddXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
710  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
711 
712  /// Get a rotation op with XZY rotation order from the local stack
713  /// represented by this xformable.
714  ///
715  /// \sa GetXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
718  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
719 
720  /// Add a rotation op with YXZ rotation order to the local stack
721  /// represented by this xformable.
722  ///
723  /// Set the angle values of the resulting UsdGeomXformOp <b>in degrees</b>
724  /// \sa AddXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
728  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
729 
730  /// Get a rotation op with YXZ rotation order from the local stack
731  /// represented by this xformable.
732  ///
733  /// \sa GetXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
736  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
737 
738  /// Add a rotation op with YZX rotation order to the local stack
739  /// represented by this xformable.
740  ///
741  /// Set the angle values of the resulting UsdGeomXformOp <b>in degrees</b>
742  /// \sa AddXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
746  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
747 
748  /// Get a rotation op with YZX rotation order from the local stack
749  /// represented by this xformable.
750  ///
751  /// \sa GetXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
754  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
755 
756  /// Add a rotation op with ZXY rotation order to the local stack
757  /// represented by this xformable.
758  ///
759  /// Set the angle values of the resulting UsdGeomXformOp <b>in degrees</b>
760  /// \sa AddXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
764  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
765 
766  /// Get a rotation op with ZXY rotation order from the local stack
767  /// represented by this xformable.
768  ///
769  /// \sa GetXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
772  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
773 
774  /// Add a rotation op with ZYX rotation order to the local stack
775  /// represented by this xformable.
776  ///
777  /// Set the angle values of the resulting UsdGeomXformOp <b>in degrees</b>
778  /// \sa AddXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
782  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
783 
784  /// Get a rotation op with ZYX rotation order from the local stack
785  /// represented by this xformable.
786  ///
787  /// \sa GetXformOp(), \ref usdGeom_rotationPackingOrder "note on angle packing order"
790  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
791 
792  /// Add a orient op (arbitrary axis/angle rotation) to the local stack
793  /// represented by this xformable.
794  ///
795  /// \sa AddXformOp()
799  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
800 
801  /// Get an orient op (arbitrary axis/angle rotation) from the local stack
802  /// represented by this xformable.
803  ///
804  /// \sa GetXformOp()
807  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
808 
809  /// Add a tranform op (4x4 matrix transformation) to the local stack
810  /// represented by this xformable.
811  ///
812  /// \sa AddXformOp()
813  ///
814  /// Note: This method takes a precision argument only to be consistent
815  /// with the other types of xformOps. The only valid precision here is
816  /// double since matrix values cannot be encoded in floating-pt precision
817  /// in Sdf.
821  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
822 
823  /// Get a tranform op (4x4 matrix transformation) from the local stack
824  /// represented by this xformable.
825  ///
826  /// \sa GetXformOp()
827  ///
830  TfToken const &opSuffix = TfToken(), bool isInverseOp=false) const;
831 
832  /// Specify whether this prim's transform should reset the transformation
833  /// stack inherited from its parent prim.
834  ///
835  /// By default, parent transforms are inherited. SetResetXformStack() can be
836  /// called at any time during authoring, but will always add a
837  /// '!resetXformStack!' op as the \em first op in the ordered list, if one
838  /// does not exist already. If one already exists, and \p resetXform is
839  /// false, it will remove all ops upto and including the last
840  /// "!resetXformStack!" op.
842  bool SetResetXformStack(bool resetXform) const;
843 
844  /// Does this prim reset its parent's inherited transformation?
845  ///
846  /// Returns true if "!resetXformStack!" appears \em anywhere in xformOpOrder.
847  /// When this returns true, all ops upto the last "!resetXformStack!" in
848  /// xformOpOrder are ignored when computing the local transformation.
849  ///
851  bool GetResetXformStack() const;
852 
853  /// Reorder the already-existing transform ops on this prim.
854  ///
855  /// All elements in \p orderedXformOps must be valid and represent attributes
856  /// on this prim. Note that it is \em not required that all the existing
857  /// operations be present in \p orderedXformOps, so this method can be used to
858  /// completely change the transformation structure applied to the prim.
859  ///
860  /// If \p resetXformStack is set to true, then "!resetXformOp! will be
861  /// set as the first op in xformOpOrder, to indicate that the prim does
862  /// not inherit its parent's transformation.
863  ///
864  /// \note If you wish to re-specify a prim's transformation completely in
865  /// a stronger layer, you should first call this method with an \em empty
866  /// \p orderedXformOps vector. From there you can call AddXformOp() just as if
867  /// you were authoring to the prim from scratch.
868  ///
869  /// \return false if any of the elements of \p orderedXformOps are not extant
870  /// on this prim, or if an error occurred while authoring the ordering
871  /// metadata. Under either condition, no scene description is authored.
872  ///
873  /// \sa GetOrderedXformOps()
875  bool SetXformOpOrder(std::vector<UsdGeomXformOp> const &orderedXformOps,
876  bool resetXformStack = false) const;
877 
878  /// Return the ordered list of transform operations to be applied to
879  /// this prim, in least-to-most-local order. This is determined by the
880  /// intersection of authored op-attributes and the explicit ordering of
881  /// those attributes encoded in the \c xformOpOrder attribute on this prim.
882  /// Any entries in \c xformOpOrder that do not correspond to valid
883  /// attributes on the xformable prim are skipped and a warning is issued.
884  ///
885  /// A UsdGeomTransformable that has not had any ops added via AddXformOp()
886  /// will return an empty vector.
887  ///
888  /// The function also sets \p resetsXformStack to true if "!resetXformStack!"
889  /// appears \em anywhere in xformOpOrder (i.e., if the prim resets its
890  /// parent's inherited transformation).
891  ///
892  /// \note A coding error is issued if resetsXformStack is NULL.
893  ///
894  /// \sa GetResetXformStack()
896  std::vector<UsdGeomXformOp> GetOrderedXformOps(bool *resetsXformStack) const;
897 
898  /// Clears the local transform stack.
900  bool ClearXformOpOrder() const;
901 
902  /// Clears the existing local transform stack and creates a new xform op of
903  /// type 'transform'.
904  ///
905  /// This API is provided for convenience since this is the most common
906  /// xform authoring operation.
907  ///
908  /// \sa ClearXformOpOrder()
909  /// \sa AddTransformOp()
912 
913  /// Determine whether there is any possibility that this prim's \em local
914  /// transformation may vary over time.
915  ///
916  /// The determination is based on a snapshot of the authored state of the
917  /// op attributes on the prim, and may become invalid in the face of
918  /// further authoring.
920  bool TransformMightBeTimeVarying() const;
921 
922  /// \overload
923  /// Determine whether there is any possibility that this prim's \em local
924  /// transformation may vary over time, using a pre-fetched (cached) list of
925  /// ordered xform ops supplied by the client.
926  ///
927  /// The determination is based on a snapshot of the authored state of the
928  /// op attributes on the prim, and may become invalid in the face of
929  /// further authoring.
932  const std::vector<UsdGeomXformOp> &ops) const;
933 
934  /// Sets \p times to the union of all the timesamples at which xformOps that
935  /// are included in the xformOpOrder attribute are authored.
936  ///
937  /// This clears the \p times vector before accumulating sample times
938  /// from all the xformOps.
939  ///
940  /// \sa UsdAttribute::GetTimeSamples
942  bool GetTimeSamples(std::vector<double> *times) const;
943 
944  /// Sets \p times to the union of all the timesamples in the interval,
945  /// \p interval, at which xformOps that are included in the xformOpOrder
946  /// attribute are authored.
947  ///
948  /// This clears the \p times vector before accumulating sample times
949  /// from all the xformOps.
950  ///
951  /// \sa UsdAttribute::GetTimeSamples
953  bool GetTimeSamplesInInterval(const GfInterval &interval,
954  std::vector<double> *times) const;
955 
956  /// Returns the union of all the timesamples at which the attributes
957  /// belonging to the given \p orderedXformOps are authored.
958  ///
959  /// This clears the \p times vector before accumulating sample times
960  /// from \p orderedXformOps.
961  ///
962  /// \sa UsdGeomXformable::GetTimeSamples
964  static bool GetTimeSamples(
965  std::vector<UsdGeomXformOp> const &orderedXformOps,
966  std::vector<double> *times);
967 
968  /// Returns the union of all the timesamples in the \p interval
969  /// at which the attributes belonging to the given \p orderedXformOps
970  /// are authored.
971  ///
972  /// This clears the \p times vector before accumulating sample times
973  /// from \p orderedXformOps.
974  ///
975  /// \sa UsdGeomXformable::GetTimeSamplesInInterval
977  static bool GetTimeSamplesInInterval(
978  std::vector<UsdGeomXformOp> const &orderedXformOps,
979  const GfInterval &interval,
980  std::vector<double> *times);
981 
982  /// Computes the fully-combined, local-to-parent transformation for this prim.
983  ///
984  /// If a client does not need to manipulate the individual ops themselves,
985  /// and requires only the combined transform on this prim, this method will
986  /// take care of all the data marshalling and linear algebra needed to
987  /// combine the ops into a 4x4 affine transformation matrix, in
988  /// double-precision, regardless of the precision of the op inputs.
989  ///
990  /// \param transform is the output parameter that will hold the local
991  /// transform.
992  /// \param resetsXformStack is the output parameter that informs client
993  /// whether they need to reset the transform stack before pushing
994  /// \p transform.
995  /// \param time is the UsdTimeCode at which to sample the ops.
996  ///
997  /// \return true on success, false if there was an error reading data.
998  ///
999  /// \note A coding error is issued if \p transform or \p resetsXformStack
1000  /// is NULL.
1001  ///
1002  USDGEOM_API
1005  bool *resetsXformStack,
1006  const UsdTimeCode time = UsdTimeCode::Default()) const;
1007 
1008  /// \overload
1009  /// Computes the fully-combined, local-to-parent transformation for this
1010  /// prim as efficiently as possible, using a pre-fetched (cached) list of
1011  /// ordered xform ops supplied by the client.
1012  ///
1013  /// \param transform is the output parameter that will hold the local
1014  /// transform.
1015  /// \param resetsXformStack is the output parameter that informs client
1016  /// whether they need to reset the transform stack before pushing
1017  /// \p transform.
1018  /// \param ops is the ordered set of xform ops for this prim, and will be
1019  /// queried without any validity checking. Passing this in can save
1020  /// significant value-resolution costs, if the client is able to
1021  /// retain this data from a call to GetOrderedXformOps().
1022  /// \param time is the UsdTimeCode at which to sample the ops.
1023  ///
1024  /// \return true on success, false if there was an error reading data.
1025  ///
1026  /// \note A coding error is issued if \p transform or \p resetsXformStack
1027  /// is NULL.
1028  ///
1029  USDGEOM_API
1030  bool GetLocalTransformation(GfMatrix4d *transform,
1031  bool *resetsXformStack,
1032  const std::vector<UsdGeomXformOp> &ops,
1033  const UsdTimeCode time = UsdTimeCode::Default()) const;
1034 
1035  /// \overload
1036  /// This is a static version of the preceding function that takes
1037  /// a cached list of ordered xform ops.
1038  ///
1039  /// \param transform is the output parameter that will hold the local
1040  /// transform.
1041  /// \param ops is the ordered set of xform ops that must be combined
1042  /// together to compute the local transformation.
1043  /// \param time is the UsdTimeCode at which to sample the ops.
1044  ///
1045  /// \return true on success, false if there was an error reading data.
1046  ///
1047  USDGEOM_API
1048  static bool GetLocalTransformation(GfMatrix4d *transform,
1049  std::vector<UsdGeomXformOp> const &ops,
1050  const UsdTimeCode time);
1051 
1052  /// Returns true if the attribute named \p attrName could affect the local
1053  /// transformation of an xformable prim.
1054  USDGEOM_API
1055  static bool IsTransformationAffectedByAttrNamed(const TfToken &attrName);
1056 
1057 private:
1058  // Extracts the value of the xformOpOrder attribute. Returns false if
1059  // the xformOpOrder attribute doesn't exist on the prim (eg. when the prim
1060  // type is incompatible or if it's a pure over).
1061  bool _GetXformOpOrderValue(VtTokenArray *xformOpOrder) const;
1062 
1063  // Helper function for getting xformops with or without attribute queries.
1064  std::vector<UsdGeomXformOp>
1065  _GetOrderedXformOps(bool *resetsXformStack,
1066  bool withAttributeQueries) const;
1067 };
1068 
1070 
1071 #endif
USDGEOM_API UsdGeomXformOp GetTranslateOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdAttribute CreateXformOpOrderAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API bool SetResetXformStack(bool resetXform) const
Double precision.
Definition: xformOp.h:141
static constexpr UsdTimeCode Default()
Definition: timeCode.h:113
USDGEOM_API UsdGeomXformOp AddRotateZYXOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddRotateXYZOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetTransformOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
GT_API const UT_StringHolder time
USDGEOM_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
UsdGeomXformable(const UsdPrim &prim=UsdPrim())
Definition: xformable.h:253
USDGEOM_API UsdGeomXformOp AddTransformOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionDouble, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
USDGEOM_API UsdGeomXformOp AddRotateYXZOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddScaleXOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddXformOp(UsdGeomXformOp::Type const opType, UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionDouble, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddScaleYOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetScaleOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetRotateYOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddRotateZOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetScaleYOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API bool HasNonEmptyXformOpOrder() const
Returns whether xformOpOrder is non-empty.
USDGEOM_API UsdGeomXformOp AddRotateYZXOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp MakeMatrixXform() const
USDGEOM_API UsdGeomXformOp AddTranslateYOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionDouble, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetTranslateXOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddRotateZXYOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
USDGEOM_API bool SetXformOpOrder(std::vector< UsdGeomXformOp > const &orderedXformOps, bool resetXformStack=false) const
USDGEOM_API UsdGeomXformOp GetRotateXZYOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetRotateZXYOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API bool GetTimeSamples(std::vector< double > *times) const
bool GetResetXformStack() const
Returns whether the xformable resets its parent's transformation.
Definition: xformable.h:387
USDGEOM_API UsdGeomXformOp GetRotateYZXOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
Definition: token.h:70
Represents a non-concrete typed schema.
USDGEOM_API UsdGeomXformOp AddRotateYOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetScaleZOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API bool GetLocalTransformation(GfMatrix4d *transform, const UsdTimeCode time) const
USDGEOM_API bool GetLocalTransformation(GfMatrix4d *transform, bool *resetsXformStack, const UsdTimeCode time=UsdTimeCode::Default()) const
USDGEOM_API UsdGeomXformOp GetRotateXYZOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddScaleZOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetRotateXOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetRotateZOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
Floating-point precision.
Definition: xformOp.h:142
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USDGEOM_API UsdGeomXformOp AddOrientOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
Definition: path.h:273
USDGEOM_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
USDGEOM_API UsdGeomXformOp GetTranslateYOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddRotateXZYOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
GA_API const UT_StringHolder transform
USDGEOM_API UsdGeomXformOp GetTranslateZOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
static USDGEOM_API UsdGeomXformable Get(const UsdStagePtr &stage, const SdfPath &path)
USDGEOM_API bool IsAttributeIncludedInLocalTransform(const TfToken &attrName) const
static const UsdSchemaKind schemaKind
Definition: xformable.h:247
GLenum GLint GLint * precision
Definition: glcorearb.h:1925
UsdSchemaKind
Definition: common.h:112
USDGEOM_API UsdGeomXformOp GetRotateZYXOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API bool TransformMightBeTimeVarying() const
USDGEOM_API bool GetResetXformStack() const
USDGEOM_API UsdGeomXformOp AddTranslateXOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionDouble, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetXformOp(UsdGeomXformOp::Type const opType, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDGEOM_API UsdGeomXformOp AddTranslateOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionDouble, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetScaleXOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp AddTranslateZOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionDouble, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
UsdGeomXformable(const UsdSchemaBase &schemaObj)
Definition: xformable.h:261
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDGEOM_API UsdGeomXformOp AddScaleOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdAttribute GetXformOpOrderAttr() const
Definition: type.h:47
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Type
Enumerates the set of all transformation operation types.
Definition: xformOp.h:110
#define USDGEOM_API
Definition: api.h:23
USDGEOM_API bool TransformMightBeTimeVarying() const
Returns whether the xform value might change over time.
USDGEOM_API std::vector< UsdGeomXformOp > GetOrderedXformOps(bool *resetsXformStack) const
USDGEOM_API UsdGeomXformOp AddRotateXOp(UsdGeomXformOp::Precision const precision=UsdGeomXformOp::PrecisionFloat, TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API bool GetTimeSamples(std::vector< double > *times) const
USDGEOM_API bool ClearXformOpOrder() const
Clears the local transform stack.
static USDGEOM_API bool IsTransformationAffectedByAttrNamed(const TfToken &attrName)
Definition: value.h:146
USDGEOM_API UsdGeomXformOp GetRotateYXZOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
USDGEOM_API UsdGeomXformOp GetOrientOp(TfToken const &opSuffix=TfToken(), bool isInverseOp=false) const
Precision
Precision of the encoded transformation operation's value.
Definition: xformOp.h:140
virtual USDGEOM_API ~UsdGeomXformable()
Destructor.