7#ifndef PXR_IMAGING_HD_SCENE_INDEX_PLUGIN_REGISTRY_H
8#define PXR_IMAGING_HD_SCENE_INDEX_PLUGIN_REGISTRY_H
10#include "pxr/imaging/hd/api.h"
11#include "pxr/imaging/hd/sceneIndex.h"
12#include "pxr/imaging/hd/sceneIndexObserver.h"
13#include "pxr/imaging/hf/pluginRegistry.h"
25PXR_NAMESPACE_OPEN_SCOPE
27#define HDSCENEINDEXPLUGINREGISTRY_TOKENS \
28 ((rendererDisplayName, "__rendererDisplayName")) \
32 HDSCENEINDEXPLUGINREGISTRY_TOKENS);
51 template<
typename T,
typename... Bases>
61 const TfToken &sceneIndexPluginId,
62 const HdSceneIndexBaseRefPtr &inputScene,
63 const HdContainerDataSourceHandle &inputArgs,
64 const std::string &renderInstanceId=std::string());
91 const std::string &rendererDisplayName,
92 const HdSceneIndexBaseRefPtr &inputScene,
93 const std::string &renderInstanceId=std::string(),
94 const std::string &appName=std::string(),
95 const HdContainerDataSourceHandle &sceneIndexCreateArgs=
nullptr);
99 InsertionOrderAtStart,
103 using InsertionPhase = int;
151 const std::string &rendererDisplayName,
152 const TfToken &sceneIndexPluginId,
153 const HdContainerDataSourceHandle &inputArgs,
154 InsertionPhase insertionPhase,
155 InsertionOrder insertionOrder);
158 using SceneIndexAppendCallback =
160 HdSceneIndexBaseRefPtr(
161 const std::string &renderInstanceId,
162 const HdSceneIndexBaseRefPtr &inputScene,
163 const HdContainerDataSourceHandle &inputArgs)>;
193 const std::string &rendererDisplayName,
194 SceneIndexAppendCallback callback,
195 const HdContainerDataSourceHandle &inputArgs,
196 InsertionPhase insertionPhase,
197 InsertionOrder insertionOrder);
207 const std::string& rendererDisplayName,
208 const std::string& appName);
210 struct PluginInsertionMetadata
212 std::string rendererDisplayName;
214 int insertionPhase = -1;
223 const HdSceneIndexBaseRefPtr& sceneIndex,
224 PluginInsertionMetadata& metadata);
267 void _LoadPluginsForRenderer(
268 const std::string &rendererDisplayName,
269 const std::string &appName);
274 std::unique_ptr<_Impl> _impl;
277template<
typename T,
typename... Bases>
283PXR_NAMESPACE_CLOSE_SCOPE
A scene index plugin bundles one or more (typically filtering) scene indices together and enables the...
A registry for renderer- and application-specific scene indices.
static HD_API HdSceneIndexPluginRegistry & GetInstance()
Returns the singleton registry for HdSceneIndexPlugin.
bool GetPluginInsertionMetadataForSceneIndex(const HdSceneIndexBaseRefPtr &sceneIndex, PluginInsertionMetadata &metadata)
Gets metadata about the plugin that inserted the given scene index, if available.
HD_API HdSceneIndexBaseRefPtr AppendSceneIndicesForRenderer(const std::string &rendererDisplayName, const HdSceneIndexBaseRefPtr &inputScene, const std::string &renderInstanceId=std::string(), const std::string &appName=std::string(), const HdContainerDataSourceHandle &sceneIndexCreateArgs=nullptr)
Append scene indices generated by plug-ins registered (via RegisterSceneIndexForRenderer) for this re...
HD_API void RegisterSceneIndexForRenderer(const std::string &rendererDisplayName, SceneIndexAppendCallback callback, const HdContainerDataSourceHandle &inputArgs, InsertionPhase insertionPhase, InsertionOrder insertionOrder)
Register a scene index to be instantiated via a callback for a specified renderer (or all renderers i...
static void Define()
Entry point for defining an HdSceneIndexPlugin plugin.
HD_API void RegisterSceneIndexForRenderer(const std::string &rendererDisplayName, const TfToken &sceneIndexPluginId, const HdContainerDataSourceHandle &inputArgs, InsertionPhase insertionPhase, InsertionOrder insertionOrder)
Register a scene index plugin to be instantiated for a specified renderer (or all renderers if render...
PluginOrderingPolicy
Enum to specify the policy for determining the order of scene index plugins.
@ JsonMetadataOnly
The tags and ordering specified in the JSON metadata are used to drive the ordering of scene index pl...
@ CppRegistrationOnly
The order of plugins is determined solely by the insertion phase/order arguments of the C++ registrat...
@ Hybrid
A hybrid ordering scheme where we attempt to honor both the insertion phase/order specified via the C...
void _CollectAdditionalMetadata(const PlugRegistry &plugRegistry, const TfType &pluginType) override
Gives subclasses an opportunity to inspect plugInfo-based metadata at the time of discovery.
HD_API std::vector< TfToken > LoadAndGetSceneIndexPluginIds(const std::string &rendererDisplayName, const std::string &appName)
Loads plugins for rendererDisplayName and appName.
HD_API HdSceneIndexBaseRefPtr AppendSceneIndex(const TfToken &sceneIndexPluginId, const HdSceneIndexBaseRefPtr &inputScene, const HdContainerDataSourceHandle &inputArgs, const std::string &renderInstanceId=std::string())
Given a specific scene index plug-in id, give the plug-in a chance to add scene indices to the end of...
HD_API void SetPluginOrderingPolicy(PluginOrderingPolicy policy)
Sets the policy for determining the order of scene index plugins.
Base class for registering Hydra plugins using the plug mechanism.
static void Define()
Entry point for registering a types implementation.
Defines an interface for registering plugins.
Manage a single instance of an object (see.
Token for efficient comparison, assignment, and hashing of known strings.
TfType represents a dynamic runtime type.
Manage a single instance of an object.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
Pointer storage with deletion detection.