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());
120 void RequestTrackVariability(
SdfPath const& cachePath);
123 void RequestUpdateForTime(
SdfPath const& cachePath);
130 void RemoveRprim(
SdfPath const& cachePath) {
131 _rprimsToRemove.push_back(cachePath);
132 _hdPrimInfoToRemove.push_back(cachePath);
133 _RemoveDependencies(cachePath);
137 void RemoveSprim(
TfToken const& primType,
SdfPath const& cachePath) {
138 _TypeAndPath primToRemove = {primType, cachePath};
139 _sprimsToRemove.push_back(primToRemove);
140 _hdPrimInfoToRemove.push_back(cachePath);
141 _RemoveDependencies(cachePath);
145 void RemoveBprim(
TfToken const& primType,
SdfPath const& cachePath) {
146 _TypeAndPath primToRemove = {primType, cachePath};
147 _bprimsToRemove.push_back(primToRemove);
148 _hdPrimInfoToRemove.push_back(cachePath);
149 _RemoveDependencies(cachePath);
153 void RemoveInstancer(
SdfPath const& cachePath) {
154 _instancersToRemove.push_back(cachePath);
155 _hdPrimInfoToRemove.push_back(cachePath);
156 _RemoveDependencies(cachePath);
160 void MarkRprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
163 void MarkSprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
166 void MarkBprimDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
169 void MarkInstancerDirty(
SdfPath const& cachePath, HdDirtyBits dirtyBits);
172 bool IsRprimTypeSupported(
TfToken const& typeId)
const;
175 bool IsSprimTypeSupported(
TfToken const& typeId)
const;
178 bool IsBprimTypeSupported(
TfToken const& typeId)
const;
182 bool IsPopulated(
SdfPath const& cachePath)
const;
186 void Repopulate(
SdfPath const& usdPath);
189 UsdImagingPrimAdapterSharedPtr GetMaterialAdapter(
201 void RemovePrimInfoDependency(
SdfPath const& cachePath);
206 UsdImagingDelegate::_Worker* worker)
207 : _delegate(delegate)
213 void _UniqueifyPathsToRepopulate();
215 UsdImagingDelegate::_HdPrimInfo*
216 _AddHdPrimInfo(
SdfPath const& cachePath,
218 UsdImagingPrimAdapterSharedPtr
const& adapter);
221 void _RemoveDependencies(
SdfPath const& cachePath);
223 SdfPathVector
const& _GetUsdPathsToRepopulate() {
224 return _usdPathsToRepopulate;
226 void _ProcessRemovals();
228 void _AddTask(
SdfPath const& usdPath);
230 struct _TypeAndPath {
235 typedef std::vector<_TypeAndPath> _TypeAndPathVector;
237 typedef std::vector<UsdImagingDelegate::_DependencyMap::value_type>
241 UsdImagingDelegate::_Worker* _worker;
242 SdfPathVector _usdPathsToRepopulate;
243 SdfPathVector _rprimsToRemove;
244 _TypeAndPathVector _sprimsToRemove;
245 _TypeAndPathVector _bprimsToRemove;
246 SdfPathVector _instancersToRemove;
247 SdfPathVector _hdPrimInfoToRemove;
248 _DependencyVector _dependenciesToRemove;
252 PXR_NAMESPACE_CLOSE_SCOPE
254 #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...