HDK
|
#include <sceneIndexAdapterSceneDelegate.h>
Public Member Functions | |
HdSceneIndexAdapterSceneDelegate (HdSceneIndexBaseRefPtr inputSceneIndex, HdRenderIndex *parentIndex, SdfPath const &delegateID) | |
~HdSceneIndexAdapterSceneDelegate () override | |
void | PrimsAdded (const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override |
void | PrimsRemoved (const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override |
void | PrimsDirtied (const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override |
void | PrimsRenamed (const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override |
HdMeshTopology | GetMeshTopology (SdfPath const &id) override |
Gets the topological mesh data for a given prim. More... | |
HdBasisCurvesTopology | GetBasisCurvesTopology (SdfPath const &id) override |
Gets the topological curve data for a given prim. More... | |
PxOsdSubdivTags | GetSubdivTags (SdfPath const &id) override |
Gets the subdivision surface tags (sharpness, holes, etc). More... | |
GfRange3d | GetExtent (SdfPath const &id) override |
bool | GetVisible (SdfPath const &id) override |
Returns the authored visible state of the prim. More... | |
bool | GetDoubleSided (SdfPath const &id) override |
Returns the doubleSided state for the given prim. More... | |
HdCullStyle | GetCullStyle (SdfPath const &id) override |
Returns the cullstyle for the given prim. More... | |
VtValue | GetShadingStyle (SdfPath const &id) override |
Returns the shading style for the given prim. More... | |
HdDisplayStyle | GetDisplayStyle (SdfPath const &id) override |
HdReprSelector | GetReprSelector (SdfPath const &id) override |
Returns the authored repr (if any) for the given prim. More... | |
TfToken | GetRenderTag (SdfPath const &id) override |
VtArray< TfToken > | GetCategories (SdfPath const &id) override |
Returns the prim categories. More... | |
HdVolumeFieldDescriptorVector | GetVolumeFieldDescriptors (SdfPath const &volumeId) override |
GfMatrix4d | GetTransform (SdfPath const &id) override |
Returns the object space transform, including all parent transforms. More... | |
size_t | SampleTransform (SdfPath const &id, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override |
GfMatrix4d | GetInstancerTransform (SdfPath const &instancerId) override |
Returns the instancer transform. More... | |
size_t | SampleInstancerTransform (SdfPath const &instancerId, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override |
HdPrimvarDescriptorVector | GetPrimvarDescriptors (SdfPath const &id, HdInterpolation interpolation) override |
Returns descriptors for all primvars of the given interpolation type. More... | |
VtValue | Get (SdfPath const &id, TfToken const &key) override |
Returns a named value. More... | |
VtValue | GetIndexedPrimvar (SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override |
size_t | SamplePrimvar (SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override |
size_t | SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, size_t maxNumSamples, float *times, VtValue *samples, VtIntArray *sampleIndices) override |
std::vector< VtArray< TfToken > > | GetInstanceCategories (SdfPath const &instancerId) override |
Returns the categories for all instances in the instancer. More... | |
VtIntArray | GetInstanceIndices (SdfPath const &instancerId, SdfPath const &prototypeId) override |
SdfPath | GetInstancerId (SdfPath const &primId) override |
Returns the parent instancer of the given rprim or instancer. More... | |
SdfPathVector | GetInstancerPrototypes (SdfPath const &instancerId) override |
SdfPath | GetDataSharingId (SdfPath const &primId) override |
SdfPath | GetMaterialId (SdfPath const &id) override |
Returns the material ID bound to the rprim rprimId . More... | |
VtValue | GetMaterialResource (SdfPath const &id) override |
Returns the material ID bound to the rprim rprimId . More... | |
HdIdVectorSharedPtr | GetCoordSysBindings (SdfPath const &id) override |
Returns the coordinate system bindings, or a nullptr if none are bound. More... | |
HdRenderBufferDescriptor | GetRenderBufferDescriptor (SdfPath const &id) override |
Returns the allocation descriptor for a given render buffer prim. More... | |
VtValue | GetLightParamValue (SdfPath const &id, TfToken const ¶mName) override |
VtValue | GetCameraParamValue (SdfPath const &cameraId, TfToken const ¶mName) override |
HdExtComputationPrimvarDescriptorVector | GetExtComputationPrimvarDescriptors (SdfPath const &id, HdInterpolation interpolationMode) override |
TfTokenVector | GetExtComputationSceneInputNames (SdfPath const &computationId) override |
VtValue | GetExtComputationInput (SdfPath const &computationId, TfToken const &input) override |
size_t | SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override |
HdExtComputationInputDescriptorVector | GetExtComputationInputDescriptors (SdfPath const &computationId) override |
HdExtComputationOutputDescriptorVector | GetExtComputationOutputDescriptors (SdfPath const &computationId) override |
std::string | GetExtComputationKernel (SdfPath const &computationId) override |
void | InvokeExtComputation (SdfPath const &computationId, HdExtComputationContext *context) override |
void | Sync (HdSyncRequestVector *request) override |
Synchronizes the delegate state for the given request vector. More... | |
void | PostSyncCleanup () override |
Public Member Functions inherited from HdSceneDelegate | |
HD_API | HdSceneDelegate (HdRenderIndex *parentIndex, SdfPath const &delegateID) |
Constructor used for nested delegate objects which share a RenderIndex. More... | |
virtual HD_API | ~HdSceneDelegate () |
HdRenderIndex & | GetRenderIndex () |
Returns the RenderIndex owned by this delegate. More... | |
SdfPath const & | GetDelegateID () const |
virtual HD_API bool | IsEnabled (TfToken const &option) const |
Returns true if the named option is enabled by the delegate. More... | |
virtual HD_API HdModelDrawMode | GetModelDrawMode (SdfPath const &id) |
Returns the model draw mode object for the given prim. More... | |
template<unsigned int CAPACITY> | |
void | SampleTransform (SdfPath const &id, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa) |
template<unsigned int CAPACITY> | |
void | SampleInstancerTransform (SdfPath const &instancerId, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa) |
template<unsigned int CAPACITY> | |
void | SamplePrimvar (SdfPath const &id, TfToken const &key, HdTimeSampleArray< VtValue, CAPACITY > *sa) |
template<unsigned int CAPACITY> | |
void | SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, HdIndexedTimeSampleArray< VtValue, CAPACITY > *sa) |
virtual HD_API SdfPath | GetScenePrimPath (SdfPath const &rprimId, int instanceIndex, HdInstancerContext *instancerContext=nullptr) |
virtual HD_API SdfPathVector | GetScenePrimPaths (SdfPath const &rprimId, std::vector< int > instanceIndices, std::vector< HdInstancerContext > *instancerContexts=nullptr) |
template<unsigned int CAPACITY> | |
void | SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, HdTimeSampleArray< VtValue, CAPACITY > *sa) |
virtual HD_API TfTokenVector | GetTaskRenderTags (SdfPath const &taskId) |
Public Member Functions inherited from HdSceneIndexObserver | |
virtual HD_API | ~HdSceneIndexObserver () |
Public Member Functions inherited from TfWeakBase | |
TfWeakBase () | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Static Public Member Functions | |
static HdSceneIndexBaseRefPtr | AppendDefaultSceneFilters (HdSceneIndexBaseRefPtr inputSceneIndex, SdfPath const &delegateID) |
Static Public Member Functions inherited from HdSceneIndexObserver | |
static HD_API void | ConvertPrimsRenamedToRemovedAndAdded (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver::RemovedPrimEntries *outputRemovedEntries, HdSceneIndexObserver::AddedPrimEntries *outputAddedEntries) |
static HD_API void | ConvertPrimsRenamedToRemovedAndAdded (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver *observer) |
Additional Inherited Members | |
Public Types inherited from HdSceneIndexObserver | |
using | AddedPrimEntries = TfSmallVector< AddedPrimEntry, 16 > |
using | RemovedPrimEntries = TfSmallVector< RemovedPrimEntry, 16 > |
using | DirtiedPrimEntries = TfSmallVector< DirtiedPrimEntry, 16 > |
using | RenamedPrimEntries = TfSmallVector< RenamedPrimEntry, 16 > |
Protected Member Functions inherited from TfWeakBase | |
~TfWeakBase () | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
Scene delegate which observes notices from an HdSceneIndex and applies them to an HdRenderIndex. This serves as "back-end" emulation in order for scenes described via the HdSceneIndex/HdDataSource APIs to be accessible by legacy render delegates.
Definition at line 42 of file sceneIndexAdapterSceneDelegate.h.
HdSceneIndexAdapterSceneDelegate::HdSceneIndexAdapterSceneDelegate | ( | HdSceneIndexBaseRefPtr | inputSceneIndex, |
HdRenderIndex * | parentIndex, | ||
SdfPath const & | delegateID | ||
) |
|
override |
|
static |
Returns the end of a scene index chain containing the filters necessary for input to an instance of this scene delegate.
|
overridevirtual |
Returns a named value.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the topological curve data for a given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a single value for a given camera and parameter. See HdCameraTokens for the list of paramters.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the prim categories.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the coordinate system bindings, or a nullptr if none are bound.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the cullstyle for the given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns an identifier that can be used to share data between HdPrims during a Sync operation. Any number of HdPrims of the same type may return the same identifier. In this situation, the render delegate can choose to share information between HdPrims rather than fetching data for each HdPrim. For the UsdImagingSceneDelegate, this identifier will be the path of the GetPrototype prim for the UsdPrim correspnding to this HdPrim. Returns an empty SdfPath if this feature is no supported or the UsdPrim has no prototype. Render delegates are free to ignore this method completely if they aren't interested in the additional level of data sharing enabled by this information.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the refinement level for the given prim in the range [0,8].
The refinement level indicates how many iterations to apply when subdividing subdivision surfaces or other refinable primitives.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the doubleSided state for the given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a single value for a given computation id and input token. The token may be a computation input or a computation config parameter.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
For the given computation id, returns a list of computation input descriptors.
See HdExtComputationInputDecriptor
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the kernel source assigned to the computation at the path id. If the string is empty the computation has no GPU kernel and the CPU callback should be used.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
For the given computation id, returns a list of computation output descriptors.
See HdExtComputationOutputDescriptor
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a list of primvar names that should be bound to a generated output from an ExtComputation for the given prim id and interpolation mode. Binding information is obtained through GetExtComputationPrimvarDesc() Returns a structure describing source information for a primvar that is bound to an ExtComputation. See HdExtComputationPrimvarDesc for the expected information to be returned.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
For the given computation id, returns a list of inputs which will be requested from the scene delegate using the Get() method.
See GetExtComputationInputDescriptors and GetExtComputationOutpuDescriptors for descriptions of other computation inputs and outputs.
Reimplemented from HdSceneDelegate.
Gets the axis aligned bounds of a prim. The returned bounds are in the local space of the prim (transform is yet to be applied) and should contain the bounds of any child prims.
The returned bounds does not include any displacement that might occur as the result of running shaders on the prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a named primvar value. If *outIndices is not nullptr and the primvar has indices, it will return the unflattened primvar and set *outIndices to the primvar's associated indices, clearing the array if the primvar is not indexed.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the categories for all instances in the instancer.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the extracted indices array of the prototype id used in the instancer.
example instances: 0, 1, 2, 3, 4, 5 protoypes: A, B, A, A, B, C
GetInstanceIndices(A) : [0, 2, 3] GetInstanceIndices(B) : [1, 4] GetInstanceIndices(C) : [5] GetInstanceIndices(D) : []
Reimplemented from HdSceneDelegate.
Returns the parent instancer of the given rprim or instancer.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a list of prototypes of this instancer. The intent is to let renderers cache instance indices by giving them a complete set of prims to call GetInstanceIndices(instancer, prototype) on. XXX: This is currently unused, but may be used in the future.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the instancer transform.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
Returns the material ID bound to the rprim rprimId
.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the material ID bound to the rprim rprimId
.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the topological mesh data for a given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns descriptors for all primvars of the given interpolation type.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the allocation descriptor for a given render buffer prim.
Reimplemented from HdSceneDelegate.
Returns the render tag that will be used to bucket prims during render pass bucketing.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the authored repr (if any) for the given prim.
Reimplemented from HdSceneDelegate.
Returns the shading style for the given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the subdivision surface tags (sharpness, holes, etc).
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the object space transform, including all parent transforms.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the authored visible state of the prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Requests the scene delegate run the ExtComputation with the given id. The context contains the input values that delegate requested through GetExtComputationInputNames().
The scene delegate is expected to set each output identified by GetExtComputationOutputNames() on the context.
Hydra may invoke the computation on a different thread from what HdEngine::Execute() was called on. It may also invoke many computations in parallel.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Opportunity for the delegate to clean itself up after performing parallel work during sync phase
Reimplemented from HdSceneDelegate.
|
overridevirtual |
A notification indicating prims have been added to the scene. The set of scene prims compiled from added/removed notices should match the set from a traversal based on sender.GetChildPrimNames
. Each prim has a path and type. It's possible for PrimsAdded
to be called for prims that already exist; in that case, observers should be sure to update the prim type, in case it changed, and resync the prim. This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
A notification indicating prim datasources have been invalidated. This message is not considered hierarchical on primPath
; if /Path
is dirtied, /Path/child
is not necessarily dirtied. However datasource locators are considered hierarchical: if primvars
is dirtied on a prim, primvars/color
is considered dirtied as well. This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
A notification indicating prims have been removed from the scene. Note that this message is considered hierarchical; if /Path
is removed, /Path/child
is considered removed as well. This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
A notification indicating prims (and their descendants) have been renamed or reparented. This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
Return up to maxSampleCount samples for a given computation id and input token. The token may be a computation input or a computation config parameter. Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
SamplePrimvar() for getting an unflattened primvar and its indices. If *sampleIndices is not nullptr and the primvar has indices, it will return unflattened primvar samples in *sampleValues and the primvar's sampled indices in *sampleIndices, clearing the *sampleIndices array if the primvar is not indexed.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Store up to maxSampleCount transform samples in *sampleValues. Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data. Sample times are relative to the scene delegate's current time.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Store up to maxSampleCount primvar samples in *samplesValues. Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data.
Sample values that are array-valued will have a size described by the HdPrimvarDescriptor as applied to the toplogy.
For example, this means that a mesh that is fracturing over time will return samples with the same number of points; the number of points will change as the scene delegate is resynchronized to represent the scene at a time with different topology.
Sample times are relative to the scene delegate's current time.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Store up to maxSampleCount transform samples in *sampleValues. Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data. Sample times are relative to the scene delegate's current time.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Synchronizes the delegate state for the given request vector.
Reimplemented from HdSceneDelegate.