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
boundable.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_BOUNDABLE_H
8#define USDGEOM_GENERATED_BOUNDABLE_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// BOUNDABLE //
34// -------------------------------------------------------------------------- //
35
66{
67public:
71 static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
72
77 explicit UsdGeomBoundable(const UsdPrim& prim=UsdPrim())
78 : UsdGeomXformable(prim)
79 {
80 }
81
85 explicit UsdGeomBoundable(const UsdSchemaBase& schemaObj)
86 : UsdGeomXformable(schemaObj)
87 {
88 }
89
91 USDGEOM_API
93
97 USDGEOM_API
98 static const TfTokenVector &
99 GetSchemaAttributeNames(bool includeInherited=true);
100
110 USDGEOM_API
111 static UsdGeomBoundable
112 Get(const UsdStagePtr &stage, const SdfPath &path);
113
114
115protected:
119 USDGEOM_API
121
122private:
123 // needs to invoke _GetStaticTfType.
124 friend class UsdSchemaRegistry;
125 USDGEOM_API
126 static const TfType &_GetStaticTfType();
127
128 static bool _IsTypedSchema();
129
130 // override SchemaBase virtuals.
131 USDGEOM_API
132 const TfType &_GetTfType() const override;
133
134public:
135 // --------------------------------------------------------------------- //
136 // EXTENT
137 // --------------------------------------------------------------------- //
160 USDGEOM_API
162
168 USDGEOM_API
169 UsdAttribute CreateExtentAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
170
171public:
172 // ===================================================================== //
173 // Feel free to add custom code below this line, it will be preserved by
174 // the code generator.
175 //
176 // Just remember to:
177 // - Close the class declaration with };
178 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
179 // - Close the include guard with #endif
180 // ===================================================================== //
181 // --(BEGIN CUSTOM CODE)--
182
191 USDGEOM_API
192 bool ComputeExtent(const UsdTimeCode &time, VtVec3fArray *extent) const;
193
209 USDGEOM_API
210 static bool ComputeExtentFromPlugins(const UsdGeomBoundable &boundable,
211 const UsdTimeCode &time,
212 VtVec3fArray *extent);
213
216 USDGEOM_API
217 static bool ComputeExtentFromPlugins(const UsdGeomBoundable &boundable,
218 const UsdTimeCode &time,
219 const GfMatrix4d &transform,
220 VtVec3fArray *extent);
221
222};
223
224PXR_NAMESPACE_CLOSE_SCOPE
225
226#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
Boundable introduces the ability for a prim to persistently cache a rectilinear, local-space,...
Definition: boundable.h:66
USDGEOM_API bool ComputeExtent(const UsdTimeCode &time, VtVec3fArray *extent) const
If an extent is authored on this boundable, it queries the extent from the extent attribute,...
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: boundable.h:71
static USDGEOM_API bool ComputeExtentFromPlugins(const UsdGeomBoundable &boundable, const UsdTimeCode &time, VtVec3fArray *extent)
Compute the extent for the Boundable prim boundable at time time.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
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 ComputeExtentFromPlugins(const UsdGeomBoundable &boundable, const UsdTimeCode &time, const GfMatrix4d &transform, VtVec3fArray *extent)
This is an overloaded member function, provided for convenience. It differs from the above function o...
UsdGeomBoundable(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomBoundable on UsdPrim prim .
Definition: boundable.h:77
USDGEOM_API UsdAttribute GetExtentAttr() const
Extent is a three dimensional range measuring the geometric extent of the authored gprim in its own l...
UsdGeomBoundable(const UsdSchemaBase &schemaObj)
Construct a UsdGeomBoundable on the prim held by schemaObj .
Definition: boundable.h:85
static USDGEOM_API UsdGeomBoundable Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomBoundable holding the prim adhering to this schema at path on stage.
virtual USDGEOM_API ~UsdGeomBoundable()
Destructor.
Base class for all transformable prims, which allows arbitrary sequences of component affine transfor...
Definition: xformable.h:236
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...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:67
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