Loading...
Searching...
No Matches
sceneIndexPlugin.h
1//
2// Copyright 2025 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_INDEX_PLUGIN_H
8#define PXR_USD_IMAGING_USD_IMAGING_SCENE_INDEX_PLUGIN_H
9
10#include "pxr/pxr.h"
11
12#include "pxr/usdImaging/usdImaging/api.h"
13
14#include "pxr/imaging/hd/dataSource.h"
15
17#include "pxr/base/tf/type.h"
18
19#include <memory>
20
21PXR_NAMESPACE_OPEN_SCOPE
22
24using UsdImagingSceneIndexPluginUniquePtr =
25 std::unique_ptr<class UsdImagingSceneIndexPlugin>;
26
52{
53public:
55 virtual HdSceneIndexBaseRefPtr AppendSceneIndex(
56 HdSceneIndexBaseRefPtr const &inputScene) = 0;
57
65 USDIMAGING_API
66 virtual HdContainerDataSourceHandle
68
81 USDIMAGING_API
82 virtual TfTokenVector
84
90 USDIMAGING_API
91 virtual TfTokenVector
93
94 USDIMAGING_API
96
97 class FactoryBase : public TfType::FactoryBase
98 {
99 public:
100 virtual UsdImagingSceneIndexPluginUniquePtr Create() = 0;
101
102 USDIMAGING_API
103 virtual ~FactoryBase();
104 };
105
106 template<typename T>
107 class Factory : public FactoryBase
108 {
109 public:
110 UsdImagingSceneIndexPluginUniquePtr Create() override {
111 return std::make_unique<T>();
112 }
113 };
114
118 template<typename T>
119 static
120 void Define()
121 {
122 TfType::Define<T, TfType::Bases<UsdImagingSceneIndexPlugin>>()
123 .template SetFactory<Factory<T>>();
124 }
125
127 static
128 std::vector<UsdImagingSceneIndexPluginUniquePtr> GetAllSceneIndexPlugins();
129};
130
131PXR_NAMESPACE_CLOSE_SCOPE
132
133#endif
Abstract interface to scene data.
Definition: sceneIndex.h:54
Base class of all factory types.
Definition: type.h:56
A base class for scene index plugins that can insert filtering scene indices into UsdImaging,...
static std::vector< UsdImagingSceneIndexPluginUniquePtr > GetAllSceneIndexPlugins()
Get an instance of each registered UsdImagingSceneIndexPlugin.
virtual HdSceneIndexBaseRefPtr AppendSceneIndex(HdSceneIndexBaseRefPtr const &inputScene)=0
Override by client. Similar to HdSceneIndexPlugin::AppendSceneIndex.
virtual USDIMAGING_API HdContainerDataSourceHandle FlattenedDataSourceProviders()
Clients can register additional HdFlattenedDataSourceProvider's that UsdImagingCreateSceneIndices wil...
virtual USDIMAGING_API TfTokenVector ProxyPathTranslationDataSourceNames()
Clients can register additional names of prim-level data sources that should receive path-translation...
virtual USDIMAGING_API TfTokenVector InstanceDataSourceNames()
Clients can register additional names used by the (native) instance aggregation scene index when grou...
static void Define()
Call within TF_REGISTRY_FUNCTION(UsdImagingSceneIndexPlugin) to ensure that UsdImaging can instantiat...
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440