HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sceneDelegate.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HD_SCENE_DELEGATE_H
8 #define PXR_IMAGING_HD_SCENE_DELEGATE_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hd/api.h"
12 #include "pxr/imaging/hd/version.h"
13 
14 #include "pxr/imaging/hd/aov.h"
16 #include "pxr/imaging/hd/enums.h"
19 #include "pxr/imaging/hd/repr.h"
21 
23 
24 #include "pxr/base/vt/array.h"
25 #include "pxr/base/vt/dictionary.h"
26 #include "pxr/base/vt/value.h"
27 #include "pxr/usd/sdf/assetPath.h"
28 #include "pxr/usd/sdf/path.h"
29 
30 #include "pxr/base/gf/vec2i.h"
31 #include "pxr/base/tf/hash.h"
32 
33 #include <memory>
34 #include <vector>
35 
37 
39 
40 /// A shared pointer to a vector of id's.
41 typedef std::shared_ptr<SdfPathVector> HdIdVectorSharedPtr;
42 
43 /// Instancer context: a pair of instancer paths and instance indices.
44 typedef std::vector<std::pair<SdfPath, int>> HdInstancerContext;
45 
46 /// \class HdSyncRequestVector
47 ///
48 /// The SceneDelegate is requested to synchronize prims as the result of
49 /// executing a specific render pass, the following data structure is passed
50 /// back to the delegate to drive synchronization.
51 ///
53  // The Prims to synchronize in this request.
55 
56  // The HdChangeTracker::DirtyBits that are set for each Prim.
57  std::vector<HdDirtyBits> dirtyBits;
58 };
59 
60 /// \struct HdDisplayStyle
61 ///
62 /// Describes how the geometry of a prim should be displayed.
63 ///
65  /// The prim refine level, in the range [0, 8].
66  ///
67  /// The refinement level indicates how many iterations to apply when
68  /// subdividing subdivision surfaces or other refinable primitives.
70 
71  /// Is the prim flat shaded.
73 
74  /// Is the prim displacement shaded.
76 
77  /// Is the prim overlayed on top of other prims.
79 
80  /// Does the prim act "transparent" to allow occluded selection to show
81  /// through?
83 
84  /// Should the prim's points get shaded like surfaces, as opposed to
85  /// constant shaded?
87 
88  /// Is this prim exempt from having its material disabled or overridden,
89  /// for example, when a renderer chooses to ignore all scene materials?
91 
92  /// Creates a default DisplayStyle.
93  /// - refineLevel is 0.
94  /// - flatShading is disabled.
95  /// - displacement is enabled.
96  /// - displayInOverlay is disabled.
97  /// - occludedSelectionShowsThrough is disabled.
98  /// - pointsShading is disabled.
100  : refineLevel(0)
101  , flatShadingEnabled(false)
102  , displacementEnabled(true)
103  , displayInOverlay(false)
105  , pointsShadingEnabled(false)
106  , materialIsFinal(false)
107  { }
108 
109  /// Creates a DisplayStyle.
110  /// \param refineLevel_ the refine level to display.
111  /// Valid range is [0, 8].
112  /// \param flatShading enables flat shading, defaults to false.
113  /// \param displacement enables displacement shading, defaults to true.
114  /// \param displayInOverlay enables display in overlay, defaults to false.
115  /// \param occludedSelectionShowsThrough controls whether the prim lets
116  /// occluded selection show through it, defaults to false.
117  /// \param pointsShadingEnabled controls whether the prim's points
118  /// are shaded as surfaces or constant-shaded, defaults to false.
119  /// \param materialisFinal controls whether the prim's material should be
120  /// exempt from override or disabling, such as when a renderer
121  /// wants to ignore all scene materials.
122  HdDisplayStyle(int refineLevel_,
123  bool flatShading = false,
124  bool displacement = true,
125  bool displayInOverlay_ = false,
126  bool occludedSelectionShowsThrough_ = false,
127  bool pointsShadingEnabled_ = false,
128  bool materialIsFinal_ = false)
129  : refineLevel(std::max(0, refineLevel_))
130  , flatShadingEnabled(flatShading)
131  , displacementEnabled(displacement)
132  , displayInOverlay(displayInOverlay_)
133  , occludedSelectionShowsThrough(occludedSelectionShowsThrough_)
134  , pointsShadingEnabled(pointsShadingEnabled_)
135  , materialIsFinal(materialIsFinal_)
136  {
137  if (refineLevel_ < 0) {
138  TF_CODING_ERROR("negative refine level is not supported");
139  } else if (refineLevel_ > 8) {
140  TF_CODING_ERROR("refine level > 8 is not supported");
141  }
142  }
143 
144  HdDisplayStyle(HdDisplayStyle const& rhs) = default;
145  ~HdDisplayStyle() = default;
146 
147  bool operator==(HdDisplayStyle const& rhs) const {
148  return refineLevel == rhs.refineLevel
156  }
157  bool operator!=(HdDisplayStyle const& rhs) const {
158  return !(*this == rhs);
159  }
160 };
161 
162 /// \struct HdPrimvarDescriptor
163 ///
164 /// Describes a primvar.
166  /// Name of the primvar.
168  /// Interpolation (data-sampling rate) of the primvar.
170  /// Optional "role" indicating a desired interpretation --
171  /// for example, to distinguish color/vector/point/normal.
172  /// See HdPrimvarRoleTokens; default is HdPrimvarRoleTokens->none.
174  /// Optional bool, true if primvar is indexed. This value should be checked
175  /// before calling "GetIndexedPrimvar"
176  bool indexed;
177 
180  , role(HdPrimvarRoleTokens->none)
181  , indexed(false)
182  {}
184  HdInterpolation interp_,
185  TfToken const& role_=HdPrimvarRoleTokens->none,
186  bool indexed_=false)
187  : name(name_), interpolation(interp_), role(role_), indexed(indexed_)
188  { }
189  bool operator==(HdPrimvarDescriptor const& rhs) const {
190  return name == rhs.name && role == rhs.role
191  && interpolation == rhs.interpolation;
192  }
193  bool operator!=(HdPrimvarDescriptor const& rhs) const {
194  return !(*this == rhs);
195  }
196 };
197 
198 typedef std::vector<HdPrimvarDescriptor> HdPrimvarDescriptorVector;
199 
200 /// \struct HdModelDrawMode
201 ///
202 /// Describes optional alternative imaging behavior for prims.
203 ///
204 /// Some scene delegates, like the UsdImagingDelegate, will pre-flatten this
205 /// data, but other scene delegates may wish to use this to pipe the data
206 /// through to a draw mode resolving scene index (see
207 /// UsdImagingDrawModeSceneIndex as an example of such a scene index).
208 ///
209 /// There is currently no plan to add emulation support for this information,
210 /// such as via HdLegacyPrimSceneIndex or HdSceneIndexAdapterSceneDelegate.
211 ///
213  // Alternate imaging mode. Options are origin, bounds, cards, default, and
214  // inherited.
216  // Specifies whether to apply the alternative imaging mode or not.
218  // The color in which to draw the geometry.
220  // The specific geometry to use in cards mode. Options are cross, box, and
221  // fromTexture.
223  // The textures applied to the respective quads in cards mode.
230 
232  : drawMode(HdModelDrawModeTokens->inherited)
233  , applyDrawMode(false)
234  , drawModeColor(GfVec3f(0.18))
235  , cardGeometry(HdModelDrawModeTokens->cross)
236  {}
237 
238  /// DrawModeColor is specified in the rendering color space
240  TfToken const& drawMode_,
241  bool applyDrawMode_=false,
242  GfVec3f drawModeColor_=GfVec3f(0.18),
243  TfToken const& cardGeometry_=HdModelDrawModeTokens->cross,
244  SdfAssetPath cardTextureXPos_=SdfAssetPath(),
245  SdfAssetPath cardTextureYPos_=SdfAssetPath(),
246  SdfAssetPath cardTextureZPos_=SdfAssetPath(),
247  SdfAssetPath cardTextureXNeg_=SdfAssetPath(),
248  SdfAssetPath cardTextureYNeg_=SdfAssetPath(),
249  SdfAssetPath cardTextureZNeg_=SdfAssetPath())
250  : drawMode(drawMode_), applyDrawMode(applyDrawMode_),
251  drawModeColor(drawModeColor_), cardGeometry(cardGeometry_),
252  cardTextureXPos(cardTextureXPos_), cardTextureYPos(cardTextureYPos_),
253  cardTextureZPos(cardTextureZPos_), cardTextureXNeg(cardTextureXNeg_),
254  cardTextureYNeg(cardTextureYNeg_), cardTextureZNeg(cardTextureZNeg_)
255  {}
256 
257  bool operator==(HdModelDrawMode const& rhs) const {
258  return drawMode == rhs.drawMode &&
259  applyDrawMode == rhs.applyDrawMode &&
260  drawModeColor == rhs.drawModeColor &&
261  cardGeometry == rhs.cardGeometry &&
268  }
269  bool operator!=(HdModelDrawMode const& rhs) const {
270  return !(*this == rhs);
271  }
272 };
273 
274 /// \struct HdExtComputationPrimvarDescriptor
275 ///
276 /// Extends HdPrimvarDescriptor to describe a primvar that takes
277 /// data from the output of an ExtComputation.
278 ///
279 /// The structure contains the id of the source ExtComputation in the
280 /// render index, the name of an output from that computation from which
281 /// the primvar will take data along with a valueType which describes
282 /// the type of the expected data.
287 
290  TfToken const& name_,
291  HdInterpolation interp_,
292  TfToken const & role_,
293  SdfPath const & sourceComputationId_,
294  TfToken const & sourceComputationOutputName_,
295  HdTupleType const & valueType_)
296  : HdPrimvarDescriptor(name_, interp_, role_, false)
297  , sourceComputationId(sourceComputationId_)
298  , sourceComputationOutputName(sourceComputationOutputName_)
299  , valueType(valueType_)
300  { }
302  return HdPrimvarDescriptor::operator==(rhs) &&
305  valueType == rhs.valueType;
306  }
308  return !(*this == rhs);
309  }
310 };
311 
312 typedef std::vector<HdExtComputationPrimvarDescriptor>
314 
315 /// \struct HdExtComputationInputDescriptor
316 ///
317 /// Describes an input to an ExtComputation that takes data from
318 /// the output of another ExtComputation.
319 ///
320 /// The structure contains the name of the input and the id of the
321 /// source ExtComputation in the render index, and which output of
322 /// that computation to bind the input to.
327 
330  TfToken const & name_,
331  SdfPath const & sourceComputationId_,
332  TfToken const & sourceComputationOutputName_)
333  : name(name_), sourceComputationId(sourceComputationId_)
334  , sourceComputationOutputName(sourceComputationOutputName_)
335  { }
336 
338  return name == rhs.name &&
341  }
343  return !(*this == rhs);
344  }
345 };
346 
347 typedef std::vector<HdExtComputationInputDescriptor>
349 
350 /// \struct HdExtComputationOutputDescriptor
351 ///
352 /// Describes an output of an ExtComputation.
353 ///
354 /// The structure contains the name of the output along with a valueType
355 /// which describes the type of the computation output data.
359 
362  TfToken const & name_,
363  HdTupleType const & valueType_)
364  : name(name_), valueType(valueType_)
365  { }
366 
368  return name == rhs.name &&
369  valueType == rhs.valueType;
370  }
372  return !(*this == rhs);
373  }
374 };
375 
376 typedef std::vector<HdExtComputationOutputDescriptor>
378 
379 /// \struct HdVolumeFieldDescriptor
380 ///
381 /// Description of a single field related to a volume primitive.
382 ///
387 
390  TfToken const & fieldName_,
391  TfToken const & fieldPrimType_,
392  SdfPath const & fieldId_)
393  : fieldName(fieldName_), fieldPrimType(fieldPrimType_), fieldId(fieldId_)
394  { }
395 };
396 
397 typedef std::vector<HdVolumeFieldDescriptor>
399 
400 /// \class HdSceneDelegate
401 ///
402 /// Adapter class providing data exchange with the client scene graph.
403 ///
405 public:
406  /// Constructor used for nested delegate objects which share a RenderIndex.
407  HD_API
408  HdSceneDelegate(HdRenderIndex *parentIndex,
409  SdfPath const& delegateID);
410 
411  HD_API
412  virtual ~HdSceneDelegate();
413 
414  /// Returns the RenderIndex owned by this delegate.
415  HdRenderIndex& GetRenderIndex() { return *_index; }
416 
417  /// Returns the ID of this delegate, which is used as a prefix for all
418  /// objects it creates in the RenderIndex.
419  ///
420  /// The default value is SdfPath::AbsoluteRootPath().
421  SdfPath const& GetDelegateID() const { return _delegateID; }
422 
423  /// Synchronizes the delegate state for the given request vector.
424  HD_API
425  virtual void Sync(HdSyncRequestVector* request);
426 
427  /// Opportunity for the delegate to clean itself up after
428  /// performing parallel work during sync phase
429  HD_API
430  virtual void PostSyncCleanup();
431 
432  // -----------------------------------------------------------------------//
433  /// \name Options
434  // -----------------------------------------------------------------------//
435 
436  /// Returns true if the named option is enabled by the delegate.
437  HD_API
438  virtual bool IsEnabled(TfToken const& option) const;
439 
440 
441  // -----------------------------------------------------------------------//
442  /// \name Rprim Aspects
443  // -----------------------------------------------------------------------//
444 
445  /// Gets the topological mesh data for a given prim.
446  HD_API
447  virtual HdMeshTopology GetMeshTopology(SdfPath const& id);
448 
449  /// Gets the topological curve data for a given prim.
450  HD_API
452 
453  /// Gets the subdivision surface tags (sharpness, holes, etc).
454  HD_API
455  virtual PxOsdSubdivTags GetSubdivTags(SdfPath const& id);
456 
457 
458  /// Gets the axis aligned bounds of a prim.
459  /// The returned bounds are in the local space of the prim
460  /// (transform is yet to be applied) and should contain the
461  /// bounds of any child prims.
462  ///
463  /// The returned bounds does not include any displacement that
464  /// might occur as the result of running shaders on the prim.
465  HD_API
466  virtual GfRange3d GetExtent(SdfPath const & id);
467 
468  /// Returns the object space transform, including all parent transforms.
469  HD_API
470  virtual GfMatrix4d GetTransform(SdfPath const & id);
471 
472  /// Returns the authored visible state of the prim.
473  HD_API
474  virtual bool GetVisible(SdfPath const & id);
475 
476  /// Returns the doubleSided state for the given prim.
477  HD_API
478  virtual bool GetDoubleSided(SdfPath const & id);
479 
480  /// Returns the cullstyle for the given prim.
481  HD_API
482  virtual HdCullStyle GetCullStyle(SdfPath const &id);
483 
484  /// Returns the shading style for the given prim.
485  HD_API
486  virtual VtValue GetShadingStyle(SdfPath const &id);
487 
488  /// Returns the display style for the given prim.
489  HD_API
490  virtual HdDisplayStyle GetDisplayStyle(SdfPath const& id);
491 
492  /// Returns a named value.
493  HD_API
494  virtual VtValue Get(SdfPath const& id, TfToken const& key);
495 
496  /// Returns a named primvar value. If \a *outIndices is not nullptr and the
497  /// primvar has indices, it will return the unflattened primvar and set
498  /// \a *outIndices to the primvar's associated indices, clearing the array
499  /// if the primvar is not indexed.
500  HD_API
501  virtual VtValue GetIndexedPrimvar(SdfPath const& id,
502  TfToken const& key,
503  VtIntArray *outIndices);
504 
505  /// Returns the authored repr (if any) for the given prim.
506  HD_API
507  virtual HdReprSelector GetReprSelector(SdfPath const &id);
508 
509  /// Returns the render tag that will be used to bucket prims during
510  /// render pass bucketing.
511  HD_API
512  virtual TfToken GetRenderTag(SdfPath const& id);
513 
514  /// Returns the prim categories. For instancer prims, the categories
515  /// returned apply to all its instances.
516  HD_API
517  virtual VtArray<TfToken> GetCategories(SdfPath const& id);
518 
519  /// Returns the categories for each of the instances in the instancer.
520  HD_API
521  virtual std::vector<VtArray<TfToken>>
522  GetInstanceCategories(SdfPath const &instancerId);
523 
524  /// Returns the coordinate system bindings, or a nullptr if none are bound.
525  HD_API
527 
528  /// Returns the model draw mode object for the given prim.
529  HD_API
530  virtual HdModelDrawMode GetModelDrawMode(SdfPath const& id);
531 
532  // -----------------------------------------------------------------------//
533  /// \name Motion samples
534  // -----------------------------------------------------------------------//
535 
536  /// Store up to \a maxSampleCount transform samples in \a *sampleValues.
537  /// Fills the given \a sampleValues and \a sampleTimes arrays with the
538  /// authored samples that contribute to the delegate's current shutter
539  /// interval and their frame-relative times. If a shutter interval boundary
540  /// falls between authored sample times, the bracketing sample(s) are
541  /// included, which will lie outside the shutter interval. It is the
542  /// caller's responsibility to interpolate the bracketing samples to the
543  /// shutter interval if desired.
544  ///
545  /// If the number of contributing sample times is greater than
546  /// maxSampleCount, you might want to call this function again to get all
547  /// the authored data.
548  ///
549  /// Sample times are relative to the scene delegate's current time.
550  /// \see GetTransform()
551  HD_API
552  virtual size_t
553  SampleTransform(SdfPath const & id,
554  size_t maxSampleCount,
555  float *sampleTimes,
556  GfMatrix4d *sampleValues);
557 
558  /// An overload of SampleTransform that takes frame-relative \a startTime
559  /// and \a endTime, rather than relying on the scene delegate's internal
560  /// state to define the shutter interval.
561  HD_API
562  virtual size_t
563  SampleTransform(SdfPath const & id,
564  float startTime,
565  float endTime,
566  size_t maxSampleCount,
567  float *sampleTimes,
568  GfMatrix4d *sampleValues);
569 
570  /// Convenience form of SampleTransform that takes an HdTimeSampleArray.
571  /// This function fills the given HdTimeSampleArray with the contributing
572  /// samples and their times for the delegate's current shutter interval.
573  template <unsigned int CAPACITY>
574  void
575  SampleTransform(SdfPath const & id,
577 
578  /// Convenience form of SampleTransform that takes an explict interval and
579  /// an HdTimeSampleArray. This function fills the given HdTimeSampleArray
580  /// with the contributing samples and their times for the given frame-
581  /// relative shutter interval.
582  template <unsigned int CAPACITY>
583  void
584  SampleTransform(SdfPath const & id,
585  float startTime,
586  float endTime,
588 
589  /// Store up to \a maxSampleCount transform samples in \a *sampleValues.
590  /// Fills the given \a sampleValues and \a sampleTimes arrays with the
591  /// authored samples that contribute to the delegate's current shutter
592  /// interval and their frame-relative times. If a shutter interval boundary
593  /// falls between authored sample times, the bracketing sample(s) are
594  /// included, which will lie outside the shutter interval. It is the
595  /// caller's responsibility to interpolate the bracketing samples to the
596  /// shutter interval if desired.
597  ///
598  /// If the number of contributing sample times is greater than
599  /// maxSampleCount, you might want to call this function again to get all
600  /// the authored data.
601  ///
602  /// Sample times are relative to the scene delegate's current time.
603  /// \see GetInstancerTransform()
604  HD_API
605  virtual size_t
606  SampleInstancerTransform(SdfPath const &instancerId,
607  size_t maxSampleCount,
608  float *sampleTimes,
609  GfMatrix4d *sampleValues);
610 
611  /// An overload of SampleInstancerTransform that takes frame-relative
612  /// \a startTime and \a endTime, rather than relying on the scene delegate's
613  /// internal state to define the shutter interval.
614  HD_API
615  virtual size_t
616  SampleInstancerTransform(SdfPath const &instancerId,
617  float startTime,
618  float endTime,
619  size_t maxSampleCount,
620  float *sampleTimes,
621  GfMatrix4d *sampleValues);
622 
623  /// Convenience form of SampleInstancerTransform that takes an
624  /// HdTimeSampleArray. This function fills the given HdTimeSampleArray with
625  /// the contributing samples and their times for the delegate's current
626  /// shutter interval.
627  template <unsigned int CAPACITY>
628  void
629  SampleInstancerTransform(SdfPath const &instancerId,
631 
632  /// Convenience form of SampleInstancerTransform that takes an explict
633  /// interval and an HdTimeSampleArray. This function fills the given
634  /// HdTimeSampleArray with the contributing samples and their times for the
635  /// given frame-relative shutter interval.
636  template <unsigned int CAPACITY>
637  void
638  SampleInstancerTransform(SdfPath const &instancerId,
639  float startTime, float endTime,
641 
642  /// Store up to \a maxSampleCount primvar samples in \a *samplesValues.
643  /// Fills the given \a sampleValues and \a sampleTimes arrays with the
644  /// authored samples that contribute to the delegate's current shutter
645  /// interval and their frame-relative times. If a shutter interval boundary
646  /// falls between authored sample times, the bracketing sample(s) are
647  /// included, which will lie outside the shutter interval. It is the
648  /// caller's responsibility to interpolate the bracketing samples to the
649  /// shutter interval if desired.
650  ///
651  /// If the number of contributing sample times is greater than
652  /// maxSampleCount, you might want to call this function again to get all
653  /// the authored data.
654  ///
655  /// Sample values that are array-valued will have a size described
656  /// by the HdPrimvarDescriptor as applied to the toplogy.
657  ///
658  /// For example, this means that a mesh that is fracturing over time
659  /// will return samples with the same number of points; the number
660  /// of points will change as the scene delegate is resynchronized
661  /// to represent the scene at a time with different topology.
662  ///
663  /// Sample times are relative to the scene delegate's current time.
664  ///
665  /// \see Get()
666  HD_API
667  virtual size_t
668  SamplePrimvar(SdfPath const& id,
669  TfToken const& key,
670  size_t maxSampleCount,
671  float *sampleTimes,
672  VtValue *sampleValues);
673 
674  /// An overload of SamplePrimvar that takes frame-relative \a startTime and
675  /// \a endTime, rather than relying on the scene delegate's internal state
676  /// to define the shutter interval.
677  HD_API
678  virtual size_t
679  SamplePrimvar(SdfPath const& id,
680  TfToken const& key,
681  float startTime,
682  float endTime,
683  size_t maxSampleCount,
684  float *sampleTimes,
685  VtValue *sampleValues);
686 
687  /// Convenience form of SamplePrimvar that takes an HdTimeSampleArray.
688  /// This function fills the given HdTimeSampleArray with the contributing
689  /// samples and their times for the delegate's current shutter interval.
690  template <unsigned int CAPACITY>
691  void
692  SamplePrimvar(SdfPath const &id,
693  TfToken const& key,
695 
696  /// Convenience form of SamplePrimvar that takes an explict interval and
697  /// an HdTimeSampleArray. This function fills the given HdTimeSampleArray
698  /// with the contributing samples and their times for the given frame-
699  /// relative shutter interval.
700  template <unsigned int CAPACITY>
701  void
702  SamplePrimvar(SdfPath const &id,
703  TfToken const& key,
704  float startTime,
705  float endTime,
707 
708  /// SamplePrimvar() for getting an unflattened primvar and its indices. If
709  /// \a *sampleIndices is not nullptr and the primvar has indices, it will
710  /// return unflattened primvar samples in \a *sampleValues and the primvar's
711  /// sampled indices in \a *sampleIndices, clearing the \a *sampleIndices
712  /// array if the primvar is not indexed.
713  HD_API
714  virtual size_t
715  SampleIndexedPrimvar(SdfPath const& id,
716  TfToken const& key,
717  size_t maxSampleCount,
718  float *sampleTimes,
719  VtValue *sampleValues,
720  VtIntArray *sampleIndices);
721 
722  /// An overload of SampleIndexedPrimvar that takes frame-relative
723  /// \a startTime and \a endTime, rather than relying on the scene delegate's
724  /// internal state to define the shutter interval.
725  HD_API
726  virtual size_t
727  SampleIndexedPrimvar(SdfPath const& id,
728  TfToken const& key,
729  float startTime,
730  float endTime,
731  size_t maxSampleCount,
732  float *sampleTimes,
733  VtValue *sampleValues,
734  VtIntArray *sampleIndices);
735 
736  /// Convenience form of SampleIndexedPrimvar that takes an
737  /// HdIndexedTimeSampleArray. This function fills the given
738  /// HdIndexedTimeSampleArray with the contributing samples and their times
739  /// for the delegate's current shutter interval.
740  template <unsigned int CAPACITY>
741  void
742  SampleIndexedPrimvar(SdfPath const &id,
743  TfToken const& key,
745 
746  /// Convenience form of SampleIndexedPrimvar that takes an explict interval
747  /// and an HdIndexedTimeSampleArray. This function fills the given
748  /// HdIndexedTimeSampleArray with the contributing samples and their times
749  /// for the given frame-relative shutter interval.
750  template <unsigned int CAPACITY>
751  void
752  SampleIndexedPrimvar(SdfPath const &id,
753  TfToken const& key,
754  float startTime,
755  float endTime,
757 
758  // -----------------------------------------------------------------------//
759  /// \name Instancer prototypes
760  // -----------------------------------------------------------------------//
761 
762  /// Gets the extracted indices array of the prototype id used in the
763  /// instancer.
764  ///
765  /// example
766  /// instances: 0, 1, 2, 3, 4, 5
767  /// protoypes: A, B, A, A, B, C
768  ///
769  /// GetInstanceIndices(A) : [0, 2, 3]
770  /// GetInstanceIndices(B) : [1, 4]
771  /// GetInstanceIndices(C) : [5]
772  /// GetInstanceIndices(D) : []
773  ///
774  HD_API
775  virtual VtIntArray GetInstanceIndices(SdfPath const &instancerId,
776  SdfPath const &prototypeId);
777 
778  /// Returns the instancer transform.
779  HD_API
780  virtual GfMatrix4d GetInstancerTransform(SdfPath const &instancerId);
781 
782  /// Returns the parent instancer of the given rprim or instancer.
783  HD_API
784  virtual SdfPath GetInstancerId(SdfPath const& primId);
785 
786  /// Returns a list of prototypes of this instancer. The intent is to let
787  /// renderers cache instance indices by giving them a complete set of prims
788  /// to call GetInstanceIndices(instancer, prototype) on.
789  /// XXX: This is currently unused, but may be used in the future.
790  HD_API
791  virtual SdfPathVector GetInstancerPrototypes(SdfPath const& instancerId);
792 
793  // -----------------------------------------------------------------------//
794  /// \name Path Translation
795  // -----------------------------------------------------------------------//
796 
797  /// Returns the scene address of the prim corresponding to the given
798  /// rprim/instance index. This is designed to give paths in scene namespace,
799  /// rather than hydra namespace, so it always strips the delegate ID.
800  /// \deprecated use GetScenePrimPaths
801  HD_API
802  virtual SdfPath GetScenePrimPath(SdfPath const& rprimId,
803  int instanceIndex,
804  HdInstancerContext *instancerContext = nullptr);
805 
806  /// A vectorized version of GetScenePrimPath that allows the prim adapter
807  /// to amortize expensive calculations across a number of path evaluations
808  /// in a single call. Note that only a single rprimId is supported. This
809  /// allows this call to be forwarded directly to a single prim adapter
810  /// rather than requiring a lot of data shuffling.
811  HD_API
812  virtual SdfPathVector GetScenePrimPaths(SdfPath const& rprimId,
813  std::vector<int> instanceIndices,
814  std::vector<HdInstancerContext> *instancerContexts = nullptr);
815 
816  /// Returns an identifier that can be used to share data between HdPrims
817  /// during a Sync operation. Any number of HdPrims of the same type may
818  /// return the same identifier. In this situation, the render delegate
819  /// can choose to share information between HdPrims rather than fetching
820  /// data for each HdPrim. For the UsdImagingSceneDelegate, this identifier
821  /// will be the path of the GetPrototype prim for the UsdPrim correspnding
822  /// to this HdPrim. Returns an empty SdfPath if this feature is no
823  /// supported or the UsdPrim has no prototype. Render delegates are free
824  /// to ignore this method completely if they aren't interested in the
825  /// additional level of data sharing enabled by this information.
826  HD_API
827  virtual SdfPath GetDataSharingId(SdfPath const& primId);
828 
829  // -----------------------------------------------------------------------//
830  /// \name Material Aspects
831  // -----------------------------------------------------------------------//
832 
833  /// Returns the material ID bound to the rprim \p rprimId.
834  HD_API
835  virtual SdfPath GetMaterialId(SdfPath const &rprimId);
836 
837  // Returns a material resource which contains the information
838  // needed to create a material.
839  HD_API
840  virtual VtValue GetMaterialResource(SdfPath const &materialId);
841 
842  // -----------------------------------------------------------------------//
843  /// \name Renderbuffer Aspects
844  // -----------------------------------------------------------------------//
845 
846  /// Returns the allocation descriptor for a given render buffer prim.
847  HD_API
849 
850  // -----------------------------------------------------------------------//
851  /// \name Light Aspects
852  // -----------------------------------------------------------------------//
853 
854  // Returns a single value for a given light and parameter.
855  HD_API
856  virtual VtValue GetLightParamValue(SdfPath const &id,
857  TfToken const &paramName);
858 
859  // -----------------------------------------------------------------------//
860  /// \name Camera Aspects
861  // -----------------------------------------------------------------------//
862 
863  /// Returns a single value for a given camera and parameter.
864  /// See HdCameraTokens for the list of paramters.
865  HD_API
866  virtual VtValue GetCameraParamValue(SdfPath const& cameraId,
867  TfToken const& paramName);
868 
869  // -----------------------------------------------------------------------//
870  /// \name Volume Aspects
871  // -----------------------------------------------------------------------//
872 
873  HD_API
875  GetVolumeFieldDescriptors(SdfPath const &volumeId);
876 
877  // -----------------------------------------------------------------------//
878  /// \name ExtComputation Aspects
879  // -----------------------------------------------------------------------//
880 
881  ///
882  /// For the given computation id, returns a list of inputs which
883  /// will be requested from the scene delegate using the Get() method.
884  ///
885  /// See GetExtComputationInputDescriptors and
886  /// GetExtComputationOutpuDescriptors for descriptions of other
887  /// computation inputs and outputs.
888  HD_API
889  virtual TfTokenVector
890  GetExtComputationSceneInputNames(SdfPath const& computationId);
891 
892  ///
893  /// For the given computation id, returns a list of computation
894  /// input descriptors.
895  ///
896  /// See HdExtComputationInputDecriptor
897  HD_API
899  GetExtComputationInputDescriptors(SdfPath const& computationId);
900 
901  /// For the given computation id, returns a list of computation
902  /// output descriptors.
903  ///
904  /// See HdExtComputationOutputDescriptor
905  HD_API
907  GetExtComputationOutputDescriptors(SdfPath const& computationId);
908 
909 
910  /// Returns a list of primvar names that should be bound to
911  /// a generated output from an ExtComputation for the given prim id and
912  /// interpolation mode. Binding information is obtained through
913  /// GetExtComputationPrimvarDesc()
914  /// Returns a structure describing source information for a primvar
915  /// that is bound to an ExtComputation. See HdExtComputationPrimvarDesc
916  /// for the expected information to be returned.
917  HD_API
920  HdInterpolation interpolationMode);
921 
922  /// Returns a single value for a given computation id and input token.
923  /// The token may be a computation input or a computation config parameter.
924  HD_API
925  virtual VtValue GetExtComputationInput(SdfPath const& computationId,
926  TfToken const& input);
927 
928  /// Return up to \a maxSampleCount samples for a given computation id and
929  /// input token.
930  /// The token may be a computation input or a computation config parameter.
931  /// Returns the union of the authored samples and the boundaries
932  /// of the current camera shutter interval. If this number is greater
933  /// than maxSampleCount, you might want to call this function again
934  /// to get all the authored data.
935  HD_API
936  virtual size_t SampleExtComputationInput(SdfPath const& computationId,
937  TfToken const& input,
938  size_t maxSampleCount,
939  float *sampleTimes,
940  VtValue *sampleValues);
941 
942  // An overload of SampleTransform that explicitly takes the startTime
943  // and endTime rather than relying on the scene delegate having state
944  // about what the source of the current shutter interval should be.
945  HD_API
946  virtual size_t SampleExtComputationInput(SdfPath const& computationId,
947  TfToken const& input,
948  float startTime,
949  float endTime,
950  size_t maxSampleCount,
951  float *sampleTimes,
952  VtValue *sampleValues);
953 
954  /// Convenience form of SampleExtComputationInput() that takes an
955  /// HdTimeSampleArray.
956  /// Returns the union of the authored samples and the boundaries
957  /// of the current camera shutter interval.
958  template <unsigned int CAPACITY>
959  void SampleExtComputationInput(SdfPath const& computationId,
960  TfToken const& input,
962 
963  /// Convenience form of SampleExtComputationInput() that takes an
964  /// HdTimeSampleArray.
965  /// Returns the union of the authored samples and the boundaries
966  /// of the current camera shutter interval.
967  template <unsigned int CAPACITY>
968  void SampleExtComputationInput(SdfPath const& computationId,
969  TfToken const& input,
970  float startTime,
971  float endTime,
973 
974  /// Returns the kernel source assigned to the computation at the path id.
975  /// If the string is empty the computation has no GPU kernel and the
976  /// CPU callback should be used.
977  HD_API
978  virtual std::string GetExtComputationKernel(SdfPath const& computationId);
979 
980  /// Requests the scene delegate run the ExtComputation with the given id.
981  /// The context contains the input values that delegate requested through
982  /// GetExtComputationInputNames().
983  ///
984  /// The scene delegate is expected to set each output identified by
985  /// GetExtComputationOutputNames() on the context.
986  ///
987  /// Hydra may invoke the computation on a different thread from
988  /// what HdEngine::Execute() was called on. It may also invoke
989  /// many computations in parallel.
990  HD_API
991  virtual void InvokeExtComputation(SdfPath const& computationId,
992  HdExtComputationContext *context);
993 
994  // -----------------------------------------------------------------------//
995  /// \name Primitive Variables
996  // -----------------------------------------------------------------------//
997 
998  /// Returns descriptors for all primvars of the given interpolation type.
999  HD_API
1001  GetPrimvarDescriptors(SdfPath const& id, HdInterpolation interpolation);
1002 
1003  // -----------------------------------------------------------------------//
1004  /// \name Task Aspects
1005  // -----------------------------------------------------------------------//
1006  HD_API
1007  virtual TfTokenVector GetTaskRenderTags(SdfPath const& taskId);
1008 
1009 private:
1010  HdRenderIndex *_index;
1011  SdfPath _delegateID;
1012 
1013  HdSceneDelegate() = delete;
1014  HdSceneDelegate(HdSceneDelegate &) = delete;
1015  HdSceneDelegate &operator=(HdSceneDelegate &) = delete;
1016 };
1017 
1018 template <unsigned int CAPACITY>
1019 void
1022  size_t authoredSamples =
1023  SampleTransform(id, CAPACITY, sa->times.data(), sa->values.data());
1024  if (authoredSamples > CAPACITY) {
1025  sa->Resize(authoredSamples);
1026  size_t authoredSamplesSecondAttempt =
1028  id,
1029  authoredSamples,
1030  sa->times.data(),
1031  sa->values.data());
1032  // Number of samples should be consisntent through multiple
1033  // invokations of the sampling function.
1034  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1035  }
1036  sa->count = authoredSamples;
1037 }
1038 
1039 template <unsigned int CAPACITY>
1040 void
1042  float startTime,
1043  float endTime,
1045  size_t authoredSamples =
1046  SampleTransform(id, startTime, endTime, CAPACITY,
1047  sa->times.data(), sa->values.data());
1048  if (authoredSamples > CAPACITY) {
1049  sa->Resize(authoredSamples);
1050  size_t authoredSamplesSecondAttempt =
1052  id,
1053  startTime,
1054  endTime,
1055  authoredSamples,
1056  sa->times.data(),
1057  sa->values.data());
1058  // Number of samples should be consisntent through multiple
1059  // invokations of the sampling function.
1060  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1061  }
1062  sa->count = authoredSamples;
1063 }
1064 
1065 template <unsigned int CAPACITY>
1066 void
1068  SdfPath const &instancerId,
1070  size_t authoredSamples =
1072  instancerId,
1073  CAPACITY,
1074  sa->times.data(),
1075  sa->values.data());
1076  if (authoredSamples > CAPACITY) {
1077  sa->Resize(authoredSamples);
1078  size_t authoredSamplesSecondAttempt =
1080  instancerId,
1081  authoredSamples,
1082  sa->times.data(),
1083  sa->values.data());
1084  // Number of samples should be consisntent through multiple
1085  // invokations of the sampling function.
1086  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1087  }
1088  sa->count = authoredSamples;
1089 }
1090 
1091 template <unsigned int CAPACITY>
1092 void
1094  SdfPath const &instancerId,
1095  float startTime, float endTime,
1097  size_t authoredSamples =
1099  instancerId,
1100  startTime,
1101  endTime,
1102  CAPACITY,
1103  sa->times.data(),
1104  sa->values.data());
1105  if (authoredSamples > CAPACITY) {
1106  sa->Resize(authoredSamples);
1107  size_t authoredSamplesSecondAttempt =
1109  instancerId,
1110  startTime,
1111  endTime,
1112  authoredSamples,
1113  sa->times.data(),
1114  sa->values.data());
1115  // Number of samples should be consisntent through multiple
1116  // invokations of the sampling function.
1117  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1118  }
1119  sa->count = authoredSamples;
1120 }
1121 
1122 template <unsigned int CAPACITY>
1123 void
1125  TfToken const& key,
1127  size_t authoredSamples =
1128  SamplePrimvar(
1129  id,
1130  key,
1131  CAPACITY,
1132  sa->times.data(),
1133  sa->values.data());
1134  if (authoredSamples > CAPACITY) {
1135  sa->Resize(authoredSamples);
1136  size_t authoredSamplesSecondAttempt =
1137  SamplePrimvar(
1138  id,
1139  key,
1140  authoredSamples,
1141  sa->times.data(),
1142  sa->values.data());
1143  // Number of samples should be consistent through multiple
1144  // invocations of the sampling function.
1145  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1146  }
1147  sa->count = authoredSamples;
1148 }
1149 
1150 template <unsigned int CAPACITY>
1151 void
1153  TfToken const& key,
1154  float startTime,
1155  float endTime,
1157  size_t authoredSamples =
1158  SamplePrimvar(
1159  id,
1160  key,
1161  startTime,
1162  endTime,
1163  CAPACITY,
1164  sa->times.data(),
1165  sa->values.data());
1166  if (authoredSamples > CAPACITY) {
1167  sa->Resize(authoredSamples);
1168  size_t authoredSamplesSecondAttempt =
1169  SamplePrimvar(
1170  id,
1171  key,
1172  startTime,
1173  endTime,
1174  authoredSamples,
1175  sa->times.data(),
1176  sa->values.data());
1177  // Number of samples should be consistent through multiple
1178  // invocations of the sampling function.
1179  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1180  }
1181  sa->count = authoredSamples;
1182 }
1183 
1184 template <unsigned int CAPACITY>
1185 void
1187  TfToken const& key,
1189  size_t authoredSamples =
1191  id,
1192  key,
1193  CAPACITY,
1194  sa->times.data(),
1195  sa->values.data(),
1196  sa->indices.data());
1197  if (authoredSamples > CAPACITY) {
1198  sa->Resize(authoredSamples);
1199  size_t authoredSamplesSecondAttempt =
1201  id,
1202  key,
1203  authoredSamples,
1204  sa->times.data(),
1205  sa->values.data(),
1206  sa->indices.data());
1207  // Number of samples should be consistent through multiple
1208  // invocations of the sampling function.
1209  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1210  }
1211  sa->count = authoredSamples;
1212 }
1213 
1214 template <unsigned int CAPACITY>
1215 void
1217  TfToken const& key,
1218  float startTime,
1219  float endTime,
1221  size_t authoredSamples =
1223  id,
1224  key,
1225  startTime,
1226  endTime,
1227  CAPACITY,
1228  sa->times.data(),
1229  sa->values.data(),
1230  sa->indices.data());
1231  if (authoredSamples > CAPACITY) {
1232  sa->Resize(authoredSamples);
1233  size_t authoredSamplesSecondAttempt =
1235  id,
1236  key,
1237  startTime,
1238  endTime,
1239  authoredSamples,
1240  sa->times.data(),
1241  sa->values.data(),
1242  sa->indices.data());
1243  // Number of samples should be consistent through multiple
1244  // invocations of the sampling function.
1245  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1246  }
1247  sa->count = authoredSamples;
1248 }
1249 
1250 template <unsigned int CAPACITY>
1251 void
1253  SdfPath const& computationId,
1254  TfToken const& input,
1256  size_t authoredSamples = SampleExtComputationInput(
1257  computationId, input, CAPACITY,
1258  sa->times.data(), sa->values.data());
1259 
1260  if (authoredSamples > CAPACITY) {
1261  sa->Resize(authoredSamples);
1262  size_t authoredSamplesSecondAttempt = SampleExtComputationInput(
1263  computationId, input, authoredSamples,
1264  sa->times.data(), sa->values.data());
1265  // Number of samples should be consisntent through multiple
1266  // invokations of the sampling function.
1267  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1268  }
1269  sa->count = authoredSamples;
1270 }
1271 
1272 template <unsigned int CAPACITY>
1273 void
1275  SdfPath const& computationId,
1276  TfToken const& input,
1277  float startTime,
1278  float endTime,
1280  size_t authoredSamples = SampleExtComputationInput(
1281  computationId, input, startTime, endTime, CAPACITY,
1282  sa->times.data(), sa->values.data());
1283 
1284  if (authoredSamples > CAPACITY) {
1285  sa->Resize(authoredSamples);
1286  size_t authoredSamplesSecondAttempt = SampleExtComputationInput(
1287  computationId, input, startTime, endTime, authoredSamples,
1288  sa->times.data(), sa->values.data());
1289  // Number of samples should be consisntent through multiple
1290  // invokations of the sampling function.
1291  TF_VERIFY(authoredSamples == authoredSamplesSecondAttempt);
1292  }
1293  sa->count = authoredSamples;
1294 }
1295 
1297 
1298 #endif //PXR_IMAGING_HD_SCENE_DELEGATE_H
std::shared_ptr< SdfPathVector > HdIdVectorSharedPtr
A shared pointer to a vector of id's.
Definition: sceneDelegate.h:38
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)
TfToken cardGeometry
HdCullStyle
Definition: enums.h:105
virtual HD_API void PostSyncCleanup()
bool operator!=(HdExtComputationInputDescriptor const &rhs) const
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.
virtual HD_API SdfPath GetInstancerId(SdfPath const &primId)
Returns the parent instancer of the given rprim or instancer.
bool operator!=(HdPrimvarDescriptor const &rhs) const
~HdDisplayStyle()=default
bool operator!=(HdExtComputationPrimvarDescriptor const &rhs) const
std::vector< HdExtComputationInputDescriptor > HdExtComputationInputDescriptorVector
#define TF_CODING_ERROR
virtual HD_API HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(SdfPath const &volumeId)
virtual HD_API HdExtComputationInputDescriptorVector GetExtComputationInputDescriptors(SdfPath const &computationId)
bool operator!=(HdExtComputationOutputDescriptor const &rhs) const
Definition: vec3f.h:45
virtual HD_API std::string GetExtComputationKernel(SdfPath const &computationId)
#define HD_API
Definition: api.h:23
virtual HD_API bool IsEnabled(TfToken const &option) const
Returns true if the named option is enabled by the delegate.
GfVec3f drawModeColor
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
HdExtComputationInputDescriptor(TfToken const &name_, SdfPath const &sourceComputationId_, TfToken const &sourceComputationOutputName_)
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.
bool operator==(HdExtComputationInputDescriptor const &rhs) const
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.
Definition: sceneDelegate.h:44
bool displayInOverlay
Is the prim overlayed on top of other prims.
Definition: sceneDelegate.h:78
virtual HD_API VtValue GetMaterialResource(SdfPath const &materialId)
Returns the material ID bound to the rprim rprimId.
bool occludedSelectionShowsThrough
Definition: sceneDelegate.h:82
Definition: token.h:70
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 &paramName)
bool pointsShadingEnabled
Definition: sceneDelegate.h:86
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.
Definition: token.h:440
bool displacementEnabled
Is the prim displacement shaded.
Definition: sceneDelegate.h:75
virtual HD_API GfRange3d GetExtent(SdfPath const &id)
std::vector< HdDirtyBits > dirtyBits
Definition: sceneDelegate.h:57
virtual HD_API TfToken GetRenderTag(SdfPath const &id)
GLuint const GLchar * name
Definition: glcorearb.h:786
bool operator==(HdExtComputationPrimvarDescriptor const &rhs) const
Definition: path.h:273
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 &paramName)
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
Definition: path.h:1425
bool operator!=(HdDisplayStyle const &rhs) const
bool flatShadingEnabled
Is the prim flat shaded.
Definition: sceneDelegate.h:72
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)
HdInterpolation
Definition: enums.h:177
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
Definition: pxr.h:74
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.
SdfPathVector IDs
Definition: sceneDelegate.h:54
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)
Definition: value.h:146
virtual HD_API VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId)
virtual HD_API bool GetDoubleSided(SdfPath const &id)
Returns the doubleSided state for the given prim.
std::vector< HdExtComputationPrimvarDescriptor > HdExtComputationPrimvarDescriptorVector
value_type * data()
Definition: smallVector.h:735