7 #ifndef PXR_IMAGING_HD_SCENE_INDEX_ADAPTER_SCENE_DELEGATE_H
8 #define PXR_IMAGING_HD_SCENE_INDEX_ADAPTER_SCENE_DELEGATE_H
14 #include <tbb/concurrent_unordered_map.h>
50 HdSceneIndexBaseRefPtr inputSceneIndex,
92 SdfPath const &volumeId)
override;
94 TfToken const ¶mName)
override;
101 float *sampleTimes,
GfMatrix4d *sampleValues)
override;
103 float startTime,
float endTime,
104 size_t maxSampleCount,
105 float *sampleTimes,
GfMatrix4d *sampleValues)
override;
108 SdfPath const &instancerId)
override;
110 size_t maxSampleCount,
float *sampleTimes,
113 float startTime,
float endTime,
114 size_t maxSampleCount,
float *sampleTimes,
126 VtIntArray *outIndices)
override;
129 size_t maxSampleCount,
float *sampleTimes,
130 VtValue *sampleValues)
override;
132 float startTime,
float endTime,
133 size_t maxSampleCount,
float *sampleTimes,
134 VtValue *sampleValues)
override;
137 VtIntArray *sampleIndices)
override;
139 float startTime,
float endTime,
140 size_t maxNumSamples,
float *times,
VtValue *samples,
141 VtIntArray *sampleIndices)
override;
147 SdfPath const &instancerId)
override;
175 TfToken const ¶mName)
override;
181 TfToken const ¶mName)
override;
193 SdfPath const &computationId)
override;
199 size_t maxSampleCount,
201 VtValue *sampleValues)
override;
207 size_t maxSampleCount,
209 VtValue *sampleValues)
override;
212 SdfPath const &computationId)
override;
214 SdfPath const &computationId)
override;
238 using _InputPrimCacheEntry = std::pair<SdfPath, HdSceneIndexPrim>;
242 std::hash<std::thread::id> > _inputPrimCache;
249 VtIntArray *outIndices);
252 const HdContainerDataSourceHandle &primvarsDataSource,
254 VtIntArray *outIndices);
261 float startTime,
float endTime,
262 size_t maxNumSamples,
float *times,
VtValue *samples,
263 VtIntArray *sampleIndices);
265 HdSceneIndexBaseRefPtr _inputSceneIndex;
267 struct _PrimCacheEntry
271 using PrimvarDescriptorsArray =
272 std::array<HdPrimvarDescriptorVector, HdInterpolationCount>;
273 std::shared_ptr<PrimvarDescriptorsArray> primvarDescriptors;
274 using ExtCmpPrimvarDescriptorsArray =
277 std::shared_ptr<ExtCmpPrimvarDescriptorsArray> extCmpPrimvarDescriptors;
283 std::shared_ptr<_PrimCacheEntry::PrimvarDescriptorsArray>
284 _ComputePrimvarDescriptors(
285 const HdContainerDataSourceHandle &primDataSource);
286 std::shared_ptr<_PrimCacheEntry::ExtCmpPrimvarDescriptorsArray>
287 _ComputeExtCmpPrimvarDescriptors(
288 const HdContainerDataSourceHandle &primDataSource);
290 bool _sceneDelegatesBuilt;
291 std::vector<HdSceneDelegate*> _sceneDelegates;
299 std::unordered_set<SdfPath, SdfPath::Hash> _geomSubsetParents;
std::shared_ptr< SdfPathVector > HdIdVectorSharedPtr
A shared pointer to a vector of id's.
GfMatrix4d GetInstancerTransform(SdfPath const &instancerId) override
Returns the instancer transform.
~HdSceneIndexAdapterSceneDelegate() override
VtValue Get(SdfPath const &id, TfToken const &key) override
Returns a named value.
PXR_NAMESPACE_OPEN_SCOPE HD_API HdExtComputationPrimvarDescriptor HdExtComputationPrimvarDescriptorFromSchema(TfToken const &name, HdExtComputationPrimvarSchema primvar)
void PrimsDirtied(const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override
HdIdVectorSharedPtr GetCoordSysBindings(SdfPath const &id) override
Returns the coordinate system bindings, or a nullptr if none are bound.
#define PXR_NAMESPACE_OPEN_SCOPE
VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId) override
size_t SampleTransform(SdfPath const &id, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override
HdExtComputationOutputDescriptorVector GetExtComputationOutputDescriptors(SdfPath const &computationId) override
SdfPath GetDataSharingId(SdfPath const &primId) override
VtValue GetLightParamValue(SdfPath const &id, TfToken const ¶mName) override
std::vector< HdExtComputationInputDescriptor > HdExtComputationInputDescriptorVector
HdPrimvarDescriptorVector GetPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolation) override
Returns descriptors for all primvars of the given interpolation type.
HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id) override
Gets the topological curve data for a given prim.
std::vector< HdExtComputationOutputDescriptor > HdExtComputationOutputDescriptorVector
HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(SdfPath const &volumeId) override
VtValue GetShadingStyle(SdfPath const &id) override
Returns the shading style for the given prim.
void PrimsRemoved(const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override
SdfPath GetInstancerId(SdfPath const &primId) override
Returns the parent instancer of the given rprim or instancer.
void Sync(HdSyncRequestVector *request) override
Synchronizes the delegate state for the given request vector.
std::string GetExtComputationKernel(SdfPath const &computationId) override
std::vector< VtArray< TfToken > > GetInstanceCategories(SdfPath const &instancerId) override
Returns the categories for each of the instances in the instancer.
VtValue GetMaterialResource(SdfPath const &id) override
Returns the material ID bound to the rprim rprimId.
VtValue GetVolumeParamValue(SdfPath const &id, TfToken const ¶mName) override
GfMatrix4d GetTransform(SdfPath const &id) override
Returns the object space transform, including all parent transforms.
void PostSyncCleanup() override
size_t SamplePrimvar(SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override
VtValue GetExtComputationInput(SdfPath const &computationId, TfToken const &input) override
size_t SampleInstancerTransform(SdfPath const &instancerId, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override
std::vector< class SdfPath > SdfPathVector
HdDisplayStyle GetDisplayStyle(SdfPath const &id) override
Returns the display style for the given prim.
void PrimsAdded(const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override
HdCullStyle GetCullStyle(SdfPath const &id) override
Returns the cullstyle for the given prim.
GfRange3d GetExtent(SdfPath const &id) override
VtValue GetIndexedPrimvar(SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override
size_t SampleIndexedPrimvar(SdfPath const &id, TfToken const &key, size_t maxNumSamples, float *times, VtValue *samples, VtIntArray *sampleIndices) override
HdExtComputationInputDescriptorVector GetExtComputationInputDescriptors(SdfPath const &computationId) override
void PrimsRenamed(const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override
std::vector< TfToken > TfTokenVector
Convenience types.
HdSceneIndexAdapterSceneDelegate(HdSceneIndexBaseRefPtr inputSceneIndex, HdRenderIndex *parentIndex, SdfPath const &delegateID)
GLuint const GLchar * name
std::vector< HdVolumeFieldDescriptor > HdVolumeFieldDescriptorVector
HdRenderBufferDescriptor GetRenderBufferDescriptor(SdfPath const &id) override
Returns the allocation descriptor for a given render buffer prim.
VtArray< TfToken > GetCategories(SdfPath const &id) override
void InvokeExtComputation(SdfPath const &computationId, HdExtComputationContext *context) override
bool GetVisible(SdfPath const &id) override
Returns the authored visible state of the prim.
PxOsdSubdivTags GetSubdivTags(SdfPath const &id) override
Gets the subdivision surface tags (sharpness, holes, etc).
#define PXR_NAMESPACE_CLOSE_SCOPE
TfTokenVector GetTaskRenderTags(SdfPath const &taskId) override
SdfPath GetMaterialId(SdfPath const &id) override
Returns the material ID bound to the rprim rprimId.
TfTokenVector GetExtComputationSceneInputNames(SdfPath const &computationId) override
std::vector< HdPrimvarDescriptor > HdPrimvarDescriptorVector
HD_API HdPrimvarDescriptor HdPrimvarDescriptorFromSchema(TfToken const &name, HdPrimvarSchema primvar)
Convert a primvar descriptor from Hydra 2 to Hydra 1 representation...
TfToken GetRenderTag(SdfPath const &id) override
bool GetDoubleSided(SdfPath const &id) override
Returns the doubleSided state for the given prim.
HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolationMode) override
SdfPathVector GetInstancerPrototypes(SdfPath const &instancerId) override
VtValue GetCameraParamValue(SdfPath const &cameraId, TfToken const ¶mName) override
HdMeshTopology GetMeshTopology(SdfPath const &id) override
Gets the topological mesh data for a given prim.
size_t SampleExtComputationInput(SdfPath const &computationId, TfToken const &input, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override
std::vector< HdExtComputationPrimvarDescriptor > HdExtComputationPrimvarDescriptorVector
HdReprSelector GetReprSelector(SdfPath const &id) override
Returns the authored repr (if any) for the given prim.