sceneDelegate.h
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_IMAGING_HD_SCENE_DELEGATE_H
25 #define PXR_IMAGING_HD_SCENE_DELEGATE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
30 
31 #include "pxr/imaging/hd/aov.h"
32 #include "pxr/imaging/hd/basisCurvesTopology.h"
33 #include "pxr/imaging/hd/enums.h"
34 #include "pxr/imaging/hd/meshTopology.h"
35 #include "pxr/imaging/hd/renderIndex.h"
36 #include "pxr/imaging/hd/repr.h"
37 #include "pxr/imaging/hd/timeSampleArray.h"
38 
40 
41 #include "pxr/base/vt/array.h"
42 #include "pxr/base/vt/dictionary.h"
43 #include "pxr/base/vt/value.h"
44 #include "pxr/usd/sdf/path.h"
45 
46 #include "pxr/base/gf/vec2i.h"
47 #include "pxr/base/tf/hash.h"
48 
49 #include <memory>
50 #include <vector>
51 
52 PXR_NAMESPACE_OPEN_SCOPE
53 
55 
57 typedef std::shared_ptr<SdfPathVector> HdIdVectorSharedPtr;
58 
60 typedef std::vector<std::pair<SdfPath, int>> HdInstancerContext;
61 
69  // The Prims to synchronize in this request.
70  SdfPathVector IDs;
71 
72  // The HdChangeTracker::DirtyBits that are set for each Prim.
73  std::vector<HdDirtyBits> dirtyBits;
74 };
75 
83 
86 
89 
93 
99  : refineLevel(0)
100  , flatShadingEnabled(false)
101  , displacementEnabled(true)
103  { }
104 
112  HdDisplayStyle(int refineLevel_,
113  bool flatShading = false,
114  bool displacement = true,
115  bool occludedSelectionShowsThrough_ = false)
116  : refineLevel(std::max(0, refineLevel_))
117  , flatShadingEnabled(flatShading)
118  , displacementEnabled(displacement)
119  , occludedSelectionShowsThrough(occludedSelectionShowsThrough_)
120  {
121  if (refineLevel_ < 0) {
122  TF_CODING_ERROR("negative refine level is not supported");
123  } else if (refineLevel_ > 8) {
124  TF_CODING_ERROR("refine level > 8 is not supported");
125  }
126  }
127 
128  HdDisplayStyle(HdDisplayStyle const& rhs) = default;
129  ~HdDisplayStyle() = default;
130 
131  bool operator==(HdDisplayStyle const& rhs) const {
132  return refineLevel == rhs.refineLevel
137  }
138  bool operator!=(HdDisplayStyle const& rhs) const {
139  return !(*this == rhs);
140  }
141 };
142 
150  HdInterpolation interpolation;
157  bool indexed;
158 
160  : interpolation(HdInterpolationConstant)
161  , role(HdPrimvarRoleTokens->none)
162  , indexed(false)
163  {}
164  HdPrimvarDescriptor(TfToken const& name_,
165  HdInterpolation interp_,
166  TfToken const& role_=HdPrimvarRoleTokens->none,
167  bool indexed_=false)
168  : name(name_), interpolation(interp_), role(role_), indexed(indexed_)
169  { }
170  bool operator==(HdPrimvarDescriptor const& rhs) const {
171  return name == rhs.name && role == rhs.role
172  && interpolation == rhs.interpolation;
173  }
174  bool operator!=(HdPrimvarDescriptor const& rhs) const {
175  return !(*this == rhs);
176  }
177 };
178 
179 typedef std::vector<HdPrimvarDescriptor> HdPrimvarDescriptorVector;
180 
191  SdfPath sourceComputationId;
192  TfToken sourceComputationOutputName;
193  HdTupleType valueType;
194 
197  TfToken const& name_,
198  HdInterpolation interp_,
199  TfToken const & role_,
200  SdfPath const & sourceComputationId_,
201  TfToken const & sourceComputationOutputName_,
202  HdTupleType const & valueType_)
203  : HdPrimvarDescriptor(name_, interp_, role_, false)
204  , sourceComputationId(sourceComputationId_)
205  , sourceComputationOutputName(sourceComputationOutputName_)
206  , valueType(valueType_)
207  { }
208  bool operator==(HdExtComputationPrimvarDescriptor const& rhs) const {
209  return HdPrimvarDescriptor::operator==(rhs) &&
210  sourceComputationId == rhs.sourceComputationId &&
211  sourceComputationOutputName == rhs.sourceComputationOutputName &&
212  valueType == rhs.valueType;
213  }
214  bool operator!=(HdExtComputationPrimvarDescriptor const& rhs) const {
215  return !(*this == rhs);
216  }
217 };
218 
219 typedef std::vector<HdExtComputationPrimvarDescriptor>
220  HdExtComputationPrimvarDescriptorVector;
221 
231  TfToken name;
232  SdfPath sourceComputationId;
233  TfToken sourceComputationOutputName;
234 
237  TfToken const & name_,
238  SdfPath const & sourceComputationId_,
239  TfToken const & sourceComputationOutputName_)
240  : name(name_), sourceComputationId(sourceComputationId_)
241  , sourceComputationOutputName(sourceComputationOutputName_)
242  { }
243 
244  bool operator==(HdExtComputationInputDescriptor const& rhs) const {
245  return name == rhs.name &&
246  sourceComputationId == rhs.sourceComputationId &&
247  sourceComputationOutputName == rhs.sourceComputationOutputName;
248  }
249  bool operator!=(HdExtComputationInputDescriptor const& rhs) const {
250  return !(*this == rhs);
251  }
252 };
253 
254 typedef std::vector<HdExtComputationInputDescriptor>
255  HdExtComputationInputDescriptorVector;
256 
264  TfToken name;
265  HdTupleType valueType;
266 
269  TfToken const & name_,
270  HdTupleType const & valueType_)
271  : name(name_), valueType(valueType_)
272  { }
273 
274  bool operator==(HdExtComputationOutputDescriptor const& rhs) const {
275  return name == rhs.name &&
276  valueType == rhs.valueType;
277  }
278  bool operator!=(HdExtComputationOutputDescriptor const& rhs) const {
279  return !(*this == rhs);
280  }
281 };
282 
283 typedef std::vector<HdExtComputationOutputDescriptor>
284  HdExtComputationOutputDescriptorVector;
285 
291  TfToken fieldName;
292  TfToken fieldPrimType;
293  SdfPath fieldId;
294 
297  TfToken const & fieldName_,
298  TfToken const & fieldPrimType_,
299  SdfPath const & fieldId_)
300  : fieldName(fieldName_), fieldPrimType(fieldPrimType_), fieldId(fieldId_)
301  { }
302 };
303 
304 typedef std::vector<HdVolumeFieldDescriptor>
305  HdVolumeFieldDescriptorVector;
306 
312 public:
314  HD_API
315  HdSceneDelegate(HdRenderIndex *parentIndex,
316  SdfPath const& delegateID);
317 
318  HD_API
319  virtual ~HdSceneDelegate();
320 
322  HdRenderIndex& GetRenderIndex() { return *_index; }
323 
328  SdfPath const& GetDelegateID() const { return _delegateID; }
329 
331  HD_API
332  virtual void Sync(HdSyncRequestVector* request);
333 
336  HD_API
337  virtual void PostSyncCleanup();
338 
339  // -----------------------------------------------------------------------//
341  // -----------------------------------------------------------------------//
342 
344  HD_API
345  virtual bool IsEnabled(TfToken const& option) const;
346 
347 
348  // -----------------------------------------------------------------------//
350  // -----------------------------------------------------------------------//
351 
353  HD_API
354  virtual HdMeshTopology GetMeshTopology(SdfPath const& id);
355 
357  HD_API
359 
361  HD_API
362  virtual PxOsdSubdivTags GetSubdivTags(SdfPath const& id);
363 
364 
372  HD_API
373  virtual GfRange3d GetExtent(SdfPath const & id);
374 
376  HD_API
377  virtual GfMatrix4d GetTransform(SdfPath const & id);
378 
380  HD_API
381  virtual bool GetVisible(SdfPath const & id);
382 
384  HD_API
385  virtual bool GetDoubleSided(SdfPath const & id);
386 
388  HD_API
389  virtual HdCullStyle GetCullStyle(SdfPath const &id);
390 
392  HD_API
393  virtual VtValue GetShadingStyle(SdfPath const &id);
394 
399  HD_API
400  virtual HdDisplayStyle GetDisplayStyle(SdfPath const& id);
401 
403  HD_API
404  virtual VtValue Get(SdfPath const& id, TfToken const& key);
405 
410  HD_API
411  virtual VtValue GetIndexedPrimvar(SdfPath const& id,
412  TfToken const& key,
413  VtIntArray *outIndices);
414 
416  HD_API
417  virtual HdReprSelector GetReprSelector(SdfPath const &id);
418 
421  HD_API
422  virtual TfToken GetRenderTag(SdfPath const& id);
423 
425  HD_API
426  virtual VtArray<TfToken> GetCategories(SdfPath const& id);
427 
429  HD_API
430  virtual std::vector<VtArray<TfToken>>
431  GetInstanceCategories(SdfPath const &instancerId);
432 
434  HD_API
435  virtual HdIdVectorSharedPtr GetCoordSysBindings(SdfPath const& id);
436 
437  // -----------------------------------------------------------------------//
439  // -----------------------------------------------------------------------//
440 
448  HD_API
449  virtual size_t
450  SampleTransform(SdfPath const & id,
451  size_t maxSampleCount,
452  float *sampleTimes,
453  GfMatrix4d *sampleValues);
454 
458  template <unsigned int CAPACITY>
459  void
462  size_t authoredSamples =
463  SampleTransform(id, CAPACITY, sa->times.data(), sa->values.data());
464  if (authoredSamples > CAPACITY) {
465  sa->Resize(authoredSamples);
466  size_t authoredSamplesSecondAttempt =
468  id,
469  authoredSamples,
470  sa->times.data(),
471  sa->values.data());
472  // Number of samples should be consisntent through multiple
473  // invokations of the sampling function.
474  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
475  }
476  sa->count = authoredSamples;
477  }
478 
486  HD_API
487  virtual size_t
488  SampleInstancerTransform(SdfPath const &instancerId,
489  size_t maxSampleCount,
490  float *sampleTimes,
491  GfMatrix4d *sampleValues);
492 
497  template <unsigned int CAPACITY>
498  void
499  SampleInstancerTransform(SdfPath const &instancerId,
501  size_t authoredSamples =
503  instancerId,
504  CAPACITY,
505  sa->times.data(),
506  sa->values.data());
507  if (authoredSamples > CAPACITY) {
508  sa->Resize(authoredSamples);
509  size_t authoredSamplesSecondAttempt =
511  instancerId,
512  authoredSamples,
513  sa->times.data(),
514  sa->values.data());
515  // Number of samples should be consisntent through multiple
516  // invokations of the sampling function.
517  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
518  }
519  sa->count = authoredSamples;
520  }
521 
539  HD_API
540  virtual size_t
541  SamplePrimvar(SdfPath const& id,
542  TfToken const& key,
543  size_t maxSampleCount,
544  float *sampleTimes,
545  VtValue *sampleValues);
546 
550  template <unsigned int CAPACITY>
551  void
552  SamplePrimvar(SdfPath const &id,
553  TfToken const& key,
555 
561  HD_API
562  virtual size_t
563  SampleIndexedPrimvar(SdfPath const& id,
564  TfToken const& key,
565  size_t maxSampleCount,
566  float *sampleTimes,
567  VtValue *sampleValues,
568  VtIntArray *sampleIndices);
569 
573  template <unsigned int CAPACITY>
574  void
575  SampleIndexedPrimvar(SdfPath const &id,
576  TfToken const& key,
578 
579  // -----------------------------------------------------------------------//
581  // -----------------------------------------------------------------------//
582 
595  HD_API
596  virtual VtIntArray GetInstanceIndices(SdfPath const &instancerId,
597  SdfPath const &prototypeId);
598 
600  HD_API
601  virtual GfMatrix4d GetInstancerTransform(SdfPath const &instancerId);
602 
604  HD_API
605  virtual SdfPath GetInstancerId(SdfPath const& primId);
606 
611  HD_API
612  virtual SdfPathVector GetInstancerPrototypes(SdfPath const& instancerId);
613 
614  // -----------------------------------------------------------------------//
616  // -----------------------------------------------------------------------//
617 
621  HD_API
622  virtual SdfPath GetScenePrimPath(SdfPath const& rprimId,
623  int instanceIndex,
624  HdInstancerContext *instancerContext = nullptr);
625 
626  // -----------------------------------------------------------------------//
628  // -----------------------------------------------------------------------//
629 
631  HD_API
632  virtual SdfPath GetMaterialId(SdfPath const &rprimId);
633 
634  // Returns a material resource which contains the information
635  // needed to create a material.
636  HD_API
637  virtual VtValue GetMaterialResource(SdfPath const &materialId);
638 
639  // -----------------------------------------------------------------------//
641  // -----------------------------------------------------------------------//
642 
644  HD_API
646 
647  // -----------------------------------------------------------------------//
649  // -----------------------------------------------------------------------//
650 
651  // Returns a single value for a given light and parameter.
652  HD_API
653  virtual VtValue GetLightParamValue(SdfPath const &id,
654  TfToken const &paramName);
655 
656  // -----------------------------------------------------------------------//
658  // -----------------------------------------------------------------------//
659 
662  HD_API
663  virtual VtValue GetCameraParamValue(SdfPath const& cameraId,
664  TfToken const& paramName);
665 
666  // -----------------------------------------------------------------------//
668  // -----------------------------------------------------------------------//
669 
670  HD_API
671  virtual HdVolumeFieldDescriptorVector
672  GetVolumeFieldDescriptors(SdfPath const &volumeId);
673 
674  // -----------------------------------------------------------------------//
676  // -----------------------------------------------------------------------//
677 
685  HD_API
686  virtual TfTokenVector
687  GetExtComputationSceneInputNames(SdfPath const& computationId);
688 
694  HD_API
695  virtual HdExtComputationInputDescriptorVector
696  GetExtComputationInputDescriptors(SdfPath const& computationId);
697 
702  HD_API
703  virtual HdExtComputationOutputDescriptorVector
704  GetExtComputationOutputDescriptors(SdfPath const& computationId);
705 
706 
714  HD_API
715  virtual HdExtComputationPrimvarDescriptorVector
717  HdInterpolation interpolationMode);
718 
721  HD_API
722  virtual VtValue GetExtComputationInput(SdfPath const& computationId,
723  TfToken const& input);
724 
732  HD_API
733  virtual size_t SampleExtComputationInput(SdfPath const& computationId,
734  TfToken const& input,
735  size_t maxSampleCount,
736  float *sampleTimes,
737  VtValue *sampleValues);
738 
743  template <unsigned int CAPACITY>
744  void SampleExtComputationInput(SdfPath const& computationId,
745  TfToken const& input,
747  size_t authoredSamples = SampleExtComputationInput(
748  computationId, input, CAPACITY,
749  sa->times.data(), sa->values.data());
750 
751  if (authoredSamples > CAPACITY) {
752  sa->Resize(authoredSamples);
753  size_t authoredSamplesSecondAttempt = SampleExtComputationInput(
754  computationId, input, authoredSamples,
755  sa->times.data(), sa->values.data());
756  // Number of samples should be consisntent through multiple
757  // invokations of the sampling function.
758  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
759  }
760  sa->count = authoredSamples;
761  }
762 
766  HD_API
767  virtual std::string GetExtComputationKernel(SdfPath const& computationId);
768 
779  HD_API
780  virtual void InvokeExtComputation(SdfPath const& computationId,
781  HdExtComputationContext *context);
782 
783  // -----------------------------------------------------------------------//
785  // -----------------------------------------------------------------------//
786 
788  HD_API
789  virtual HdPrimvarDescriptorVector
790  GetPrimvarDescriptors(SdfPath const& id, HdInterpolation interpolation);
791 
792  // -----------------------------------------------------------------------//
794  // -----------------------------------------------------------------------//
795  HD_API
796  virtual TfTokenVector GetTaskRenderTags(SdfPath const& taskId);
797 
798 private:
799  HdRenderIndex *_index;
800  SdfPath _delegateID;
801 
802  HdSceneDelegate() = delete;
803  HdSceneDelegate(HdSceneDelegate &) = delete;
804  HdSceneDelegate &operator=(HdSceneDelegate &) = delete;
805 };
806 
807 template <unsigned int CAPACITY>
808 void
810  TfToken const& key,
812  size_t authoredSamples =
814  id,
815  key,
816  CAPACITY,
817  sa->times.data(),
818  sa->values.data());
819  if (authoredSamples > CAPACITY) {
820  sa->Resize(authoredSamples);
821  size_t authoredSamplesSecondAttempt =
823  id,
824  key,
825  authoredSamples,
826  sa->times.data(),
827  sa->values.data());
828  // Number of samples should be consistent through multiple
829  // invocations of the sampling function.
830  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
831  }
832  sa->count = authoredSamples;
833 }
834 
835 template <unsigned int CAPACITY>
836 void
838  TfToken const& key,
840  size_t authoredSamples =
842  id,
843  key,
844  CAPACITY,
845  sa->times.data(),
846  sa->values.data(),
847  sa->indices.data());
848  if (authoredSamples > CAPACITY) {
849  sa->Resize(authoredSamples);
850  size_t authoredSamplesSecondAttempt =
852  id,
853  key,
854  authoredSamples,
855  sa->times.data(),
856  sa->values.data(),
857  sa->indices.data());
858  // Number of samples should be consistent through multiple
859  // invocations of the sampling function.
860  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
861  }
862  sa->count = authoredSamples;
863 }
864 
865 PXR_NAMESPACE_CLOSE_SCOPE
866 
867 #endif //PXR_IMAGING_HD_SCENE_DELEGATE_H
Interface class that defines the execution environment for the client to run a computation.
Tags for non-hierarchial subdiv surfaces.
Definition: subdivTags.h:41
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:118
Basic type: 3-dimensional floating point range.
Definition: range3d.h:64
virtual HD_API void InvokeExtComputation(SdfPath const &computationId, HdExtComputationContext *context)
Requests the scene delegate run the ExtComputation with the given id.
virtual HD_API HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id)
Gets the topological curve data for a given prim.
Describes how the geometry of a prim should be displayed.
Definition: sceneDelegate.h:80
value_type * data()
Direct access to the underlying array.
Definition: smallVector.h:768
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)
Creates a DisplayStyle.
Describes an input to an ExtComputation that takes data from the output of another ExtComputation.
virtual HD_API VtValue Get(SdfPath const &id, TfToken const &key)
Returns a named value.
virtual HD_API TfTokenVector GetExtComputationSceneInputNames(SdfPath const &computationId)
For the given computation id, returns a list of inputs which will be requested from the scene delegat...
HdTupleType represents zero, one, or more values of the same HdType.
Definition: types.h:325
virtual HD_API SdfPath GetMaterialId(SdfPath const &rprimId)
Returns the material ID bound to the rprim rprimId.
virtual HD_API std::vector< VtArray< TfToken > > GetInstanceCategories(SdfPath const &instancerId)
Returns the categories for all instances in the instancer.
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
Definition: diagnostic.h:85
Describes the allocation structure of a render buffer bprim.
Definition: aov.h:84
bool flatShadingEnabled
Is the prim flat shaded.
Definition: sceneDelegate.h:85
Describes a primvar.
virtual HD_API GfMatrix4d GetInstancerTransform(SdfPath const &instancerId)
Returns the instancer transform.
void SampleExtComputationInput(SdfPath const &computationId, TfToken const &input, HdTimeSampleArray< VtValue, CAPACITY > *sa)
Convenience form of SampleExtComputationInput() that takes an HdTimeSampleArray.
TfToken name
Name of the primvar.
virtual HD_API bool GetDoubleSided(SdfPath const &id)
Returns the doubleSided state for the given prim.
virtual HD_API void PostSyncCleanup()
Opportunity for the delegate to clean itself up after performing parallel work during sync phase.
virtual HD_API VtValue GetCameraParamValue(SdfPath const &cameraId, TfToken const &paramName)
Returns a single value for a given camera and parameter.
virtual HD_API GfMatrix4d GetTransform(SdfPath const &id)
Returns the object space transform, including all parent transforms.
virtual HD_API HdExtComputationOutputDescriptorVector GetExtComputationOutputDescriptors(SdfPath const &computationId)
For the given computation id, returns a list of computation output descriptors.
virtual HD_API HdIdVectorSharedPtr GetCoordSysBindings(SdfPath const &id)
Returns the coordinate system bindings, or a nullptr if none are bound.
SdfPath const & GetDelegateID() const
Returns the ID of this delegate, which is used as a prefix for all objects it creates in the RenderIn...
virtual HD_API size_t SampleExtComputationInput(SdfPath const &computationId, TfToken const &input, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues)
Return up to maxSampleCount samples for a given computation id and input token.
virtual HD_API HdRenderBufferDescriptor GetRenderBufferDescriptor(SdfPath const &id)
Returns the allocation descriptor for a given render buffer prim.
void SampleInstancerTransform(SdfPath const &instancerId, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
Convenience form of SampleInstancerTransform() that takes an HdTimeSampleArray.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
virtual HD_API HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolationMode)
Returns a list of primvar names that should be bound to a generated output from an ExtComputation for...
Describes an output of an ExtComputation.
HdInterpolation interpolation
Interpolation (data-sampling rate) of the primvar.
Description of a single field related to a volume primitive.
virtual HD_API size_t SampleTransform(SdfPath const &id, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues)
Store up to maxSampleCount transform samples in *sampleValues.
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
#define TF_VERIFY(cond, format,...)
Checks a condition and reports an error if it evaluates false.
Definition: diagnostic.h:283
virtual HD_API size_t SamplePrimvar(SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues)
Store up to maxSampleCount primvar samples in *samplesValues.
virtual HD_API HdCullStyle GetCullStyle(SdfPath const &id)
Returns the cullstyle for the given prim.
Adapter class providing data exchange with the client scene graph.
virtual HD_API SdfPathVector GetInstancerPrototypes(SdfPath const &instancerId)
Returns a list of prototypes of this instancer.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
bool occludedSelectionShowsThrough
Does the prim act "transparent" to allow occluded selection to show through?
Definition: sceneDelegate.h:92
void SampleTransform(SdfPath const &id, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
Convenience form of SampleTransform() that takes an HdTimeSampleArray.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
bool indexed
Optional bool, true if primvar is indexed.
virtual HD_API VtValue GetExtComputationInput(SdfPath const &computationId, TfToken const &input)
Returns a single value for a given computation id and input token.
Topology data for basisCurves.
virtual HD_API void Sync(HdSyncRequestVector *request)
Synchronizes the delegate state for the given request vector.
virtual HD_API bool GetVisible(SdfPath const &id)
Returns the authored visible state of the prim.
virtual HD_API size_t SampleIndexedPrimvar(SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues, VtIntArray *sampleIndices)
SamplePrimvar() for getting an unflattened primvar and its indices.
virtual HD_API VtValue GetIndexedPrimvar(SdfPath const &id, TfToken const &key, VtIntArray *outIndices)
Returns a named primvar value.
int refineLevel
The prim refine level, in the range [0, 8].
Definition: sceneDelegate.h:82
HdDisplayStyle()
Creates a default DisplayStyle.
Definition: sceneDelegate.h:98
virtual HD_API HdExtComputationInputDescriptorVector GetExtComputationInputDescriptors(SdfPath const &computationId)
For the given computation id, returns a list of computation input descriptors.
virtual HD_API HdPrimvarDescriptorVector GetPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolation)
Returns descriptors for all primvars of the given interpolation type.
virtual HD_API HdMeshTopology GetMeshTopology(SdfPath const &id)
Gets the topological mesh data for a given prim.
virtual HD_API GfRange3d GetExtent(SdfPath const &id)
Gets the axis aligned bounds of a prim.
virtual HD_API HdReprSelector GetReprSelector(SdfPath const &id)
Returns the authored repr (if any) for the given prim.
void Resize(unsigned int newSize) override
Resize the internal buffers.
The SceneDelegate is requested to synchronize prims as the result of executing a specific render pass...
Definition: sceneDelegate.h:68
virtual HD_API PxOsdSubdivTags GetSubdivTags(SdfPath const &id)
Gets the subdivision surface tags (sharpness, holes, etc).
virtual HD_API TfToken GetRenderTag(SdfPath const &id)
Returns the render tag that will be used to bucket prims during render pass bucketing.
Describes one or more authored display representations for an rprim.
Definition: repr.h:48
virtual HD_API bool IsEnabled(TfToken const &option) const
Returns true if the named option is enabled by the delegate.
virtual HD_API VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId)
Gets the extracted indices array of the prototype id used in the instancer.
virtual HD_API size_t SampleInstancerTransform(SdfPath const &instancerId, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues)
Store up to maxSampleCount transform samples in *sampleValues.
An array of a value sampled over time, in struct-of-arrays layout.
Extends HdPrimvarDescriptor to describe a primvar that takes data from the output of an ExtComputatio...
virtual void Resize(unsigned int newSize)
Resize the internal buffers.
virtual HD_API HdDisplayStyle GetDisplayStyle(SdfPath const &id)
Returns the refinement level for the given prim in the range [0,8].
bool displacementEnabled
Is the prim displacement shaded.
Definition: sceneDelegate.h:88
virtual HD_API std::string GetExtComputationKernel(SdfPath const &computationId)
Returns the kernel source assigned to the computation at the path id.
virtual HD_API SdfPath GetInstancerId(SdfPath const &primId)
Returns the parent instancer of the given rprim or instancer.
TfToken role
Optional "role" indicating a desired interpretation – for example, to distinguish color/vector/point/...
Topology data for meshes.
Definition: meshTopology.h:55
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
An array of a value and its indices sampled over time, in struct-of-arrays layout.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:168
virtual HD_API SdfPath GetScenePrimPath(SdfPath const &rprimId, int instanceIndex, HdInstancerContext *instancerContext=nullptr)
Returns the scene address of the prim corresponding to the given rprim/instance index.
virtual HD_API VtArray< TfToken > GetCategories(SdfPath const &id)
Returns the prim categories.