24 #ifndef PXR_USD_IMAGING_USD_IMAGING_INDEX_PROXY_H
25 #define PXR_USD_IMAGING_USD_IMAGING_INDEX_PROXY_H
30 #include "pxr/usdImaging/usdImaging/api.h"
33 #include "pxr/usd/sdf/path.h"
39 PXR_NAMESPACE_OPEN_SCOPE
93 UsdImagingPrimAdapterSharedPtr adapter =
94 UsdImagingPrimAdapterSharedPtr());
97 void InsertSprim(
TfToken const& primType,
100 UsdImagingPrimAdapterSharedPtr adapter =
101 UsdImagingPrimAdapterSharedPtr());
104 void InsertBprim(
TfToken const& primType,
107 UsdImagingPrimAdapterSharedPtr adapter =
108 UsdImagingPrimAdapterSharedPtr());
111 void InsertInstancer(
SdfPath const& cachePath,
113 UsdImagingPrimAdapterSharedPtr adapter =
114 UsdImagingPrimAdapterSharedPtr());
121 void Refresh(
SdfPath const& cachePath);
128 void RemoveRprim(
SdfPath const& cachePath) {
129 _rprimsToRemove.push_back(cachePath);
130 _hdPrimInfoToRemove.push_back(cachePath);
131 _RemoveDependencies(cachePath);
135 void RemoveSprim(
TfToken const& primType,
SdfPath const& cachePath) {
136 _TypeAndPath primToRemove = {primType, cachePath};
137 _sprimsToRemove.push_back(primToRemove);
138 _hdPrimInfoToRemove.push_back(cachePath);
139 _RemoveDependencies(cachePath);
143 void RemoveBprim(
TfToken const& primType,
SdfPath const& cachePath) {
144 _TypeAndPath primToRemove = {primType, cachePath};
145 _bprimsToRemove.push_back(primToRemove);
146 _hdPrimInfoToRemove.push_back(cachePath);
147 _RemoveDependencies(cachePath);
151 void RemoveInstancer(
SdfPath const& cachePath) {
152 _instancersToRemove.push_back(cachePath);
153 _hdPrimInfoToRemove.push_back(cachePath);
154 _RemoveDependencies(cachePath);
158 void MarkRprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
161 void MarkSprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
164 void MarkBprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
167 void MarkInstancerDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
170 bool IsRprimTypeSupported(
TfToken const& typeId)
const;
173 bool IsSprimTypeSupported(
TfToken const& typeId)
const;
176 bool IsBprimTypeSupported(
TfToken const& typeId)
const;
180 bool IsPopulated(
SdfPath const& cachePath)
const;
184 void Repopulate(
SdfPath const& usdPath);
187 UsdImagingPrimAdapterSharedPtr GetMaterialAdapter(
199 void RemovePrimInfoDependency(
SdfPath const& cachePath);
204 UsdImagingDelegate::_Worker* worker)
205 : _delegate(delegate)
211 void _UniqueifyPathsToRepopulate();
213 bool _AddHdPrimInfo(
SdfPath const& cachePath,
215 UsdImagingPrimAdapterSharedPtr
const& adapter);
218 void _RemoveDependencies(
SdfPath const& cachePath);
220 SdfPathVector
const& _GetUsdPathsToRepopulate() {
221 return _usdPathsToRepopulate;
223 void _ProcessRemovals();
225 void _AddTask(
SdfPath const& usdPath);
227 struct _TypeAndPath {
232 typedef std::vector<_TypeAndPath> _TypeAndPathVector;
234 typedef std::vector<UsdImagingDelegate::_DependencyMap::value_type>
238 UsdImagingDelegate::_Worker* _worker;
239 SdfPathVector _usdPathsToRepopulate;
240 SdfPathVector _rprimsToRemove;
241 _TypeAndPathVector _sprimsToRemove;
242 _TypeAndPathVector _bprimsToRemove;
243 SdfPathVector _instancersToRemove;
244 SdfPathVector _hdPrimInfoToRemove;
245 _DependencyVector _dependenciesToRemove;
249 PXR_NAMESPACE_CLOSE_SCOPE
251 #endif //PXR_USD_IMAGING_USD_IMAGING_INDEX_PROXY_H
This proxy class exposes a subset of the private Delegate API to PrimAdapters.
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, 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.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...