Loading...
Searching...
No Matches
listAPI.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 USDLUX_GENERATED_LISTAPI_H
8#define USDLUX_GENERATED_LISTAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdLux/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// LISTAPI //
34// -------------------------------------------------------------------------- //
35
49{
50public:
54 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
55
60 explicit UsdLuxListAPI(const UsdPrim& prim=UsdPrim())
61 : UsdAPISchemaBase(prim)
62 {
63 }
64
68 explicit UsdLuxListAPI(const UsdSchemaBase& schemaObj)
69 : UsdAPISchemaBase(schemaObj)
70 {
71 }
72
74 USDLUX_API
75 virtual ~UsdLuxListAPI();
76
80 USDLUX_API
81 static const TfTokenVector &
82 GetSchemaAttributeNames(bool includeInherited=true);
83
93 USDLUX_API
94 static UsdLuxListAPI
95 Get(const UsdStagePtr &stage, const SdfPath &path);
96
97
114 USDLUX_API
115 static bool
116 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
117
133 USDLUX_API
134 static UsdLuxListAPI
135 Apply(const UsdPrim &prim);
136
137protected:
141 USDLUX_API
143
144private:
145 // needs to invoke _GetStaticTfType.
146 friend class UsdSchemaRegistry;
147 USDLUX_API
148 static const TfType &_GetStaticTfType();
149
150 static bool _IsTypedSchema();
151
152 // override SchemaBase virtuals.
153 USDLUX_API
154 const TfType &_GetTfType() const override;
155
156public:
157 // --------------------------------------------------------------------- //
158 // LIGHTLISTCACHEBEHAVIOR
159 // --------------------------------------------------------------------- //
181 USDLUX_API
183
189 USDLUX_API
190 UsdAttribute CreateLightListCacheBehaviorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
191
192public:
193 // --------------------------------------------------------------------- //
194 // LIGHTLIST
195 // --------------------------------------------------------------------- //
198 USDLUX_API
200
203 USDLUX_API
205
206public:
207 // ===================================================================== //
208 // Feel free to add custom code below this line, it will be preserved by
209 // the code generator.
210 //
211 // Just remember to:
212 // - Close the class declaration with };
213 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
214 // - Close the include guard with #endif
215 // ===================================================================== //
216 // --(BEGIN CUSTOM CODE)--
217
225 };
226
246 USDLUX_API
247 SdfPathSet ComputeLightList(ComputeMode mode) const;
248
253 USDLUX_API
254 void StoreLightList(const SdfPathSet &) const;
255
258 USDLUX_API
260};
261
262PXR_NAMESPACE_CLOSE_SCOPE
263
264#endif
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
The base class for all API schemas.
Definition: apiSchemaBase.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
USDLUX_API void StoreLightList(const SdfPathSet &) const
Store the given paths as the lightlist for this prim.
UsdLuxListAPI(const UsdSchemaBase &schemaObj)
Construct a UsdLuxListAPI on the prim held by schemaObj .
Definition: listAPI.h:68
USDLUX_API SdfPathSet ComputeLightList(ComputeMode mode) const
Computes and returns the list of lights and light filters in the stage, optionally consulting a cache...
USDLUX_API UsdRelationship GetLightListRel() const
Relationship to lights in the scene.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: listAPI.h:54
virtual USDLUX_API ~UsdLuxListAPI()
Destructor.
ComputeMode
Runtime control over whether to consult stored lightList caches.
Definition: listAPI.h:219
@ ComputeModeConsultModelHierarchyCache
Consult any caches found on the model hierarchy.
Definition: listAPI.h:222
@ ComputeModeIgnoreCache
Ignore any caches found, and do a full prim traversal.
Definition: listAPI.h:224
static USDLUX_API UsdLuxListAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
USDLUX_API UsdRelationship CreateLightListRel() const
See GetLightListRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API void InvalidateLightList() const
Mark any stored lightlist as invalid, by setting the lightList:cacheBehavior attribute to ignore.
USDLUX_API UsdAttribute CreateLightListCacheBehaviorAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetLightListCacheBehaviorAttr(), and also Create vs Get Property Methods for when to use Get vs C...
USDLUX_API UsdAttribute GetLightListCacheBehaviorAttr() const
Controls how the lightList should be interpreted.
UsdLuxListAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdLuxListAPI on UsdPrim prim .
Definition: listAPI.h:60
USDLUX_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDLUX_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 USDLUX_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
static USDLUX_API UsdLuxListAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdLuxListAPI holding the prim adhering to this schema at path on stage.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
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