sphere.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_SPHERE_H
8 #define USDGEOM_GENERATED_SPHERE_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 // SPHERE //
34 // -------------------------------------------------------------------------- //
35 
44 {
45 public:
50 
55  explicit UsdGeomSphere(const UsdPrim& prim=UsdPrim())
56  : UsdGeomGprim(prim)
57  {
58  }
59 
63  explicit UsdGeomSphere(const UsdSchemaBase& schemaObj)
64  : UsdGeomGprim(schemaObj)
65  {
66  }
67 
69  USDGEOM_API
70  virtual ~UsdGeomSphere();
71 
75  USDGEOM_API
76  static const TfTokenVector &
77  GetSchemaAttributeNames(bool includeInherited=true);
78 
88  USDGEOM_API
89  static UsdGeomSphere
90  Get(const UsdStagePtr &stage, const SdfPath &path);
91 
114  USDGEOM_API
115  static UsdGeomSphere
116  Define(const UsdStagePtr &stage, const SdfPath &path);
117 
118 protected:
122  USDGEOM_API
123  UsdSchemaKind _GetSchemaKind() const override;
124 
125 private:
126  // needs to invoke _GetStaticTfType.
127  friend class UsdSchemaRegistry;
128  USDGEOM_API
129  static const TfType &_GetStaticTfType();
130 
131  static bool _IsTypedSchema();
132 
133  // override SchemaBase virtuals.
134  USDGEOM_API
135  const TfType &_GetTfType() const override;
136 
137 public:
138  // --------------------------------------------------------------------- //
139  // RADIUS
140  // --------------------------------------------------------------------- //
151  USDGEOM_API
152  UsdAttribute GetRadiusAttr() const;
153 
159  USDGEOM_API
160  UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
161 
162 public:
163  // --------------------------------------------------------------------- //
164  // EXTENT
165  // --------------------------------------------------------------------- //
174  USDGEOM_API
175  UsdAttribute GetExtentAttr() const;
176 
182  USDGEOM_API
183  UsdAttribute CreateExtentAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
184 
185 public:
186  // ===================================================================== //
187  // Feel free to add custom code below this line, it will be preserved by
188  // the code generator.
189  //
190  // Just remember to:
191  // - Close the class declaration with };
192  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
193  // - Close the include guard with #endif
194  // ===================================================================== //
195  // --(BEGIN CUSTOM CODE)--
196 
207  USDGEOM_API
208  static bool ComputeExtent(double radius, VtVec3fArray* extent);
209 
212  USDGEOM_API
213  static bool ComputeExtent(double radius, const GfMatrix4d& transform,
214  VtVec3fArray* extent);
215 };
216 
217 PXR_NAMESPACE_CLOSE_SCOPE
218 
219 #endif
UsdGeomSphere(const UsdSchemaBase &schemaObj)
Construct a UsdGeomSphere on the prim held by schemaObj .
Definition: sphere.h:63
UsdGeomSphere(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomSphere on UsdPrim prim .
Definition: sphere.h:55
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: sphere.h:49
static USDGEOM_API UsdGeomSphere Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
virtual USDGEOM_API ~UsdGeomSphere()
Destructor.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
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...
Defines a primitive sphere centered at the origin.
Definition: sphere.h:43
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:70
Represents a concrete typed schema.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
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
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.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
static USDGEOM_API bool ComputeExtent(double radius, VtVec3fArray *extent)
Compute the extent for the sphere defined by the radius.
USDGEOM_API UsdAttribute GetRadiusAttr() const
Indicates the sphere's radius.
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.
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
static USDGEOM_API UsdGeomSphere Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomSphere holding the prim adhering to this schema at path on stage.
Base class for all geometric primitives.
Definition: gprim.h:49
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...
The base class for all schema types in Usd.
Definition: schemaBase.h:39
USDGEOM_API UsdAttribute GetExtentAttr() const
Extent is re-defined on Sphere only to provide a fallback value.
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...