7 #ifndef PXR_IMAGING_HD_SCENE_DELEGATE_H
8 #define PXR_IMAGING_HD_SCENE_DELEGATE_H
24 #include "pxr/base/vt/array.h"
123 bool flatShading =
false,
124 bool displacement =
true,
125 bool displayInOverlay_ =
false,
126 bool occludedSelectionShowsThrough_ =
false,
127 bool pointsShadingEnabled_ =
false,
128 bool materialIsFinal_ =
false)
137 if (refineLevel_ < 0) {
139 }
else if (refineLevel_ > 8) {
158 return !(*
this == rhs);
185 TfToken const& role_=HdPrimvarRoleTokens->none,
194 return !(*
this == rhs);
232 :
drawMode(HdModelDrawModeTokens->inherited)
241 bool applyDrawMode_=
false,
243 TfToken const& cardGeometry_=HdModelDrawModeTokens->cross,
270 return !(*
this == rhs);
293 SdfPath const & sourceComputationId_,
294 TfToken const & sourceComputationOutputName_,
308 return !(*
this == rhs);
312 typedef std::vector<HdExtComputationPrimvarDescriptor>
331 SdfPath const & sourceComputationId_,
332 TfToken const & sourceComputationOutputName_)
343 return !(*
this == rhs);
347 typedef std::vector<HdExtComputationInputDescriptor>
372 return !(*
this == rhs);
376 typedef std::vector<HdExtComputationOutputDescriptor>
391 TfToken const & fieldPrimType_,
397 typedef std::vector<HdVolumeFieldDescriptor>
503 VtIntArray *outIndices);
521 virtual std::vector<VtArray<TfToken>>
554 size_t maxSampleCount,
566 size_t maxSampleCount,
573 template <
unsigned int CAPACITY>
582 template <
unsigned int CAPACITY>
607 size_t maxSampleCount,
619 size_t maxSampleCount,
627 template <
unsigned int CAPACITY>
636 template <
unsigned int CAPACITY>
639 float startTime,
float endTime,
670 size_t maxSampleCount,
683 size_t maxSampleCount,
690 template <
unsigned int CAPACITY>
700 template <
unsigned int CAPACITY>
717 size_t maxSampleCount,
720 VtIntArray *sampleIndices);
731 size_t maxSampleCount,
734 VtIntArray *sampleIndices);
740 template <
unsigned int CAPACITY>
750 template <
unsigned int CAPACITY>
813 std::vector<int> instanceIndices,
814 std::vector<HdInstancerContext> *instancerContexts =
nullptr);
938 size_t maxSampleCount,
950 size_t maxSampleCount,
958 template <
unsigned int CAPACITY>
967 template <
unsigned int CAPACITY>
1013 HdSceneDelegate() =
delete;
1014 HdSceneDelegate(HdSceneDelegate &) =
delete;
1015 HdSceneDelegate &operator=(HdSceneDelegate &) =
delete;
1018 template <
unsigned int CAPACITY>
1022 size_t authoredSamples =
1024 if (authoredSamples > CAPACITY) {
1025 sa->
Resize(authoredSamples);
1026 size_t authoredSamplesSecondAttempt =
1034 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1036 sa->
count = authoredSamples;
1039 template <
unsigned int CAPACITY>
1045 size_t authoredSamples =
1048 if (authoredSamples > CAPACITY) {
1049 sa->
Resize(authoredSamples);
1050 size_t authoredSamplesSecondAttempt =
1060 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1062 sa->
count = authoredSamples;
1065 template <
unsigned int CAPACITY>
1070 size_t authoredSamples =
1076 if (authoredSamples > CAPACITY) {
1077 sa->
Resize(authoredSamples);
1078 size_t authoredSamplesSecondAttempt =
1086 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1088 sa->
count = authoredSamples;
1091 template <
unsigned int CAPACITY>
1095 float startTime,
float endTime,
1097 size_t authoredSamples =
1105 if (authoredSamples > CAPACITY) {
1106 sa->
Resize(authoredSamples);
1107 size_t authoredSamplesSecondAttempt =
1117 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1119 sa->
count = authoredSamples;
1122 template <
unsigned int CAPACITY>
1127 size_t authoredSamples =
1134 if (authoredSamples > CAPACITY) {
1135 sa->
Resize(authoredSamples);
1136 size_t authoredSamplesSecondAttempt =
1145 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1147 sa->
count = authoredSamples;
1150 template <
unsigned int CAPACITY>
1157 size_t authoredSamples =
1166 if (authoredSamples > CAPACITY) {
1167 sa->
Resize(authoredSamples);
1168 size_t authoredSamplesSecondAttempt =
1179 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1181 sa->
count = authoredSamples;
1184 template <
unsigned int CAPACITY>
1189 size_t authoredSamples =
1197 if (authoredSamples > CAPACITY) {
1198 sa->
Resize(authoredSamples);
1199 size_t authoredSamplesSecondAttempt =
1209 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1211 sa->
count = authoredSamples;
1214 template <
unsigned int CAPACITY>
1221 size_t authoredSamples =
1231 if (authoredSamples > CAPACITY) {
1232 sa->
Resize(authoredSamples);
1233 size_t authoredSamplesSecondAttempt =
1245 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1247 sa->
count = authoredSamples;
1250 template <
unsigned int CAPACITY>
1257 computationId, input, CAPACITY,
1260 if (authoredSamples > CAPACITY) {
1261 sa->
Resize(authoredSamples);
1263 computationId, input, authoredSamples,
1267 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1269 sa->
count = authoredSamples;
1272 template <
unsigned int CAPACITY>
1281 computationId, input, startTime, endTime, CAPACITY,
1284 if (authoredSamples > CAPACITY) {
1285 sa->
Resize(authoredSamples);
1287 computationId, input, startTime, endTime, authoredSamples,
1291 TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1293 sa->
count = authoredSamples;
1298 #endif //PXR_IMAGING_HD_SCENE_DELEGATE_H
std::shared_ptr< SdfPathVector > HdIdVectorSharedPtr
A shared pointer to a vector of id's.
SdfAssetPath cardTextureXNeg
HdDisplayStyle(int refineLevel_, bool flatShading=false, bool displacement=true, bool displayInOverlay_=false, bool occludedSelectionShowsThrough_=false, bool pointsShadingEnabled_=false, bool materialIsFinal_=false)
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
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_)
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.
bool displayInOverlay
Is the prim overlayed on top of other prims.
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)
Returns the display style for the given prim.
virtual HD_API VtArray< TfToken > GetCategories(SdfPath const &id)
HdInterpolation interpolation
Interpolation (data-sampling rate) of the primvar.
std::vector< class SdfPath > SdfPathVector
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
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())
DrawModeColor is specified in the rendering color space.
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 each of the instances in the instancer.
virtual HD_API HdCullStyle GetCullStyle(SdfPath const &id)
Returns the cullstyle for the given prim.
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.
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