All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  HdPrimvarDescriptor(TfToken const& name_,
161  HdInterpolation interp_,
162  TfToken const& role_=HdPrimvarRoleTokens->none,
163  bool indexed_=false)
164  : name(name_), interpolation(interp_), role(role_), indexed(indexed_)
165  { }
166  bool operator==(HdPrimvarDescriptor const& rhs) const {
167  return name == rhs.name && role == rhs.role
168  && interpolation == rhs.interpolation;
169  }
170  bool operator!=(HdPrimvarDescriptor const& rhs) const {
171  return !(*this == rhs);
172  }
173 };
174 
175 typedef std::vector<HdPrimvarDescriptor> HdPrimvarDescriptorVector;
176 
187  SdfPath sourceComputationId;
188  TfToken sourceComputationOutputName;
189  HdTupleType valueType;
190 
193  TfToken const& name_,
194  HdInterpolation interp_,
195  TfToken const & role_,
196  SdfPath const & sourceComputationId_,
197  TfToken const & sourceComputationOutputName_,
198  HdTupleType const & valueType_)
199  : HdPrimvarDescriptor(name_, interp_, role_, false)
200  , sourceComputationId(sourceComputationId_)
201  , sourceComputationOutputName(sourceComputationOutputName_)
202  , valueType(valueType_)
203  { }
204  bool operator==(HdExtComputationPrimvarDescriptor const& rhs) const {
205  return HdPrimvarDescriptor::operator==(rhs) &&
206  sourceComputationId == rhs.sourceComputationId &&
207  sourceComputationOutputName == rhs.sourceComputationOutputName &&
208  valueType == rhs.valueType;
209  }
210  bool operator!=(HdExtComputationPrimvarDescriptor const& rhs) const {
211  return !(*this == rhs);
212  }
213 };
214 
215 typedef std::vector<HdExtComputationPrimvarDescriptor>
216  HdExtComputationPrimvarDescriptorVector;
217 
227  TfToken name;
228  SdfPath sourceComputationId;
229  TfToken sourceComputationOutputName;
230 
233  TfToken const & name_,
234  SdfPath const & sourceComputationId_,
235  TfToken const & sourceComputationOutputName_)
236  : name(name_), sourceComputationId(sourceComputationId_)
237  , sourceComputationOutputName(sourceComputationOutputName_)
238  { }
239 
240  bool operator==(HdExtComputationInputDescriptor const& rhs) const {
241  return name == rhs.name &&
242  sourceComputationId == rhs.sourceComputationId &&
243  sourceComputationOutputName == rhs.sourceComputationOutputName;
244  }
245  bool operator!=(HdExtComputationInputDescriptor const& rhs) const {
246  return !(*this == rhs);
247  }
248 };
249 
250 typedef std::vector<HdExtComputationInputDescriptor>
251  HdExtComputationInputDescriptorVector;
252 
260  TfToken name;
261  HdTupleType valueType;
262 
265  TfToken const & name_,
266  HdTupleType const & valueType_)
267  : name(name_), valueType(valueType_)
268  { }
269 
270  bool operator==(HdExtComputationOutputDescriptor const& rhs) const {
271  return name == rhs.name &&
272  valueType == rhs.valueType;
273  }
274  bool operator!=(HdExtComputationOutputDescriptor const& rhs) const {
275  return !(*this == rhs);
276  }
277 };
278 
279 typedef std::vector<HdExtComputationOutputDescriptor>
280  HdExtComputationOutputDescriptorVector;
281 
287  TfToken fieldName;
288  TfToken fieldPrimType;
289  SdfPath fieldId;
290 
293  TfToken const & fieldName_,
294  TfToken const & fieldPrimType_,
295  SdfPath const & fieldId_)
296  : fieldName(fieldName_), fieldPrimType(fieldPrimType_), fieldId(fieldId_)
297  { }
298 };
299 
300 typedef std::vector<HdVolumeFieldDescriptor>
301  HdVolumeFieldDescriptorVector;
302 
308 public:
310  HD_API
311  HdSceneDelegate(HdRenderIndex *parentIndex,
312  SdfPath const& delegateID);
313 
314  HD_API
315  virtual ~HdSceneDelegate();
316 
318  HdRenderIndex& GetRenderIndex() { return *_index; }
319 
324  SdfPath const& GetDelegateID() const { return _delegateID; }
325 
327  HD_API
328  virtual void Sync(HdSyncRequestVector* request);
329 
332  HD_API
333  virtual void PostSyncCleanup();
334 
335  // -----------------------------------------------------------------------//
337  // -----------------------------------------------------------------------//
338 
340  HD_API
341  virtual bool IsEnabled(TfToken const& option) const;
342 
343 
344  // -----------------------------------------------------------------------//
346  // -----------------------------------------------------------------------//
347 
349  HD_API
350  virtual HdMeshTopology GetMeshTopology(SdfPath const& id);
351 
353  HD_API
355 
357  HD_API
358  virtual PxOsdSubdivTags GetSubdivTags(SdfPath const& id);
359 
360 
368  HD_API
369  virtual GfRange3d GetExtent(SdfPath const & id);
370 
372  HD_API
373  virtual GfMatrix4d GetTransform(SdfPath const & id);
374 
376  HD_API
377  virtual bool GetVisible(SdfPath const & id);
378 
380  HD_API
381  virtual bool GetDoubleSided(SdfPath const & id);
382 
384  HD_API
385  virtual HdCullStyle GetCullStyle(SdfPath const &id);
386 
388  HD_API
389  virtual VtValue GetShadingStyle(SdfPath const &id);
390 
395  HD_API
396  virtual HdDisplayStyle GetDisplayStyle(SdfPath const& id);
397 
399  HD_API
400  virtual VtValue Get(SdfPath const& id, TfToken const& key);
401 
406  HD_API
407  virtual VtValue GetIndexedPrimvar(SdfPath const& id,
408  TfToken const& key,
409  VtIntArray *outIndices);
410 
412  HD_API
413  virtual HdReprSelector GetReprSelector(SdfPath const &id);
414 
417  HD_API
418  virtual TfToken GetRenderTag(SdfPath const& id);
419 
421  HD_API
422  virtual VtArray<TfToken> GetCategories(SdfPath const& id);
423 
425  HD_API
426  virtual std::vector<VtArray<TfToken>>
427  GetInstanceCategories(SdfPath const &instancerId);
428 
430  HD_API
431  virtual HdIdVectorSharedPtr GetCoordSysBindings(SdfPath const& id);
432 
433  // -----------------------------------------------------------------------//
435  // -----------------------------------------------------------------------//
436 
444  HD_API
445  virtual size_t
446  SampleTransform(SdfPath const & id,
447  size_t maxSampleCount,
448  float *sampleTimes,
449  GfMatrix4d *sampleValues);
450 
454  template <unsigned int CAPACITY>
455  void
458  size_t authoredSamples =
459  SampleTransform(id, CAPACITY, sa->times.data(), sa->values.data());
460  if (authoredSamples > CAPACITY) {
461  sa->Resize(authoredSamples);
462  size_t authoredSamplesSecondAttempt =
464  id,
465  authoredSamples,
466  sa->times.data(),
467  sa->values.data());
468  // Number of samples should be consisntent through multiple
469  // invokations of the sampling function.
470  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
471  }
472  sa->count = authoredSamples;
473  }
474 
482  HD_API
483  virtual size_t
484  SampleInstancerTransform(SdfPath const &instancerId,
485  size_t maxSampleCount,
486  float *sampleTimes,
487  GfMatrix4d *sampleValues);
488 
493  template <unsigned int CAPACITY>
494  void
495  SampleInstancerTransform(SdfPath const &instancerId,
497  size_t authoredSamples =
499  instancerId,
500  CAPACITY,
501  sa->times.data(),
502  sa->values.data());
503  if (authoredSamples > CAPACITY) {
504  sa->Resize(authoredSamples);
505  size_t authoredSamplesSecondAttempt =
507  instancerId,
508  authoredSamples,
509  sa->times.data(),
510  sa->values.data());
511  // Number of samples should be consisntent through multiple
512  // invokations of the sampling function.
513  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
514  }
515  sa->count = authoredSamples;
516  }
517 
535  HD_API
536  virtual size_t
537  SamplePrimvar(SdfPath const& id,
538  TfToken const& key,
539  size_t maxSampleCount,
540  float *sampleTimes,
541  VtValue *sampleValues);
542 
546  template <unsigned int CAPACITY>
547  void
548  SamplePrimvar(SdfPath const &id,
549  TfToken const& key,
551 
557  HD_API
558  virtual size_t
559  SampleIndexedPrimvar(SdfPath const& id,
560  TfToken const& key,
561  size_t maxSampleCount,
562  float *sampleTimes,
563  VtValue *sampleValues,
564  VtIntArray *sampleIndices);
565 
569  template <unsigned int CAPACITY>
570  void
571  SampleIndexedPrimvar(SdfPath const &id,
572  TfToken const& key,
574 
575  // -----------------------------------------------------------------------//
577  // -----------------------------------------------------------------------//
578 
591  HD_API
592  virtual VtIntArray GetInstanceIndices(SdfPath const &instancerId,
593  SdfPath const &prototypeId);
594 
596  HD_API
597  virtual GfMatrix4d GetInstancerTransform(SdfPath const &instancerId);
598 
600  HD_API
601  virtual SdfPath GetInstancerId(SdfPath const& primId);
602 
607  HD_API
608  virtual SdfPathVector GetInstancerPrototypes(SdfPath const& instancerId);
609 
610  // -----------------------------------------------------------------------//
612  // -----------------------------------------------------------------------//
613 
617  HD_API
618  virtual SdfPath GetScenePrimPath(SdfPath const& rprimId,
619  int instanceIndex,
620  HdInstancerContext *instancerContext = nullptr);
621 
622  // -----------------------------------------------------------------------//
624  // -----------------------------------------------------------------------//
625 
627  HD_API
628  virtual SdfPath GetMaterialId(SdfPath const &rprimId);
629 
630  // Returns a material resource which contains the information
631  // needed to create a material.
632  HD_API
633  virtual VtValue GetMaterialResource(SdfPath const &materialId);
634 
635  // -----------------------------------------------------------------------//
637  // -----------------------------------------------------------------------//
638 
640  HD_API
642 
643  // -----------------------------------------------------------------------//
645  // -----------------------------------------------------------------------//
646 
647  // Returns a single value for a given light and parameter.
648  HD_API
649  virtual VtValue GetLightParamValue(SdfPath const &id,
650  TfToken const &paramName);
651 
652  // -----------------------------------------------------------------------//
654  // -----------------------------------------------------------------------//
655 
658  HD_API
659  virtual VtValue GetCameraParamValue(SdfPath const& cameraId,
660  TfToken const& paramName);
661 
662  // -----------------------------------------------------------------------//
664  // -----------------------------------------------------------------------//
665 
666  HD_API
667  virtual HdVolumeFieldDescriptorVector
668  GetVolumeFieldDescriptors(SdfPath const &volumeId);
669 
670  // -----------------------------------------------------------------------//
672  // -----------------------------------------------------------------------//
673 
681  HD_API
682  virtual TfTokenVector
683  GetExtComputationSceneInputNames(SdfPath const& computationId);
684 
690  HD_API
691  virtual HdExtComputationInputDescriptorVector
692  GetExtComputationInputDescriptors(SdfPath const& computationId);
693 
698  HD_API
699  virtual HdExtComputationOutputDescriptorVector
700  GetExtComputationOutputDescriptors(SdfPath const& computationId);
701 
702 
710  HD_API
711  virtual HdExtComputationPrimvarDescriptorVector
713  HdInterpolation interpolationMode);
714 
717  HD_API
718  virtual VtValue GetExtComputationInput(SdfPath const& computationId,
719  TfToken const& input);
720 
728  HD_API
729  virtual size_t SampleExtComputationInput(SdfPath const& computationId,
730  TfToken const& input,
731  size_t maxSampleCount,
732  float *sampleTimes,
733  VtValue *sampleValues);
734 
739  template <unsigned int CAPACITY>
740  void SampleExtComputationInput(SdfPath const& computationId,
741  TfToken const& input,
743  size_t authoredSamples = SampleExtComputationInput(
744  computationId, input, CAPACITY,
745  sa->times.data(), sa->values.data());
746 
747  if (authoredSamples > CAPACITY) {
748  sa->Resize(authoredSamples);
749  size_t authoredSamplesSecondAttempt = SampleExtComputationInput(
750  computationId, input, authoredSamples,
751  sa->times.data(), sa->values.data());
752  // Number of samples should be consisntent through multiple
753  // invokations of the sampling function.
754  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
755  }
756  sa->count = authoredSamples;
757  }
758 
762  HD_API
763  virtual std::string GetExtComputationKernel(SdfPath const& computationId);
764 
775  HD_API
776  virtual void InvokeExtComputation(SdfPath const& computationId,
777  HdExtComputationContext *context);
778 
779  // -----------------------------------------------------------------------//
781  // -----------------------------------------------------------------------//
782 
784  HD_API
785  virtual HdPrimvarDescriptorVector
786  GetPrimvarDescriptors(SdfPath const& id, HdInterpolation interpolation);
787 
788  // -----------------------------------------------------------------------//
790  // -----------------------------------------------------------------------//
791  HD_API
792  virtual TfTokenVector GetTaskRenderTags(SdfPath const& taskId);
793 
794 private:
795  HdRenderIndex *_index;
796  SdfPath _delegateID;
797 
798  HdSceneDelegate() = delete;
799  HdSceneDelegate(HdSceneDelegate &) = delete;
800  HdSceneDelegate &operator=(HdSceneDelegate &) = delete;
801 };
802 
803 template <unsigned int CAPACITY>
804 void
806  TfToken const& key,
808  size_t authoredSamples =
810  id,
811  key,
812  CAPACITY,
813  sa->times.data(),
814  sa->values.data());
815  if (authoredSamples > CAPACITY) {
816  sa->Resize(authoredSamples);
817  size_t authoredSamplesSecondAttempt =
819  id,
820  key,
821  authoredSamples,
822  sa->times.data(),
823  sa->values.data());
824  // Number of samples should be consistent through multiple
825  // invocations of the sampling function.
826  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
827  }
828  sa->count = authoredSamples;
829 }
830 
831 template <unsigned int CAPACITY>
832 void
834  TfToken const& key,
836  size_t authoredSamples =
838  id,
839  key,
840  CAPACITY,
841  sa->times.data(),
842  sa->values.data(),
843  sa->indices.data());
844  if (authoredSamples > CAPACITY) {
845  sa->Resize(authoredSamples);
846  size_t authoredSamplesSecondAttempt =
848  id,
849  key,
850  authoredSamples,
851  sa->times.data(),
852  sa->values.data(),
853  sa->indices.data());
854  // Number of samples should be consistent through multiple
855  // invocations of the sampling function.
856  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
857  }
858  sa->count = authoredSamples;
859 }
860 
861 PXR_NAMESPACE_CLOSE_SCOPE
862 
863 #endif //PXR_IMAGING_HD_SCENE_DELEGATE_H
virtual HD_API bool IsEnabled(TfToken const &option) const
Returns true if the named option is enabled by the delegate.
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:116
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.
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 &quot;transparent&quot; 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 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 &quot;role&quot; indicating a desired interpretation – for example, to distinguish color/vector/point/...
Topology data for meshes.
Definition: meshTopology.h:55
SdfPath const & GetDelegateID() const
Returns the ID of this delegate, which is used as a prefix for all objects it creates in the RenderIn...
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.