All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
var.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 USDRENDER_GENERATED_VAR_H
8#define USDRENDER_GENERATED_VAR_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdRender/api.h"
14#include "pxr/usd/usd/typed.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// RENDERVAR //
34// -------------------------------------------------------------------------- //
35
57class UsdRenderVar : public UsdTyped
58{
59public:
63 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
64
69 explicit UsdRenderVar(const UsdPrim& prim=UsdPrim())
70 : UsdTyped(prim)
71 {
72 }
73
77 explicit UsdRenderVar(const UsdSchemaBase& schemaObj)
78 : UsdTyped(schemaObj)
79 {
80 }
81
83 USDRENDER_API
84 virtual ~UsdRenderVar();
85
89 USDRENDER_API
90 static const TfTokenVector &
91 GetSchemaAttributeNames(bool includeInherited=true);
92
102 USDRENDER_API
103 static UsdRenderVar
104 Get(const UsdStagePtr &stage, const SdfPath &path);
105
128 USDRENDER_API
129 static UsdRenderVar
130 Define(const UsdStagePtr &stage, const SdfPath &path);
131
132protected:
136 USDRENDER_API
138
139private:
140 // needs to invoke _GetStaticTfType.
141 friend class UsdSchemaRegistry;
142 USDRENDER_API
143 static const TfType &_GetStaticTfType();
144
145 static bool _IsTypedSchema();
146
147 // override SchemaBase virtuals.
148 USDRENDER_API
149 const TfType &_GetTfType() const override;
150
151public:
152 // --------------------------------------------------------------------- //
153 // DATATYPE
154 // --------------------------------------------------------------------- //
163 USDRENDER_API
165
171 USDRENDER_API
172 UsdAttribute CreateDataTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
173
174public:
175 // --------------------------------------------------------------------- //
176 // SOURCENAME
177 // --------------------------------------------------------------------- //
187 USDRENDER_API
189
195 USDRENDER_API
196 UsdAttribute CreateSourceNameAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
197
198public:
199 // --------------------------------------------------------------------- //
200 // SOURCETYPE
201 // --------------------------------------------------------------------- //
229 USDRENDER_API
231
237 USDRENDER_API
238 UsdAttribute CreateSourceTypeAttr(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};
252
253PXR_NAMESPACE_CLOSE_SCOPE
254
255#endif
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
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A UsdRenderVar describes a custom data variable for a render to produce.
Definition: var.h:58
static USDRENDER_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...
UsdRenderVar(const UsdSchemaBase &schemaObj)
Construct a UsdRenderVar on the prim held by schemaObj .
Definition: var.h:77
UsdRenderVar(const UsdPrim &prim=UsdPrim())
Construct a UsdRenderVar on UsdPrim prim .
Definition: var.h:69
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: var.h:63
USDRENDER_API UsdAttribute CreateSourceNameAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSourceNameAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDRENDER_API UsdAttribute GetDataTypeAttr() const
The type of this channel, as a USD attribute type.
USDRENDER_API UsdAttribute GetSourceTypeAttr() const
Indicates the type of the source.
virtual USDRENDER_API ~UsdRenderVar()
Destructor.
USDRENDER_API UsdAttribute GetSourceNameAttr() const
The renderer should look for an output of this name as the computed value for the RenderVar.
static USDRENDER_API UsdRenderVar Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdRenderVar holding the prim adhering to this schema at path on stage.
static USDRENDER_API UsdRenderVar Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
USDRENDER_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDRENDER_API UsdAttribute CreateDataTypeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetDataTypeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDRENDER_API UsdAttribute CreateSourceTypeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSourceTypeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
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...
The base class for all typed schemas (those that can impart a typeName to a UsdPrim),...
Definition: typed.h:45
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