18#ifndef PXR_IMAGING_HD_SCENE_GLOBALS_SCHEMA_H
19#define PXR_IMAGING_HD_SCENE_GLOBALS_SCHEMA_H
23#include "pxr/imaging/hd/api.h"
25#include "pxr/imaging/hd/schema.h"
28#include "pxr/usd/sdf/path.h"
29#include "pxr/imaging/hd/sceneIndex.h"
30#include "pxr/imaging/hd/vectorSchema.h"
33PXR_NAMESPACE_OPEN_SCOPE
39#define HD_SCENE_GLOBALS_SCHEMA_TOKENS \
42 (activeRenderPassPrim) \
43 (activeRenderSettingsPrim) \
46 (timeCodesPerSecond) \
52 HD_SCENE_GLOBALS_SCHEMA_TOKENS);
88 const HdContainerDataSourceHandle &fromParentContainer);
103 const HdSceneIndexBaseRefPtr &si);
118 HdPathDataSourceHandle GetPrimaryCameraPrim()
const;
121 HdPathDataSourceHandle GetActiveRenderPassPrim()
const;
124 HdPathDataSourceHandle GetActiveRenderSettingsPrim()
const;
127 HdDoubleDataSourceHandle GetStartTimeCode()
const;
130 HdDoubleDataSourceHandle GetEndTimeCode()
const;
133 HdDoubleDataSourceHandle GetTimeCodesPerSecond()
const;
136 HdDoubleDataSourceHandle GetCurrentFrame()
const;
139 HdIntDataSourceHandle GetSceneStateId()
const;
219 static HdContainerDataSourceHandle
221 const HdPathDataSourceHandle &primaryCameraPrim,
222 const HdPathDataSourceHandle &activeRenderPassPrim,
223 const HdPathDataSourceHandle &activeRenderSettingsPrim,
224 const HdDoubleDataSourceHandle &startTimeCode,
225 const HdDoubleDataSourceHandle &endTimeCode,
226 const HdDoubleDataSourceHandle &timeCodesPerSecond,
227 const HdDoubleDataSourceHandle ¤tFrame,
228 const HdIntDataSourceHandle &sceneStateId,
229 const HdVectorDataSourceHandle &primIdToPath
243 const HdPathDataSourceHandle &primaryCameraPrim);
245 Builder &SetActiveRenderPassPrim(
246 const HdPathDataSourceHandle &activeRenderPassPrim);
248 Builder &SetActiveRenderSettingsPrim(
249 const HdPathDataSourceHandle &activeRenderSettingsPrim);
252 const HdDoubleDataSourceHandle &startTimeCode);
255 const HdDoubleDataSourceHandle &endTimeCode);
257 Builder &SetTimeCodesPerSecond(
258 const HdDoubleDataSourceHandle &timeCodesPerSecond);
261 const HdDoubleDataSourceHandle ¤tFrame);
264 const HdIntDataSourceHandle &sceneStateId);
267 const HdVectorDataSourceHandle &primIdToPath);
271 HdContainerDataSourceHandle
Build();
274 HdPathDataSourceHandle _primaryCameraPrim;
275 HdPathDataSourceHandle _activeRenderPassPrim;
276 HdPathDataSourceHandle _activeRenderSettingsPrim;
277 HdDoubleDataSourceHandle _startTimeCode;
278 HdDoubleDataSourceHandle _endTimeCode;
279 HdDoubleDataSourceHandle _timeCodesPerSecond;
280 HdDoubleDataSourceHandle _currentFrame;
281 HdIntDataSourceHandle _sceneStateId;
282 HdVectorDataSourceHandle _primIdToPath;
289PXR_NAMESPACE_CLOSE_SCOPE
Represents an object that can identify the location of a data source.
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
The HdSceneGlobalsSchema encapsulates "global" state to orchestrate a render.
static HD_API const HdDataSourceLocator & GetEndTimeCodeLocator()
Prim-level relative data source locator to locate endTimeCode.
static HD_API const HdDataSourceLocator & GetCurrentFrameLocator()
Prim-level relative data source locator to locate currentFrame.
static HD_API const HdDataSourceLocator & GetSceneStateIdLocator()
Prim-level relative data source locator to locate sceneStateId.
static HD_API const HdDataSourceLocator & GetActiveRenderPassPrimLocator()
Prim-level relative data source locator to locate activeRenderPassPrim.
static HD_API const HdDataSourceLocator & GetPrimaryCameraPrimLocator()
Prim-level relative data source locator to locate primaryCameraPrim.
static HD_API const HdDataSourceLocator & GetStartTimeCodeLocator()
Prim-level relative data source locator to locate startTimeCode.
static HD_API const HdDataSourceLocator & GetActiveRenderSettingsPrimLocator()
Prim-level relative data source locator to locate activeRenderSettingsPrim.
static HD_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &primaryCameraPrim, const HdPathDataSourceHandle &activeRenderPassPrim, const HdPathDataSourceHandle &activeRenderSettingsPrim, const HdDoubleDataSourceHandle &startTimeCode, const HdDoubleDataSourceHandle &endTimeCode, const HdDoubleDataSourceHandle &timeCodesPerSecond, const HdDoubleDataSourceHandle ¤tFrame, const HdIntDataSourceHandle &sceneStateId, const HdVectorDataSourceHandle &primIdToPath)
HD_API HdPathVectorSchema GetPrimIdToPath() const
Maps id's from PrimId schema to prim paths.
static HD_API HdSceneGlobalsSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
Retrieves a container data source with the schema's default name token "sceneGlobals" from the parent...
static HD_API const HdDataSourceLocator & GetPrimIdToPathLocator()
Prim-level relative data source locator to locate primIdToPath.
static const SdfPath & GetDefaultPrimPath()
Utility method to concretize the convention of parking the "sceneGlobals" container at the root prim ...
static HD_API const HdDataSourceLocator & GetTimeCodesPerSecondLocator()
Prim-level relative data source locator to locate timeCodesPerSecond.
static HD_API const TfToken & GetSchemaToken()
Returns a token where the container representing this schema is found in a container by default.
static HD_API HdSceneGlobalsSchema GetFromSceneIndex(const HdSceneIndexBaseRefPtr &si)
Constructs and returns a HdSceneGlobalsSchema from the root prim in the scene index.
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Returns an HdDataSourceLocator (relative to the prim-level data source) where the container represent...
Schema classes represent a structured view of the inherently unstructured container data source passe...
Template class wrapping a vector data source whose children are data source of an expected type.
A path value used to locate objects in layers or scenegraphs.
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
Token for efficient comparison, assignment, and hashing of known strings.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.