Loading...
Searching...
No Matches
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"
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// SPHERE //
34// -------------------------------------------------------------------------- //
35
44{
45public:
49 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
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
118protected:
122 USDGEOM_API
124
125private:
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
137public:
138 // --------------------------------------------------------------------- //
139 // RADIUS
140 // --------------------------------------------------------------------- //
151 USDGEOM_API
153
159 USDGEOM_API
160 UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
161
162public:
163 // --------------------------------------------------------------------- //
164 // EXTENT
165 // --------------------------------------------------------------------- //
174 USDGEOM_API
176
182 USDGEOM_API
183 UsdAttribute CreateExtentAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
184
185public:
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
217PXR_NAMESPACE_CLOSE_SCOPE
218
219#endif
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
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:183
Base class for all geometric primitives.
Definition: gprim.h:50
Defines a primitive sphere centered at the origin.
Definition: sphere.h:44
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 UsdGeomSphere Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomSphere holding the prim adhering to this schema at path on stage.
static USDGEOM_API bool ComputeExtent(double radius, const GfMatrix4d &transform, VtVec3fArray *extent)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: sphere.h:49
virtual USDGEOM_API ~UsdGeomSphere()
Destructor.
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...
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 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...
static USDGEOM_API bool ComputeExtent(double radius, VtVec3fArray *extent)
Compute the extent for the sphere defined by the radius.
UsdGeomSphere(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomSphere on UsdPrim prim .
Definition: sphere.h:55
USDGEOM_API UsdAttribute GetRadiusAttr() const
Indicates the sphere's radius.
UsdGeomSphere(const UsdSchemaBase &schemaObj)
Construct a UsdGeomSphere on the prim held by schemaObj .
Definition: sphere.h:63
USDGEOM_API UsdAttribute GetExtentAttr() const
Extent is re-defined on Sphere only to provide a fallback value.
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:90
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