HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xform.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_XFORM_H
8 #define USDGEOM_GENERATED_XFORM_H
9 
10 /// \file usdGeom/xform.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 
18 #include "pxr/base/vt/value.h"
19 
20 #include "pxr/base/gf/vec3d.h"
21 #include "pxr/base/gf/vec3f.h"
22 #include "pxr/base/gf/matrix4d.h"
23 
24 #include "pxr/base/tf/token.h"
25 #include "pxr/base/tf/type.h"
26 
28 
29 class SdfAssetPath;
30 
31 // -------------------------------------------------------------------------- //
32 // XFORM //
33 // -------------------------------------------------------------------------- //
34 
35 /// \class UsdGeomXform
36 ///
37 /// Concrete prim schema for a transform, which implements Xformable
38 ///
40 {
41 public:
42  /// Compile time constant representing what kind of schema this class is.
43  ///
44  /// \sa UsdSchemaKind
46 
47  /// Construct a UsdGeomXform on UsdPrim \p prim .
48  /// Equivalent to UsdGeomXform::Get(prim.GetStage(), prim.GetPath())
49  /// for a \em valid \p prim, but will not immediately throw an error for
50  /// an invalid \p prim
51  explicit UsdGeomXform(const UsdPrim& prim=UsdPrim())
52  : UsdGeomXformable(prim)
53  {
54  }
55 
56  /// Construct a UsdGeomXform on the prim held by \p schemaObj .
57  /// Should be preferred over UsdGeomXform(schemaObj.GetPrim()),
58  /// as it preserves SchemaBase state.
59  explicit UsdGeomXform(const UsdSchemaBase& schemaObj)
60  : UsdGeomXformable(schemaObj)
61  {
62  }
63 
64  /// Destructor.
66  virtual ~UsdGeomXform();
67 
68  /// Return a vector of names of all pre-declared attributes for this schema
69  /// class and all its ancestor classes. Does not include attributes that
70  /// may be authored by custom/extended methods of the schemas involved.
72  static const TfTokenVector &
73  GetSchemaAttributeNames(bool includeInherited=true);
74 
75  /// Return a UsdGeomXform holding the prim adhering to this
76  /// schema at \p path on \p stage. If no prim exists at \p path on
77  /// \p stage, or if the prim at that path does not adhere to this schema,
78  /// return an invalid schema object. This is shorthand for the following:
79  ///
80  /// \code
81  /// UsdGeomXform(stage->GetPrimAtPath(path));
82  /// \endcode
83  ///
85  static UsdGeomXform
86  Get(const UsdStagePtr &stage, const SdfPath &path);
87 
88  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
89  /// is defined (according to UsdPrim::IsDefined()) on this stage.
90  ///
91  /// If a prim adhering to this schema at \p path is already defined on this
92  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
93  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
94  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
95  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
96  /// current EditTarget for any nonexistent, or existing but not \a Defined
97  /// ancestors.
98  ///
99  /// The given \a path must be an absolute prim path that does not contain
100  /// any variant selections.
101  ///
102  /// If it is impossible to author any of the necessary PrimSpecs, (for
103  /// example, in case \a path cannot map to the current UsdEditTarget's
104  /// namespace) issue an error and return an invalid \a UsdPrim.
105  ///
106  /// Note that this method may return a defined prim whose typeName does not
107  /// specify this schema class, in case a stronger typeName opinion overrides
108  /// the opinion at the current EditTarget.
109  ///
111  static UsdGeomXform
112  Define(const UsdStagePtr &stage, const SdfPath &path);
113 
114 protected:
115  /// Returns the kind of schema this class belongs to.
116  ///
117  /// \sa UsdSchemaKind
119  UsdSchemaKind _GetSchemaKind() const override;
120 
121 private:
122  // needs to invoke _GetStaticTfType.
123  friend class UsdSchemaRegistry;
125  static const TfType &_GetStaticTfType();
126 
127  static bool _IsTypedSchema();
128 
129  // override SchemaBase virtuals.
131  const TfType &_GetTfType() const override;
132 
133 public:
134  // ===================================================================== //
135  // Feel free to add custom code below this line, it will be preserved by
136  // the code generator.
137  //
138  // Just remember to:
139  // - Close the class declaration with };
140  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
141  // - Close the include guard with #endif
142  // ===================================================================== //
143  // --(BEGIN CUSTOM CODE)--
144 };
145 
147 
148 #endif
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UsdGeomXform(const UsdPrim &prim=UsdPrim())
Definition: xform.h:51
static USDGEOM_API UsdGeomXform Define(const UsdStagePtr &stage, const SdfPath &path)
virtual USDGEOM_API ~UsdGeomXform()
Destructor.
Represents a concrete typed schema.
UsdGeomXform(const UsdSchemaBase &schemaObj)
Definition: xform.h:59
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
UsdSchemaKind
Definition: common.h:112
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
#define USDGEOM_API
Definition: api.h:23
static const UsdSchemaKind schemaKind
Definition: xform.h:45
static USDGEOM_API UsdGeomXform Get(const UsdStagePtr &stage, const SdfPath &path)