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
cube.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_CUBE_H
8#define USDGEOM_GENERATED_CUBE_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// CUBE //
34// -------------------------------------------------------------------------- //
35
44{
45public:
49 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
50
55 explicit UsdGeomCube(const UsdPrim& prim=UsdPrim())
56 : UsdGeomGprim(prim)
57 {
58 }
59
63 explicit UsdGeomCube(const UsdSchemaBase& schemaObj)
64 : UsdGeomGprim(schemaObj)
65 {
66 }
67
69 USDGEOM_API
70 virtual ~UsdGeomCube();
71
75 USDGEOM_API
76 static const TfTokenVector &
77 GetSchemaAttributeNames(bool includeInherited=true);
78
88 USDGEOM_API
89 static UsdGeomCube
90 Get(const UsdStagePtr &stage, const SdfPath &path);
91
114 USDGEOM_API
115 static UsdGeomCube
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 // SIZE
140 // --------------------------------------------------------------------- //
151 USDGEOM_API
153
159 USDGEOM_API
160 UsdAttribute CreateSizeAttr(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 size, VtVec3fArray* extent);
209
212 USDGEOM_API
213 static bool ComputeExtent(double size, 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 an optional resolved path.
Definition: assetPath.h:30
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:160
Defines a primitive rectilinear cube centered at the origin.
Definition: cube.h:44
USDGEOM_API UsdAttribute CreateSizeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSizeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
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 bool ComputeExtent(double size, VtVec3fArray *extent)
Compute the extent for the cube defined by the size of each dimension.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: cube.h:49
static USDGEOM_API bool ComputeExtent(double size, const GfMatrix4d &transform, VtVec3fArray *extent)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDGEOM_API UsdGeomCube Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
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...
UsdGeomCube(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCube on the prim held by schemaObj .
Definition: cube.h:63
static USDGEOM_API UsdGeomCube Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomCube holding the prim adhering to this schema at path on stage.
virtual USDGEOM_API ~UsdGeomCube()
Destructor.
USDGEOM_API UsdAttribute GetSizeAttr() const
Indicates the length of each edge of the cube.
USDGEOM_API UsdAttribute GetExtentAttr() const
Extent is re-defined on Cube only to provide a fallback value.
UsdGeomCube(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomCube on UsdPrim prim .
Definition: cube.h:55
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