HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sceneIndices.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_IMAGING_USD_IMAGING_SCENE_INDICES_H
8 #define PXR_USD_IMAGING_USD_IMAGING_SCENE_INDICES_H
9 
11 #include "pxr/pxr.h"
12 
14 
18 
20 
25 
27  std::function<
28  HdSceneIndexBaseRefPtr(HdSceneIndexBaseRefPtr const &)>;
29 
30 /// Info needed to create a chain of filtering scene indices (resolving
31 /// e.g. USD native instancing) for clients to consume a UsdStage.
33 {
35 
36  /// Stage. Note that it can be set after the scene indices have been
37  /// created later by UsdImagingStageSceneIndex::SetStage.
38  UsdStageRefPtr stage;
39  /// Inputs to UsdImagingStageSceneIndex (note that
40  /// includeUnloadedPrims is set automatically when
41  /// displayUnloadedPrimsWithBounds is enabled).
42  HdContainerDataSourceHandle stageSceneIndexInputArgs;
43  /// Add scene index resolving usd draw mode.
44  bool addDrawModeSceneIndex = true;
45  /// Should we switch the draw mode for unloaded prims to
46  /// bounds.
48  /// A client can insert scene indices after stage scene index.
50 };
51 
52 /// Some scene indices in the chain of filtering scene indices created
53 /// by UsdImagingCreateSceneIndices.
55 {
56  UsdImagingStageSceneIndexRefPtr stageSceneIndex;
57  HdNoticeBatchingSceneIndexRefPtr postInstancingNoticeBatchingSceneIndex;
58  UsdImagingSelectionSceneIndexRefPtr selectionSceneIndex;
59  HdSceneIndexBaseRefPtr finalSceneIndex;
60 };
61 
62 /// Creates a chain of filtering scene indices for clients to consume
63 /// a UsdStage.
67  const UsdImagingCreateSceneIndicesInfo &createInfo);
68 
69 /// New API that gets us closer to the direction that all scene indices are
70 /// created with inputArgs which come by overlaying the container data
71 /// sources from the application and from
72 /// HdRendererPlugin::GetSceneIndexInputArgs().
73 ///
74 /// We have not moved UsdImagingSceneIndexAppendCallback into inputArgs because
75 /// a std::function is not a value type (no operator==) and, thus, cannot be
76 /// returned by a HdTypedSampledDataSource. We might also revisit the return
77 /// type.
78 ///
82  HdContainerDataSourceHandle const &inputArgs,
83  const UsdImagingSceneIndexAppendCallback &overridesSceneIndexCallback);
84 
86 
87 #endif
std::function< HdSceneIndexBaseRefPtr(HdSceneIndexBaseRefPtr const &)> UsdImagingSceneIndexAppendCallback
Definition: sceneIndices.h:28
bool addDrawModeSceneIndex
Add scene index resolving usd draw mode.
Definition: sceneIndices.h:44
#define USDIMAGING_API
Definition: api.h:23
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
UsdImagingSceneIndexAppendCallback SceneIndexAppendCallback
Definition: sceneIndices.h:34
UsdImagingSelectionSceneIndexRefPtr selectionSceneIndex
Definition: sceneIndices.h:58
USDIMAGING_API UsdImagingSceneIndices UsdImagingCreateSceneIndices(const UsdImagingCreateSceneIndicesInfo &createInfo)
HdContainerDataSourceHandle stageSceneIndexInputArgs
Definition: sceneIndices.h:42
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(HdNoticeBatchingSceneIndex)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HdSceneIndexBaseRefPtr finalSceneIndex
Definition: sceneIndices.h:59
SceneIndexAppendCallback overridesSceneIndexCallback
A client can insert scene indices after stage scene index.
Definition: sceneIndices.h:49
HdNoticeBatchingSceneIndexRefPtr postInstancingNoticeBatchingSceneIndex
Definition: sceneIndices.h:57
UsdImagingStageSceneIndexRefPtr stageSceneIndex
Definition: sceneIndices.h:56