24 #ifndef PXR_IMAGING_HD_SCENE_DELEGATE_H
25 #define PXR_IMAGING_HD_SCENE_DELEGATE_H
41 #include "pxr/base/vt/array.h"
131 bool flatShading =
false,
132 bool displacement =
true,
133 bool occludedSelectionShowsThrough_ =
false,
134 bool pointsShadingEnabled_ =
false,
135 bool materialIsFinal_ =
false)
143 if (refineLevel_ < 0) {
145 }
else if (refineLevel_ > 8) {
163 return !(*
this == rhs);
190 TfToken const& role_=HdPrimvarRoleTokens->none,
199 return !(*
this == rhs);
237 :
drawMode(HdModelDrawModeTokens->inherited)
245 bool applyDrawMode_=
false,
247 TfToken const& cardGeometry_=HdModelDrawModeTokens->cross,
274 return !(*
this == rhs);
297 SdfPath const & sourceComputationId_,
298 TfToken const & sourceComputationOutputName_,
312 return !(*
this == rhs);
316 typedef std::vector<HdExtComputationPrimvarDescriptor>
335 SdfPath const & sourceComputationId_,
336 TfToken const & sourceComputationOutputName_)
347 return !(*
this == rhs);
351 typedef std::vector<HdExtComputationInputDescriptor>
376 return !(*
this == rhs);
380 typedef std::vector<HdExtComputationOutputDescriptor>
395 TfToken const & fieldPrimType_,
401 typedef std::vector<HdVolumeFieldDescriptor>
510 VtIntArray *outIndices);
527 virtual std::vector<VtArray<TfToken>>
552 size_t maxSampleCount,
559 template <
unsigned int CAPACITY>
563 size_t authoredSamples =
565 if (authoredSamples > CAPACITY) {
566 sa->
Resize(authoredSamples);
567 size_t authoredSamplesSecondAttempt =
575 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
577 sa->
count = authoredSamples;
590 size_t maxSampleCount,
598 template <
unsigned int CAPACITY>
602 size_t authoredSamples =
608 if (authoredSamples > CAPACITY) {
609 sa->
Resize(authoredSamples);
610 size_t authoredSamplesSecondAttempt =
618 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
620 sa->
count = authoredSamples;
644 size_t maxSampleCount,
651 template <
unsigned int CAPACITY>
666 size_t maxSampleCount,
669 VtIntArray *sampleIndices);
674 template <
unsigned int CAPACITY>
735 std::vector<int> instanceIndices,
736 std::vector<HdInstancerContext> *instancerContexts =
nullptr);
860 size_t maxSampleCount,
868 template <
unsigned int CAPACITY>
873 computationId, input, CAPACITY,
876 if (authoredSamples > CAPACITY) {
877 sa->
Resize(authoredSamples);
879 computationId, input, authoredSamples,
883 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
885 sa->
count = authoredSamples;
927 HdSceneDelegate() =
delete;
928 HdSceneDelegate(HdSceneDelegate &) =
delete;
929 HdSceneDelegate &operator=(HdSceneDelegate &) =
delete;
932 template <
unsigned int CAPACITY>
937 size_t authoredSamples =
944 if (authoredSamples > CAPACITY) {
945 sa->
Resize(authoredSamples);
946 size_t authoredSamplesSecondAttempt =
955 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
957 sa->
count = authoredSamples;
960 template <
unsigned int CAPACITY>
965 size_t authoredSamples =
973 if (authoredSamples > CAPACITY) {
974 sa->
Resize(authoredSamples);
975 size_t authoredSamplesSecondAttempt =
985 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
987 sa->
count = authoredSamples;
992 #endif //PXR_IMAGING_HD_SCENE_DELEGATE_H
std::shared_ptr< SdfPathVector > HdIdVectorSharedPtr
A shared pointer to a vector of id's.
SdfAssetPath cardTextureXNeg
void SampleInstancerTransform(SdfPath const &instancerId, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
virtual HD_API VtValue GetExtComputationInput(SdfPath const &computationId, TfToken const &input)
virtual HD_API SdfPath GetScenePrimPath(SdfPath const &rprimId, int instanceIndex, HdInstancerContext *instancerContext=nullptr)
bool operator==(HdExtComputationOutputDescriptor const &rhs) const
virtual HD_API size_t SamplePrimvar(SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues)
virtual HD_API void PostSyncCleanup()
SdfAssetPath cardTextureZNeg
virtual HD_API VtValue GetIndexedPrimvar(SdfPath const &id, TfToken const &key, VtIntArray *outIndices)
virtual HD_API void InvokeExtComputation(SdfPath const &computationId, HdExtComputationContext *context)
virtual HD_API SdfPath GetDataSharingId(SdfPath const &primId)
TfSmallVector< float, CAPACITY > times
SdfAssetPath cardTextureXPos
virtual HD_API bool GetVisible(SdfPath const &id)
Returns the authored visible state of the prim.
HdVolumeFieldDescriptor()
virtual HD_API SdfPath GetInstancerId(SdfPath const &primId)
Returns the parent instancer of the given rprim or instancer.
HdExtComputationPrimvarDescriptor()
bool operator!=(HdPrimvarDescriptor const &rhs) const
void SampleExtComputationInput(SdfPath const &computationId, TfToken const &input, HdTimeSampleArray< VtValue, CAPACITY > *sa)
GLsizei const GLchar *const * string
TfToken sourceComputationOutputName
~HdDisplayStyle()=default
bool operator!=(HdExtComputationPrimvarDescriptor const &rhs) const
std::vector< HdExtComputationInputDescriptor > HdExtComputationInputDescriptorVector
virtual HD_API HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(SdfPath const &volumeId)
virtual HD_API HdExtComputationInputDescriptorVector GetExtComputationInputDescriptors(SdfPath const &computationId)
bool operator!=(HdExtComputationOutputDescriptor const &rhs) const
virtual HD_API std::string GetExtComputationKernel(SdfPath const &computationId)
virtual HD_API bool IsEnabled(TfToken const &option) const
Returns true if the named option is enabled by the delegate.
virtual HD_API SdfPathVector GetInstancerPrototypes(SdfPath const &instancerId)
HdVolumeFieldDescriptor(TfToken const &fieldName_, TfToken const &fieldPrimType_, SdfPath const &fieldId_)
int refineLevel
The prim refine level, in the range [0, 8].
std::vector< HdExtComputationOutputDescriptor > HdExtComputationOutputDescriptorVector
virtual HD_API size_t SampleIndexedPrimvar(SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues, VtIntArray *sampleIndices)
virtual HD_API GfMatrix4d GetInstancerTransform(SdfPath const &instancerId)
Returns the instancer transform.
bool operator!=(HdModelDrawMode const &rhs) const
HdPrimvarDescriptor(TfToken const &name_, HdInterpolation interp_, TfToken const &role_=HdPrimvarRoleTokens->none, bool indexed_=false)
virtual HD_API HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id)
Gets the topological curve data for a given prim.
virtual HD_API PxOsdSubdivTags GetSubdivTags(SdfPath const &id)
Gets the subdivision surface tags (sharpness, holes, etc).
virtual HD_API HdIdVectorSharedPtr GetCoordSysBindings(SdfPath const &id)
Returns the coordinate system bindings, or a nullptr if none are bound.
HdExtComputationPrimvarDescriptor(TfToken const &name_, HdInterpolation interp_, TfToken const &role_, SdfPath const &sourceComputationId_, TfToken const &sourceComputationOutputName_, HdTupleType const &valueType_)
std::vector< std::pair< SdfPath, int > > HdInstancerContext
Instancer context: a pair of instancer paths and instance indices.
virtual HD_API VtValue GetMaterialResource(SdfPath const &materialId)
Returns the material ID bound to the rprim rprimId.
bool occludedSelectionShowsThrough
virtual HD_API HdDisplayStyle GetDisplayStyle(SdfPath const &id)
virtual HD_API VtArray< TfToken > GetCategories(SdfPath const &id)
Returns the prim categories.
HdInterpolation interpolation
Interpolation (data-sampling rate) of the primvar.
virtual HD_API VtValue GetLightParamValue(SdfPath const &id, TfToken const ¶mName)
bool pointsShadingEnabled
TfToken name
Name of the primvar.
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
bool operator==(HdDisplayStyle const &rhs) const
SdfAssetPath cardTextureZPos
virtual HD_API HdPrimvarDescriptorVector GetPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolation)
Returns descriptors for all primvars of the given interpolation type.
virtual HD_API GfMatrix4d GetTransform(SdfPath const &id)
Returns the object space transform, including all parent transforms.
std::vector< TfToken > TfTokenVector
Convenience types.
bool displacementEnabled
Is the prim displacement shaded.
virtual HD_API GfRange3d GetExtent(SdfPath const &id)
std::vector< HdDirtyBits > dirtyBits
virtual HD_API TfToken GetRenderTag(SdfPath const &id)
GLuint const GLchar * name
bool operator==(HdExtComputationPrimvarDescriptor const &rhs) const
virtual HD_API size_t SampleTransform(SdfPath const &id, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues)
bool operator==(HdModelDrawMode const &rhs) const
std::vector< HdVolumeFieldDescriptor > HdVolumeFieldDescriptorVector
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
TfSmallVector< TYPE, CAPACITY > values
virtual HD_API SdfPath GetMaterialId(SdfPath const &rprimId)
Returns the material ID bound to the rprim rprimId.
SdfPath const & GetDelegateID() const
virtual HD_API HdModelDrawMode GetModelDrawMode(SdfPath const &id)
Returns the model draw mode object for the given prim.
virtual HD_API void Sync(HdSyncRequestVector *request)
Synchronizes the delegate state for the given request vector.
virtual void Resize(unsigned int newSize)
Resize the internal buffers.
void Resize(unsigned int newSize) override
Resize the internal buffers.
virtual HD_API VtValue Get(SdfPath const &id, TfToken const &key)
Returns a named value.
virtual HD_API VtValue GetCameraParamValue(SdfPath const &cameraId, TfToken const ¶mName)
virtual HD_API size_t SampleExtComputationInput(SdfPath const &computationId, TfToken const &input, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
HdExtComputationOutputDescriptor()
bool operator!=(HdDisplayStyle const &rhs) const
bool flatShadingEnabled
Is the prim flat shaded.
virtual HD_API HdMeshTopology GetMeshTopology(SdfPath const &id)
Gets the topological mesh data for a given prim.
virtual HD_API ~HdSceneDelegate()
HdModelDrawMode(TfToken const &drawMode_, bool applyDrawMode_=false, GfVec3f drawModeColor_=GfVec3f(0.18), TfToken const &cardGeometry_=HdModelDrawModeTokens->cross, SdfAssetPath cardTextureXPos_=SdfAssetPath(), SdfAssetPath cardTextureYPos_=SdfAssetPath(), SdfAssetPath cardTextureZPos_=SdfAssetPath(), SdfAssetPath cardTextureXNeg_=SdfAssetPath(), SdfAssetPath cardTextureYNeg_=SdfAssetPath(), SdfAssetPath cardTextureZNeg_=SdfAssetPath())
HdExtComputationOutputDescriptor(TfToken const &name_, HdTupleType const &valueType_)
virtual HD_API TfTokenVector GetExtComputationSceneInputNames(SdfPath const &computationId)
virtual HD_API TfTokenVector GetTaskRenderTags(SdfPath const &taskId)
virtual HD_API HdReprSelector GetReprSelector(SdfPath const &id)
Returns the authored repr (if any) for the given prim.
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
#define PXR_NAMESPACE_CLOSE_SCOPE
virtual HD_API size_t SampleInstancerTransform(SdfPath const &instancerId, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues)
virtual HD_API std::vector< VtArray< TfToken > > GetInstanceCategories(SdfPath const &instancerId)
Returns the categories for all instances in the instancer.
virtual HD_API HdCullStyle GetCullStyle(SdfPath const &id)
Returns the cullstyle for the given prim.
void SampleTransform(SdfPath const &id, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
virtual HD_API HdRenderBufferDescriptor GetRenderBufferDescriptor(SdfPath const &id)
Returns the allocation descriptor for a given render buffer prim.
virtual HD_API HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolationMode)
virtual HD_API VtValue GetShadingStyle(SdfPath const &id)
Returns the shading style for the given prim.
HdDisplayStyle(int refineLevel_, bool flatShading=false, bool displacement=true, bool occludedSelectionShowsThrough_=false, bool pointsShadingEnabled_=false, bool materialIsFinal_=false)
std::vector< HdPrimvarDescriptor > HdPrimvarDescriptorVector
SdfAssetPath cardTextureYPos
bool operator==(HdPrimvarDescriptor const &rhs) const
virtual HD_API HdExtComputationOutputDescriptorVector GetExtComputationOutputDescriptors(SdfPath const &computationId)
SdfAssetPath cardTextureYNeg
virtual HD_API SdfPathVector GetScenePrimPaths(SdfPath const &rprimId, std::vector< int > instanceIndices, std::vector< HdInstancerContext > *instancerContexts=nullptr)
TfSmallVector< VtIntArray, CAPACITY > indices
SIM_DerVector3 cross(const SIM_DerVector3 &lhs, const SIM_DerVector3 &rhs)
virtual HD_API VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId)
SdfPath sourceComputationId
virtual HD_API bool GetDoubleSided(SdfPath const &id)
Returns the doubleSided state for the given prim.
std::vector< HdExtComputationPrimvarDescriptor > HdExtComputationPrimvarDescriptorVector