HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
prismaticJoint.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 USDPHYSICS_GENERATED_PRISMATICJOINT_H
8 #define USDPHYSICS_GENERATED_PRISMATICJOINT_H
9 
10 /// \file usdPhysics/prismaticJoint.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdPhysics/api.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
18 
19 #include "pxr/base/vt/value.h"
20 
21 #include "pxr/base/gf/vec3d.h"
22 #include "pxr/base/gf/vec3f.h"
23 #include "pxr/base/gf/matrix4d.h"
24 
25 #include "pxr/base/tf/token.h"
26 #include "pxr/base/tf/type.h"
27 
29 
30 class SdfAssetPath;
31 
32 // -------------------------------------------------------------------------- //
33 // PHYSICSPRISMATICJOINT //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdPhysicsPrismaticJoint
37 ///
38 /// Predefined prismatic joint type (translation along prismatic
39 /// joint axis is permitted.)
40 ///
41 /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
42 /// that are text/tokens, the actual token is published and defined in \ref UsdPhysicsTokens.
43 /// So to set an attribute to the value "rightHanded", use UsdPhysicsTokens->rightHanded
44 /// as the value.
45 ///
47 {
48 public:
49  /// Compile time constant representing what kind of schema this class is.
50  ///
51  /// \sa UsdSchemaKind
53 
54  /// Construct a UsdPhysicsPrismaticJoint on UsdPrim \p prim .
55  /// Equivalent to UsdPhysicsPrismaticJoint::Get(prim.GetStage(), prim.GetPath())
56  /// for a \em valid \p prim, but will not immediately throw an error for
57  /// an invalid \p prim
58  explicit UsdPhysicsPrismaticJoint(const UsdPrim& prim=UsdPrim())
59  : UsdPhysicsJoint(prim)
60  {
61  }
62 
63  /// Construct a UsdPhysicsPrismaticJoint on the prim held by \p schemaObj .
64  /// Should be preferred over UsdPhysicsPrismaticJoint(schemaObj.GetPrim()),
65  /// as it preserves SchemaBase state.
66  explicit UsdPhysicsPrismaticJoint(const UsdSchemaBase& schemaObj)
67  : UsdPhysicsJoint(schemaObj)
68  {
69  }
70 
71  /// Destructor.
73  virtual ~UsdPhysicsPrismaticJoint();
74 
75  /// Return a vector of names of all pre-declared attributes for this schema
76  /// class and all its ancestor classes. Does not include attributes that
77  /// may be authored by custom/extended methods of the schemas involved.
79  static const TfTokenVector &
80  GetSchemaAttributeNames(bool includeInherited=true);
81 
82  /// Return a UsdPhysicsPrismaticJoint holding the prim adhering to this
83  /// schema at \p path on \p stage. If no prim exists at \p path on
84  /// \p stage, or if the prim at that path does not adhere to this schema,
85  /// return an invalid schema object. This is shorthand for the following:
86  ///
87  /// \code
88  /// UsdPhysicsPrismaticJoint(stage->GetPrimAtPath(path));
89  /// \endcode
90  ///
93  Get(const UsdStagePtr &stage, const SdfPath &path);
94 
95  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
96  /// is defined (according to UsdPrim::IsDefined()) on this stage.
97  ///
98  /// If a prim adhering to this schema at \p path is already defined on this
99  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
100  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
101  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
102  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
103  /// current EditTarget for any nonexistent, or existing but not \a Defined
104  /// ancestors.
105  ///
106  /// The given \a path must be an absolute prim path that does not contain
107  /// any variant selections.
108  ///
109  /// If it is impossible to author any of the necessary PrimSpecs, (for
110  /// example, in case \a path cannot map to the current UsdEditTarget's
111  /// namespace) issue an error and return an invalid \a UsdPrim.
112  ///
113  /// Note that this method may return a defined prim whose typeName does not
114  /// specify this schema class, in case a stronger typeName opinion overrides
115  /// the opinion at the current EditTarget.
116  ///
119  Define(const UsdStagePtr &stage, const SdfPath &path);
120 
121 protected:
122  /// Returns the kind of schema this class belongs to.
123  ///
124  /// \sa UsdSchemaKind
126  UsdSchemaKind _GetSchemaKind() const override;
127 
128 private:
129  // needs to invoke _GetStaticTfType.
130  friend class UsdSchemaRegistry;
132  static const TfType &_GetStaticTfType();
133 
134  static bool _IsTypedSchema();
135 
136  // override SchemaBase virtuals.
138  const TfType &_GetTfType() const override;
139 
140 public:
141  // --------------------------------------------------------------------- //
142  // AXIS
143  // --------------------------------------------------------------------- //
144  /// Joint axis.
145  ///
146  /// | ||
147  /// | -- | -- |
148  /// | Declaration | `uniform token physics:axis = "X"` |
149  /// | C++ Type | TfToken |
150  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
151  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
152  /// | \ref UsdPhysicsTokens "Allowed Values" | X, Y, Z |
154  UsdAttribute GetAxisAttr() const;
155 
156  /// See GetAxisAttr(), and also
157  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
158  /// If specified, author \p defaultValue as the attribute's default,
159  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
160  /// the default for \p writeSparsely is \c false.
162  UsdAttribute CreateAxisAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
163 
164 public:
165  // --------------------------------------------------------------------- //
166  // LOWERLIMIT
167  // --------------------------------------------------------------------- //
168  /// Lower limit. Units: distance. -inf means not limited in
169  /// negative direction.
170  ///
171  /// | ||
172  /// | -- | -- |
173  /// | Declaration | `float physics:lowerLimit = -inf` |
174  /// | C++ Type | float |
175  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
178 
179  /// See GetLowerLimitAttr(), and also
180  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
181  /// If specified, author \p defaultValue as the attribute's default,
182  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
183  /// the default for \p writeSparsely is \c false.
185  UsdAttribute CreateLowerLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
186 
187 public:
188  // --------------------------------------------------------------------- //
189  // UPPERLIMIT
190  // --------------------------------------------------------------------- //
191  /// Upper limit. Units: distance. inf means not limited in
192  /// positive direction.
193  ///
194  /// | ||
195  /// | -- | -- |
196  /// | Declaration | `float physics:upperLimit = inf` |
197  /// | C++ Type | float |
198  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
201 
202  /// See GetUpperLimitAttr(), and also
203  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
204  /// If specified, author \p defaultValue as the attribute's default,
205  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
206  /// the default for \p writeSparsely is \c false.
208  UsdAttribute CreateUpperLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
209 
210 public:
211  // ===================================================================== //
212  // Feel free to add custom code below this line, it will be preserved by
213  // the code generator.
214  //
215  // Just remember to:
216  // - Close the class declaration with };
217  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
218  // - Close the include guard with #endif
219  // ===================================================================== //
220  // --(BEGIN CUSTOM CODE)--
221 };
222 
224 
225 #endif
virtual USDPHYSICS_API ~UsdPhysicsPrismaticJoint()
Destructor.
UsdPhysicsPrismaticJoint(const UsdSchemaBase &schemaObj)
USDPHYSICS_API UsdAttribute CreateAxisAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdPhysicsPrismaticJoint(const UsdPrim &prim=UsdPrim())
static USDPHYSICS_API UsdPhysicsPrismaticJoint Get(const UsdStagePtr &stage, const SdfPath &path)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
USDPHYSICS_API UsdAttribute CreateLowerLimitAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Represents a concrete typed schema.
USDPHYSICS_API UsdAttribute GetAxisAttr() const
static USDPHYSICS_API UsdPhysicsPrismaticJoint Define(const UsdStagePtr &stage, const SdfPath &path)
USDPHYSICS_API UsdAttribute CreateUpperLimitAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USDPHYSICS_API UsdSchemaKind _GetSchemaKind() const override
Definition: path.h:273
static const UsdSchemaKind schemaKind
#define USDPHYSICS_API
Definition: api.h:23
UsdSchemaKind
Definition: common.h:112
static USDPHYSICS_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDPHYSICS_API UsdAttribute GetLowerLimitAttr() const
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
USDPHYSICS_API UsdAttribute GetUpperLimitAttr() const
Definition: value.h:146