7#ifndef PXR_IMAGING_HD_PRIM_DATA_SOURCE_OVERLAY_CACHE_H
8#define PXR_IMAGING_HD_PRIM_DATA_SOURCE_OVERLAY_CACHE_H
10#include "pxr/imaging/hd/sceneIndex.h"
11#include "pxr/imaging/hd/dataSource.h"
13#include "pxr/usd/sdf/pathTable.h"
15PXR_NAMESPACE_OPEN_SCOPE
22class HdPrimDataSourceOverlayCache :
23 public std::enable_shared_from_this<HdPrimDataSourceOverlayCache>
26 virtual ~HdPrimDataSourceOverlayCache();
30 void HandlePrimsAdded(
32 const HdSceneIndexBaseRefPtr &source);
33 void HandlePrimsRemoved(
35 void HandlePrimsDirtied(
40 HdPrimDataSourceOverlayCache() =
default;
60 struct _OverlayDependencies
62 _OverlayDependencies()
63 : onPrim(), onParent(), dependenciesOptional(false) {}
67 bool dependenciesOptional;
69 using _OverlayTopology = std::map<TfToken, _OverlayDependencies>;
73 void _SetOverlayTopology(
const _OverlayTopology &topology) {
74 _overlayTopology = topology;
84 virtual HdDataSourceBaseHandle _ComputeOverlayDataSource(
86 HdContainerDataSourceHandle inputDataSource,
87 HdContainerDataSourceHandle parentOverlayDataSource)
const = 0;
93 HD_DECLARE_DATASOURCE(_HdPrimDataSourceOverlay);
95 _HdPrimDataSourceOverlay(
96 HdContainerDataSourceHandle inputDataSource,
97 HdContainerDataSourceHandle parentOverlayDataSource,
98 const std::weak_ptr<const HdPrimDataSourceOverlayCache> cache);
100 void UpdateInputDataSource(HdContainerDataSourceHandle inputDataSource);
105 HdDataSourceBaseHandle
Get(
const TfToken &name)
override;
108 HdContainerDataSourceHandle _inputDataSource;
109 HdContainerDataSourceHandle _parentOverlayDataSource;
110 const std::weak_ptr<const HdPrimDataSourceOverlayCache> _cache;
112 using _OverlayMap = std::map<TfToken, HdDataSourceBaseHandle>;
114 _OverlayMap _overlayMap;
118 _OverlayTopology _overlayTopology;
121PXR_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.