24 #ifndef USDIMAGING_INDEXPROXY_H
25 #define USDIMAGING_INDEXPROXY_H
30 #include "pxr/usdImaging/usdImaging/api.h"
31 #include "pxr/usdImaging/usdImaging/delegate.h"
33 #include "pxr/usd/sdf/path.h"
34 #include "pxr/usd/usd/prim.h"
36 #include "pxr/base/tf/token.h"
39 PXR_NAMESPACE_OPEN_SCOPE
94 UsdImagingPrimAdapterSharedPtr adapter =
95 UsdImagingPrimAdapterSharedPtr());
98 void InsertSprim(
TfToken const& primType,
101 UsdImagingPrimAdapterSharedPtr adapter =
102 UsdImagingPrimAdapterSharedPtr());
105 void InsertBprim(
TfToken const& primType,
108 UsdImagingPrimAdapterSharedPtr adapter =
109 UsdImagingPrimAdapterSharedPtr());
112 void InsertInstancer(
SdfPath const& cachePath,
115 UsdImagingPrimAdapterSharedPtr adapter =
116 UsdImagingPrimAdapterSharedPtr());
120 void Refresh(
SdfPath const& cachePath);
124 void RefreshInstancer(
SdfPath const& instancerPath);
131 void RemoveRprim(
SdfPath const& cachePath) {
132 _rprimsToRemove.push_back(cachePath);
133 _hdPrimInfoToRemove.push_back(cachePath);
134 _RemoveDependencies(cachePath);
138 void RemoveSprim(
TfToken const& primType,
SdfPath const& cachePath) {
139 _TypeAndPath primToRemove = {primType, cachePath};
140 _sprimsToRemove.push_back(primToRemove);
141 _hdPrimInfoToRemove.push_back(cachePath);
142 _RemoveDependencies(cachePath);
146 void RemoveBprim(
TfToken const& primType,
SdfPath const& cachePath) {
147 _TypeAndPath primToRemove = {primType, cachePath};
148 _bprimsToRemove.push_back(primToRemove);
149 _hdPrimInfoToRemove.push_back(cachePath);
150 _RemoveDependencies(cachePath);
154 void RemoveInstancer(
SdfPath const& cachePath) {
155 _instancersToRemove.push_back(cachePath);
156 _hdPrimInfoToRemove.push_back(cachePath);
157 _RemoveDependencies(cachePath);
161 void MarkRprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
164 void MarkSprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
167 void MarkBprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
170 void MarkInstancerDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
173 bool IsRprimTypeSupported(
TfToken const& typeId)
const;
176 bool IsSprimTypeSupported(
TfToken const& typeId)
const;
179 bool IsBprimTypeSupported(
TfToken const& typeId)
const;
183 bool IsPopulated(
SdfPath const& cachePath)
const;
187 void Repopulate(
SdfPath const& usdPath);
190 UsdImagingPrimAdapterSharedPtr GetMaterialAdapter(
196 UsdImagingDelegate::_Worker* worker)
197 : _delegate(delegate)
201 bool _AddHdPrimInfo(
SdfPath const& cachePath,
203 UsdImagingPrimAdapterSharedPtr
const& adapter);
209 void _RemovePrimInfoDependency(
SdfPath const& cachePath);
212 void _RemoveDependencies(
SdfPath const& cachePath);
214 SdfPathVector
const& _GetUsdPathsToRepopulate() {
215 return _usdPathsToRepopulate;
217 void _ProcessRemovals();
219 void _AddTask(
SdfPath const& usdPath);
221 struct _TypeAndPath {
226 typedef std::vector<_TypeAndPath> _TypeAndPathVector;
228 typedef std::vector<UsdImagingDelegate::_DependencyMap::value_type>
232 UsdImagingDelegate::_Worker* _worker;
233 SdfPathVector _usdPathsToRepopulate;
234 SdfPathVector _rprimsToRemove;
235 _TypeAndPathVector _sprimsToRemove;
236 _TypeAndPathVector _bprimsToRemove;
237 SdfPathVector _instancersToRemove;
238 SdfPathVector _hdPrimInfoToRemove;
239 _DependencyVector _dependenciesToRemove;
243 PXR_NAMESPACE_CLOSE_SCOPE
245 #endif //USDIMAGING_INDEXPROXY_H
This proxy class exposes a subset of the private Delegate API to PrimAdapters.
Delegate support for UsdGeomGrims.
Token for efficient comparison, assignment, and hashing of known strings.
USDIMAGING_API void AddDependency(SdfPath const &cachePath, UsdPrim const &usdPrim)
A note on paths/prims: the core function of UsdImagingIndexProxy and UsdImagingDelegate is to maintai...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
A path value used to locate objects in layers or scenegraphs.
USDIMAGING_API void InsertRprim(TfToken const &primType, SdfPath const &cachePath, SdfPath const &parentPath, UsdPrim const &usdPrim, UsdImagingPrimAdapterSharedPtr adapter=UsdImagingPrimAdapterSharedPtr())
Insert a hydra prim with the specified cache path.
The primary translation layer between the Hydra (Hd) core and the Usd scene graph.