24 #ifndef PXR_IMAGING_HD_SCENE_INDEX_PLUGIN_REGISTRY_H 25 #define PXR_IMAGING_HD_SCENE_INDEX_PLUGIN_REGISTRY_H 30 #include "pxr/imaging/hf/pluginRegistry.h" 31 #include "pxr/imaging/hd/api.h" 32 #include "pxr/imaging/hd/sceneIndex.h" 34 PXR_NAMESPACE_OPEN_SCOPE
36 #define HDSCENEINDEXPLUGINREGISTRY_TOKENS \ 37 ((rendererDisplayName, "__rendererDisplayName")) \ 41 HDSCENEINDEXPLUGINREGISTRY_TOKENS);
45 class HdSceneIndexPlugin;
54 static HdSceneIndexPluginRegistry &GetInstance();
59 template<
typename T,
typename... Bases>
68 HdSceneIndexBaseRefPtr AppendSceneIndex(
69 const TfToken &sceneIndexPluginId,
70 const HdSceneIndexBaseRefPtr &inputScene,
71 const HdContainerDataSourceHandle &inputArgs);
81 HdSceneIndexBaseRefPtr AppendSceneIndicesForRenderer(
82 const std::string &rendererDisplayName,
83 const HdSceneIndexBaseRefPtr &inputScene);
87 InsertionOrderAtStart,
91 using InsertionPhase =
unsigned int;
102 void RegisterSceneIndexForRenderer(
103 const std::string &rendererDisplayName,
104 const TfToken &sceneIndexPluginId,
105 const HdContainerDataSourceHandle &inputArgs,
106 InsertionPhase insertionPhase,
107 InsertionOrder insertionOrder);
115 friend class TfSingleton<HdSceneIndexPluginRegistry>;
118 HdSceneIndexPluginRegistry();
119 ~HdSceneIndexPluginRegistry()
override;
121 HdSceneIndexPlugin *_GetSceneIndexPlugin(
const TfToken &pluginId);
125 _Entry(
const TfToken &sceneIndexPluginId,
126 const HdContainerDataSourceHandle &args)
127 : sceneIndexPluginId(sceneIndexPluginId)
132 HdContainerDataSourceHandle args;
135 using _EntryList = std::vector<_Entry>;
136 using _PhasesMap = std::map<InsertionPhase, _EntryList>;
137 using _RenderersMap = std::map<std::string, _PhasesMap>;
139 HdSceneIndexBaseRefPtr _AppendForPhases(
140 const HdSceneIndexBaseRefPtr &inputScene,
141 const _PhasesMap &phasesMap,
142 const HdContainerDataSourceHandle &argsUnderlay);
144 _RenderersMap _sceneIndicesForRenderers;
150 using _PreloadMap = std::map<std::string, TfTokenVector>;
151 _PreloadMap _preloadsForRenderer;
155 template<
typename T,
typename... Bases>
156 void HdSceneIndexPluginRegistry::Define()
161 PXR_NAMESPACE_CLOSE_SCOPE
163 #endif // PXR_IMAGING_HD_SCENE_INDEX_PLUGIN_REGISTRY_H Manage a single instance of an object.
virtual HF_API void _CollectAdditionalMetadata(const PlugRegistry &plugRegistry, const TfType &pluginType)
Gives subclasses an opportunity to inspect plugInfo-based metadata at the time of discovery.
Manage a single instance of an object (see.
Base class for registering Hydra plugins using the plug mechanism.
Defines an interface for registering plugins.
static void Define()
Entry point for registering a types implementation.
Token for efficient comparison, assignment, and hashing of known strings.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
This file defines some macros that are useful for declaring and using static TfTokens.
TfType represents a dynamic runtime type.