24#ifndef PXR_IMAGING_HD_PRIM_DATA_SOURCE_OVERLAY_CACHE_H
25#define PXR_IMAGING_HD_PRIM_DATA_SOURCE_OVERLAY_CACHE_H
27#include "pxr/imaging/hd/sceneIndex.h"
28#include "pxr/imaging/hd/dataSource.h"
30#include "pxr/usd/sdf/pathTable.h"
32PXR_NAMESPACE_OPEN_SCOPE
39class HdPrimDataSourceOverlayCache :
40 public std::enable_shared_from_this<HdPrimDataSourceOverlayCache>
43 virtual ~HdPrimDataSourceOverlayCache();
47 void HandlePrimsAdded(
49 const HdSceneIndexBaseRefPtr &source);
50 void HandlePrimsRemoved(
52 void HandlePrimsDirtied(
57 HdPrimDataSourceOverlayCache() =
default;
77 struct _OverlayDependencies
79 _OverlayDependencies()
80 : onPrim(), onParent(), dependenciesOptional(false) {}
84 bool dependenciesOptional;
86 using _OverlayTopology = std::map<TfToken, _OverlayDependencies>;
90 void _SetOverlayTopology(
const _OverlayTopology &topology) {
91 _overlayTopology = topology;
101 virtual HdDataSourceBaseHandle _ComputeOverlayDataSource(
103 HdContainerDataSourceHandle inputDataSource,
104 HdContainerDataSourceHandle parentOverlayDataSource)
const = 0;
110 HD_DECLARE_DATASOURCE(_HdPrimDataSourceOverlay);
112 _HdPrimDataSourceOverlay(
113 HdContainerDataSourceHandle inputDataSource,
114 HdContainerDataSourceHandle parentOverlayDataSource,
115 const std::weak_ptr<const HdPrimDataSourceOverlayCache> cache);
117 void UpdateInputDataSource(HdContainerDataSourceHandle inputDataSource);
122 HdDataSourceBaseHandle
Get(
const TfToken &name)
override;
125 HdContainerDataSourceHandle _inputDataSource;
126 HdContainerDataSourceHandle _parentOverlayDataSource;
127 const std::weak_ptr<const HdPrimDataSourceOverlayCache> _cache;
129 using _OverlayMap = std::map<TfToken, HdDataSourceBaseHandle>;
131 _OverlayMap _overlayMap;
135 _OverlayTopology _overlayTopology;
138PXR_NAMESPACE_CLOSE_SCOPE
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
static HD_API HdDataSourceBaseHandle Get(const Handle &container, const HdDataSourceLocator &locator)
A convenience function: given container, return the descendant identified by locator,...
Represents a set of data source locators closed under descendancy.
A path value used to locate objects in layers or scenegraphs.
A mapping from SdfPath to MappedType, somewhat similar to map<SdfPath, MappedType> and TfHashMap<SdfP...
Token for efficient comparison, assignment, and hashing of known strings.
Small struct representing a 'prim' in the Hydra scene index.
std::vector< TfToken > TfTokenVector
Convenience types.