This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"
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"
24
25#include "pxr/base/tf/token.h"
26#include "pxr/base/tf/type.h"
27
28PXR_NAMESPACE_OPEN_SCOPE
29
30class SdfAssetPath;
31
32// -------------------------------------------------------------------------- //
33// CYLINDER //
34// -------------------------------------------------------------------------- //
35
50{
51public:
55 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
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
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
124protected:
128 USDGEOM_API
130
131private:
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
143public:
144 // --------------------------------------------------------------------- //
145 // HEIGHT
146 // --------------------------------------------------------------------- //
157 USDGEOM_API
159
165 USDGEOM_API
166 UsdAttribute CreateHeightAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
167
168public:
169 // --------------------------------------------------------------------- //
170 // RADIUS
171 // --------------------------------------------------------------------- //
182 USDGEOM_API
184
190 USDGEOM_API
191 UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
192
193public:
194 // --------------------------------------------------------------------- //
195 // AXIS
196 // --------------------------------------------------------------------- //
206 USDGEOM_API
208
214 USDGEOM_API
215 UsdAttribute CreateAxisAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
216
217public:
218 // --------------------------------------------------------------------- //
219 // EXTENT
220 // --------------------------------------------------------------------- //
229 USDGEOM_API
231
237 USDGEOM_API
238 UsdAttribute CreateExtentAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
239
240public:
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
276PXR_NAMESPACE_CLOSE_SCOPE
277
278#endif // USDGEOM_GENERATED_CYLINDER_H
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
Defines a primitive cylinder with closed ends, centered at the origin, whose spine is along the speci...
Definition: cylinder.h:50
UsdGeomCylinder(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCylinder on the prim held by schemaObj .
Definition: cylinder.h:69
UsdGeomCylinder(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomCylinder on UsdPrim prim .
Definition: cylinder.h:61
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.
virtual USDGEOM_API ~UsdGeomCylinder()
Destructor.
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 const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: cylinder.h:55
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
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.
static USDGEOM_API bool ComputeExtent(double height, double radius, const TfToken &axis, const GfMatrix4d &transform, VtVec3fArray *extent)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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.
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 GetAxisAttr() const
The axis along which the spine of the cylinder is aligned.
USDGEOM_API UsdAttribute GetHeightAttr() const
The size of the cylinder's spine along the specified axis.
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.
USDGEOM_API UsdAttribute GetRadiusAttr() const
The radius of the cylinder.
USDGEOM_API UsdAttribute GetExtentAttr() const
Extent is re-defined on Cylinder only to provide a fallback value.
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...
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.
Base class for all geometric primitives.
Definition: gprim.h:50
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440