cylinder.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_CYLINDER_H
8 #define USDGEOM_GENERATED_CYLINDER_H
9 
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdGeom/api.h"
14 #include "pxr/usd/usdGeom/gprim.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/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 
28 PXR_NAMESPACE_OPEN_SCOPE
29 
30 class SdfAssetPath;
31 
32 // -------------------------------------------------------------------------- //
33 // CYLINDER //
34 // -------------------------------------------------------------------------- //
35 
50 {
51 public:
56 
61  explicit UsdGeomCylinder(const UsdPrim& prim=UsdPrim())
62  : UsdGeomGprim(prim)
63  {
64  }
65 
69  explicit UsdGeomCylinder(const UsdSchemaBase& schemaObj)
70  : UsdGeomGprim(schemaObj)
71  {
72  }
73 
75  USDGEOM_API
76  virtual ~UsdGeomCylinder();
77 
81  USDGEOM_API
82  static const TfTokenVector &
83  GetSchemaAttributeNames(bool includeInherited=true);
84 
94  USDGEOM_API
95  static UsdGeomCylinder
96  Get(const UsdStagePtr &stage, const SdfPath &path);
97 
120  USDGEOM_API
121  static UsdGeomCylinder
122  Define(const UsdStagePtr &stage, const SdfPath &path);
123 
124 protected:
128  USDGEOM_API
129  UsdSchemaKind _GetSchemaKind() const override;
130 
131 private:
132  // needs to invoke _GetStaticTfType.
133  friend class UsdSchemaRegistry;
134  USDGEOM_API
135  static const TfType &_GetStaticTfType();
136 
137  static bool _IsTypedSchema();
138 
139  // override SchemaBase virtuals.
140  USDGEOM_API
141  const TfType &_GetTfType() const override;
142 
143 public:
144  // --------------------------------------------------------------------- //
145  // HEIGHT
146  // --------------------------------------------------------------------- //
157  USDGEOM_API
158  UsdAttribute GetHeightAttr() const;
159 
165  USDGEOM_API
166  UsdAttribute CreateHeightAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
167 
168 public:
169  // --------------------------------------------------------------------- //
170  // RADIUS
171  // --------------------------------------------------------------------- //
182  USDGEOM_API
183  UsdAttribute GetRadiusAttr() const;
184 
190  USDGEOM_API
191  UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
192 
193 public:
194  // --------------------------------------------------------------------- //
195  // AXIS
196  // --------------------------------------------------------------------- //
206  USDGEOM_API
207  UsdAttribute GetAxisAttr() const;
208 
214  USDGEOM_API
215  UsdAttribute CreateAxisAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
216 
217 public:
218  // --------------------------------------------------------------------- //
219  // EXTENT
220  // --------------------------------------------------------------------- //
229  USDGEOM_API
230  UsdAttribute GetExtentAttr() const;
231 
237  USDGEOM_API
238  UsdAttribute CreateExtentAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
239 
240 public:
241  // ===================================================================== //
242  // Feel free to add custom code below this line, it will be preserved by
243  // the code generator.
244  //
245  // Just remember to:
246  // - Close the class declaration with };
247  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
248  // - Close the include guard with #endif
249  // ===================================================================== //
250  // --(BEGIN CUSTOM CODE)--
251 
263  USDGEOM_API
264  static bool ComputeExtent(double height, double radius, const TfToken& axis,
265  VtVec3fArray* extent);
266 
269  USDGEOM_API
270  static bool ComputeExtent(double height, double radius, const TfToken& axis,
271  const GfMatrix4d& transform, VtVec3fArray* extent);
272 };
273 
274 #define USDGEOM_CYLINDER_API_VERSION 1
275 
276 PXR_NAMESPACE_CLOSE_SCOPE
277 
278 #endif // USDGEOM_GENERATED_CYLINDER_H
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDGEOM_API UsdAttribute GetHeightAttr() const
The size of the cylinder's spine along the specified axis.
USDGEOM_API UsdAttribute GetAxisAttr() const
The axis along which the spine of the cylinder is aligned.
UsdGeomCylinder(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCylinder on the prim held by schemaObj .
Definition: cylinder.h:69
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
USDGEOM_API UsdAttribute CreateExtentAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExtentAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDGEOM_API UsdGeomCylinder Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomCylinder holding the prim adhering to this schema at path on stage.
USDGEOM_API UsdAttribute GetExtentAttr() const
Extent is re-defined on Cylinder only to provide a fallback value.
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: cylinder.h:55
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:70
UsdGeomCylinder(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomCylinder on UsdPrim prim .
Definition: cylinder.h:61
Represents a concrete typed schema.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:489
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
virtual USDGEOM_API ~UsdGeomCylinder()
Destructor.
USDGEOM_API UsdAttribute CreateRadiusAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetRadiusAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
Base class for all geometric primitives.
Definition: gprim.h:49
static USDGEOM_API bool ComputeExtent(double height, double radius, const TfToken &axis, VtVec3fArray *extent)
Compute the extent for the cylinder defined by the height, radius, and axis.
Defines a primitive cylinder with closed ends, centered at the origin, whose spine is along the speci...
Definition: cylinder.h:49
USDGEOM_API UsdAttribute CreateAxisAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetAxisAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
TfType represents a dynamic runtime type.
Definition: type.h:47
Singleton registry that provides access to schema type information and the prim definitions for regis...
USDGEOM_API UsdAttribute GetRadiusAttr() const
The radius of the cylinder.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDGEOM_API UsdAttribute CreateHeightAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetHeightAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
The base class for all schema types in Usd.
Definition: schemaBase.h:39
static USDGEOM_API UsdGeomCylinder Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:89
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...