unitTestDelegate.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_UNIT_TEST_DELEGATE_H
25 #define PXR_IMAGING_HD_UNIT_TEST_DELEGATE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/material.h"
30 #include "pxr/imaging/hd/sceneDelegate.h"
31 #include "pxr/imaging/hd/tokens.h"
33 
34 #include "pxr/base/gf/vec3f.h"
35 #include "pxr/base/gf/vec3d.h"
36 #include "pxr/base/gf/vec4f.h"
37 #include "pxr/base/gf/vec4d.h"
38 #include "pxr/base/gf/matrix4f.h"
39 #include "pxr/base/gf/matrix4d.h"
40 #include "pxr/base/vt/array.h"
41 #include "pxr/base/vt/dictionary.h"
43 
44 PXR_NAMESPACE_OPEN_SCOPE
45 
46 
52 {
53 public:
54  HD_API
55  HdUnitTestDelegate(HdRenderIndex *parentIndex,
56  SdfPath const& delegateID);
57 
58  void SetUseInstancePrimvars(bool v) { _hasInstancePrimvars = v; }
59 
60  HD_API
61  void SetRefineLevel(int level);
62 
63  HD_API
64  void SetVisibility(bool vis);
65 
66  // -----------------------------------------------------------------------
67 
68  HD_API
69  void AddMesh(SdfPath const& id);
70 
71  HD_API
72  void AddMesh(SdfPath const &id,
73  GfMatrix4f const &transform,
74  VtVec3fArray const &points,
75  VtIntArray const &numVerts,
76  VtIntArray const &verts,
77  bool guide=false,
78  SdfPath const &instancerId=SdfPath(),
79  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
80  TfToken const &orientation=HdTokens->rightHanded,
81  bool doubleSided=false);
82 
83  HD_API
84  void AddMesh(SdfPath const &id,
85  GfMatrix4f const &transform,
86  VtVec3fArray const &points,
87  VtIntArray const &numVerts,
88  VtIntArray const &verts,
89  VtIntArray const &holes,
90  PxOsdSubdivTags const &subdivTags,
91  VtValue const &color,
92  HdInterpolation colorInterpolation,
93  VtValue const &opacity,
94  HdInterpolation opacityInterpolation,
95  bool guide=false,
96  SdfPath const &instancerId=SdfPath(),
97  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
98  TfToken const &orientation=HdTokens->rightHanded,
99  bool doubleSided=false);
100 
101  HD_API
102  void AddMesh(SdfPath const &id,
103  GfMatrix4f const &transform,
104  VtVec3fArray const &points,
105  VtIntArray const &numVerts,
106  VtIntArray const &verts,
107  VtIntArray const &holes,
108  PxOsdSubdivTags const &subdivTags,
109  VtValue const &color,
110  VtIntArray const &colorIndices,
111  HdInterpolation colorInterpolation,
112  VtValue const &opacity,
113  VtIntArray const &opacityIndices,
114  HdInterpolation opacityInterpolation,
115  bool guide=false,
116  SdfPath const &instancerId=SdfPath(),
117  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
118  TfToken const &orientation=HdTokens->rightHanded,
119  bool doubleSided=false);
120 
122  HD_API
123  void AddCube(SdfPath const &id, GfMatrix4f const &transform, bool guide=false,
124  SdfPath const &instancerId=SdfPath(),
125  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark);
126 
128  HD_API
129  void AddGrid(SdfPath const &id, int x, int y, GfMatrix4f const &transform,
130  bool rightHanded=true, bool doubleSided=false,
131  SdfPath const &instancerId=SdfPath());
132 
134  HD_API
135  void AddGridWithFaceColor(SdfPath const &id, int x, int y,
136  GfMatrix4f const &transform,
137  bool rightHanded=true, bool doubleSided=false,
138  SdfPath const &instancerId=SdfPath());
139 
141  HD_API
142  void AddGridWithVertexColor(SdfPath const &id, int x, int y,
143  GfMatrix4f const &transform,
144  bool rightHanded=true, bool doubleSided=false,
145  SdfPath const &instancerId=SdfPath());
146 
148  HD_API
149  void AddGridWithFaceVaryingColor(SdfPath const &id, int x, int y,
150  GfMatrix4f const &transform,
151  bool rightHanded=true, bool doubleSided=false,
152  SdfPath const &instancerId=SdfPath());
153 
154  // Add a grid with division x*y and a custom color
155  HD_API
156  void AddGridWithCustomColor(SdfPath const &id, int nx, int ny,
157  GfMatrix4f const &transform,
158  VtValue const &color,
159  HdInterpolation colorInterpolation,
160  bool rightHanded=true, bool doubleSided=false,
161  SdfPath const &instancerId=SdfPath());
162 
164  HD_API
165  void AddPolygons(SdfPath const &id, GfMatrix4f const &transform,
166  HdInterpolation colorInterp,
167  SdfPath const &instancerId=SdfPath());
168 
171  HD_API
173  SdfPath const &id, GfMatrix4f const &transform,
174  SdfPath const &instancerId=SdfPath());
175 
177  HD_API
178  void AddSubdiv(SdfPath const &id, GfMatrix4f const &transform,
179  SdfPath const &insatancerId=SdfPath());
180 
181  // -----------------------------------------------------------------------
182 
183  HD_API
184  void AddBasisCurves(SdfPath const &id,
185  VtVec3fArray const &points,
186  VtIntArray const &curveVertexCounts,
187  VtIntArray const &curveIndices,
188  VtVec3fArray const &normals,
189  TfToken const &type,
190  TfToken const &basis,
191  VtValue const &color,
192  HdInterpolation colorInterpolation,
193  VtValue const &opacity,
194  HdInterpolation opacityInterpolation,
195  VtValue const &width,
196  HdInterpolation widthInterpolation,
197  SdfPath const &instancerId=SdfPath());
198 
200  HD_API
201  void AddCurves(SdfPath const &id, TfToken const &type, TfToken const &basis,
202  GfMatrix4f const &transform,
203  HdInterpolation colorInterp=HdInterpolationConstant,
204  HdInterpolation widthInterp=HdInterpolationConstant,
205  bool authoredNormals=false,
206  SdfPath const &instancerId=SdfPath());
207 
208  HD_API
209  void AddPoints(SdfPath const &id,
210  VtVec3fArray const &points,
211  VtValue const &color,
212  HdInterpolation colorInterpolation,
213  VtValue const &opacity,
214  HdInterpolation opacityInterpolation,
215  VtValue const &width,
216  HdInterpolation widthInterpolation,
217  SdfPath const &instancerId=SdfPath());
218 
220  HD_API
221  void AddPoints(SdfPath const &id,
222  GfMatrix4f const &transform,
223  HdInterpolation colorInterp=HdInterpolationConstant,
224  HdInterpolation widthInterp=HdInterpolationConstant,
225  SdfPath const &instancerId=SdfPath());
226 
228  HD_API
229  void AddInstancer(SdfPath const &id,
230  SdfPath const &parentId=SdfPath(),
231  GfMatrix4f const &rootTransform=GfMatrix4f(1));
232 
233  HD_API
234  void SetInstancerProperties(SdfPath const &id,
235  VtIntArray const &prototypeIndex,
236  VtVec3fArray const &scale,
237  VtVec4fArray const &rotate,
238  VtVec3fArray const &translate);
239 
240  HD_API
241  void UpdateInstancer(SdfPath const& rprimId, SdfPath const& instancerId);
242 
244  HD_API
245  void AddPrimvar(SdfPath const& id,
246  TfToken const& name,
247  VtValue const& value,
248  HdInterpolation const& interp,
249  TfToken const& role,
250  VtIntArray const& indices=VtIntArray(0));
251 
252  HD_API
253  void UpdatePrimvarValue(SdfPath const& id,
254  TfToken const& name,
255  VtValue const& value,
256  VtIntArray const& indices=VtIntArray(0));
257 
258  HD_API
259  void RemovePrimvar(SdfPath const& id, TfToken const& name);
260 
262  HD_API
263  void UpdateTransform(SdfPath const& id, GfMatrix4f const& mat);
264 
266  HD_API
267  void AddMaterialResource(SdfPath const &id,
268  VtValue materialResource);
269 
271  HD_API
272  void UpdateMaterialResource(SdfPath const &materialId,
273  VtValue materialResource);
274 
275  HD_API
276  void BindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
277 
279  HD_API
280  void RebindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
281 
283  HD_API
284  void AddRenderBuffer(SdfPath const &id,
285  HdRenderBufferDescriptor const &desc);
286  HD_API
287  void UpdateRenderBuffer(SdfPath const &id,
288  HdRenderBufferDescriptor const &desc);
289 
291  HD_API
292  void AddCamera(SdfPath const &id);
293  HD_API
294  void UpdateCamera(SdfPath const &id, TfToken const &key, VtValue value);
295 
297  template<typename T>
298  void AddTask(SdfPath const &id) {
299  GetRenderIndex().InsertTask<T>(this, id);
300  _tasks[id] = _Task();
301  }
302  HD_API
303  void UpdateTask(SdfPath const &id, TfToken const &key, VtValue value);
304 
306  HD_API
307  void Remove(SdfPath const &id);
308 
310  HD_API
311  void Clear();
312 
313  // Hides an rprim, invalidating all collections it was in.
314  HD_API
315  void HideRprim(SdfPath const &id);
316 
317  // Un-hides an rprim, invalidating all collections it was in.
318  HD_API
319  void UnhideRprim(SdfPath const &id);
320 
321  // set per-prim repr
322  HD_API
323  void SetReprSelector(SdfPath const &id, HdReprSelector const &reprSelector);
324 
325  // set per-prim refine level
326  HD_API
327  void SetRefineLevel(SdfPath const &id, int refineLevel);
328 
329  // set per-prim visibility
330  HD_API
331  void SetVisibility(SdfPath const &id, bool vis);
332 
334  HD_API
335  void MarkRprimDirty(SdfPath path, HdDirtyBits flag);
336 
337  HD_API
338  void UpdatePositions(SdfPath const &id, float time);
339  HD_API
340  void UpdateRprims(float time);
341  HD_API
342  void UpdateInstancerPrimvars(float time);
343  HD_API
344  void UpdateInstancerPrototypes(float time);
345  HD_API
346  void UpdateCurvePrimvarsInterpMode(float time);
347 
348  // ---------------------------------------------------------------------- //
349  // utility functions generating test case
350  // ---------------------------------------------------------------------- //
351  HD_API
352  GfVec3f PopulateBasicTestSet();
353  HD_API
354  GfVec3f PopulateInvalidPrimsSet();
355 
356  // ---------------------------------------------------------------------- //
357  // See HdSceneDelegate for documentation of virtual methods.
358  // ---------------------------------------------------------------------- //
359  HD_API
360  virtual HdMeshTopology GetMeshTopology(SdfPath const& id) override;
361  HD_API
363  override;
364  HD_API
365  virtual TfToken GetRenderTag(SdfPath const& id) override;
366  HD_API
367  virtual TfTokenVector GetTaskRenderTags(SdfPath const &taskId) override;
368  HD_API
369  virtual PxOsdSubdivTags GetSubdivTags(SdfPath const& id) override;
370  HD_API
371  virtual GfRange3d GetExtent(SdfPath const & id) override;
372  HD_API
373  virtual GfMatrix4d GetTransform(SdfPath const & id) override;
374  HD_API
375  virtual bool GetVisible(SdfPath const & id) override;
376  HD_API
377  virtual bool GetDoubleSided(SdfPath const & id) override;
378  HD_API
379  virtual HdDisplayStyle GetDisplayStyle(SdfPath const & id) override;
380  HD_API
381  virtual VtValue Get(SdfPath const& id, TfToken const& key) override;
382  HD_API
383  virtual VtValue GetIndexedPrimvar(SdfPath const& id, TfToken const& key,
384  VtIntArray *outIndices) override;
385  HD_API
386  virtual HdReprSelector GetReprSelector(SdfPath const &id) override;
387  HD_API
388  virtual HdPrimvarDescriptorVector
389  GetPrimvarDescriptors(SdfPath const& id,
390  HdInterpolation interpolation) override;
391 
392  HD_API
393  virtual VtIntArray GetInstanceIndices(SdfPath const& instancerId,
394  SdfPath const& prototypeId) override;
395 
396  HD_API
397  virtual SdfPathVector GetInstancerPrototypes(SdfPath const& instancerId)
398  override;
399 
400  HD_API
401  virtual GfMatrix4d GetInstancerTransform(SdfPath const& instancerId)
402  override;
403 
404  HD_API
405  virtual SdfPath GetMaterialId(SdfPath const& rprimId) override;
406 
407  HD_API
408  virtual SdfPath GetInstancerId(SdfPath const& primId) override;
409 
410  HD_API
411  virtual VtValue GetMaterialResource(SdfPath const &materialId) override;
412 
413  HD_API
414  virtual VtValue GetCameraParamValue(SdfPath const &cameraId,
415  TfToken const &paramName) override;
416 
417  HD_API
419  SdfPath const& id) override;
420 
421 private:
422  // ---------------------------------------------------------------------- //
423  // private utility methods
424  // ---------------------------------------------------------------------- //
425  VtValue _GetPrimvarValue(SdfPath const& id, TfToken const& name);
426 
427  // ---------------------------------------------------------------------- //
428  // internal types
429  // ---------------------------------------------------------------------- //
430  struct _Mesh {
431  _Mesh() { }
432  _Mesh(TfToken const &scheme,
433  TfToken const &orientation,
434  GfMatrix4f const &transform,
435  VtVec3fArray const &points,
436  VtIntArray const &numVerts,
437  VtIntArray const &verts,
438  VtIntArray const &holes,
439  PxOsdSubdivTags const &subdivTags,
440  bool guide,
441  bool doubleSided) :
442  scheme(scheme), orientation(orientation),
443  transform(transform),
444  points(points), numVerts(numVerts), verts(verts),
445  holes(holes), subdivTags(subdivTags), guide(guide),
446  doubleSided(doubleSided) { }
447 
448  TfToken scheme;
449  TfToken orientation;
450  GfMatrix4f transform;
451  VtVec3fArray points;
452  VtIntArray numVerts;
453  VtIntArray verts;
454  VtIntArray holes;
455  PxOsdSubdivTags subdivTags;
456  bool guide;
457  bool doubleSided;
458  HdReprSelector reprSelector;
459  };
460  struct _Curves {
461  _Curves() { }
462  _Curves(VtVec3fArray const &points,
463  VtIntArray const &curveVertexCounts,
464  VtIntArray const &curveIndices,
465  TfToken const &type,
466  TfToken const &basis) :
467  points(points), curveVertexCounts(curveVertexCounts),
468  curveIndices(curveIndices), type(type), basis(basis) { }
469 
470  VtVec3fArray points;
471  VtIntArray curveVertexCounts;
472  VtIntArray curveIndices;
473  TfToken type;
474  TfToken basis;
475  };
476  struct _Points {
477  _Points() { }
478  _Points(VtVec3fArray const &points) : points(points) { }
479 
480  VtVec3fArray points;
481  };
482  struct _Instancer {
483  _Instancer() { }
484  _Instancer(VtVec3fArray const &scale,
485  VtVec4fArray const &rotate,
486  VtVec3fArray const &translate,
487  GfMatrix4f const &rootTransform) :
488  scale(scale), rotate(rotate), translate(translate),
489  rootTransform(rootTransform) {
490  }
491  VtVec3fArray scale;
492  VtVec4fArray rotate;
493  VtVec3fArray translate;
494  VtIntArray prototypeIndices;
495  GfMatrix4f rootTransform;
496 
497  std::vector<SdfPath> prototypes;
498  };
499  struct _Primvar {
500  _Primvar() {}
501  _Primvar(TfToken const& _name,
502  VtValue const& _value,
503  HdInterpolation const& _interp,
504  TfToken const& _role,
505  VtIntArray const& _indices=VtIntArray(0)) :
506  name(_name),
507  value(_value),
508  interp(_interp),
509  role(_role),
510  indices(_indices) {}
511 
512  TfToken name;
513  VtValue value;
514  HdInterpolation interp;
515  TfToken role;
516  VtIntArray indices;
517  };
518  using _Primvars = std::vector<_Primvar>;
519  // Given an rprim id and primvar name, looks up the primvars map (see below)
520  // and returns true with the iterator to the entry if it was found.
521  bool _FindPrimvar(SdfPath const& id,
522  TfToken const& name,
523  _Primvars::iterator *pvIt);
524 
525  struct _Camera {
526  VtDictionary params;
527  GfMatrix4f transform;
528  };
529  struct _Light {
530  VtDictionary params;
531  };
532  struct _Task {
533  VtDictionary params;
534  };
535  struct _RenderBuffer {
536  _RenderBuffer() {}
537  _RenderBuffer(GfVec3i const &d, HdFormat f, bool ms)
538  : dims(d), format(f), multiSampled(ms) {}
539  GfVec3i dims;
540  HdFormat format;
541  bool multiSampled;
542  };
543 
544  std::map<SdfPath, _Mesh> _meshes;
545  std::map<SdfPath, _Curves> _curves;
546  std::map<SdfPath, _Points> _points;
547  std::map<SdfPath, _Instancer> _instancers;
548  std::map<SdfPath, _Primvars> _primvars;
549  std::map<SdfPath, VtValue> _materials;
550  std::map<SdfPath, _Camera> _cameras;
551  std::map<SdfPath, _RenderBuffer> _renderBuffers;
552  std::map<SdfPath, _Light> _lights;
553  std::map<SdfPath, _Task> _tasks;
554  TfHashSet<SdfPath, SdfPath::Hash> _hiddenRprims;
555 
556  typedef std::map<SdfPath, SdfPath> SdfPathMap;
557  SdfPathMap _materialBindings;
558  SdfPathMap _instancerBindings;
559 
560  bool _hasInstancePrimvars;
561  int _refineLevel;
562  bool _visibility;
563  std::map<SdfPath, int> _refineLevels;
564  std::map<SdfPath, bool> _visibilities;
565 };
566 
567 
568 PXR_NAMESPACE_CLOSE_SCOPE
569 
570 #endif // PXR_IMAGING_HD_UNIT_TEST_DELEGATE_H
HD_API void AddGridWithFaceVaryingColor(SdfPath const &id, int x, int y, GfMatrix4f const &transform, bool rightHanded=true, bool doubleSided=false, SdfPath const &instancerId=SdfPath())
Add a grid with division x*y.
Tags for non-hierarchial subdiv surfaces.
Definition: subdivTags.h:43
Stores a 4x4 matrix of float elements.
Definition: matrix4f.h:88
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:120
Basic type: 3-dimensional floating point range.
Definition: range3d.h:64
HD_API void RebindMaterial(SdfPath const &rprimId, SdfPath const &materialId)
Example to update a material binding on the fly.
HD_API void AddCurves(SdfPath const &id, TfToken const &type, TfToken const &basis, GfMatrix4f const &transform, HdInterpolation colorInterp=HdInterpolationConstant, HdInterpolation widthInterp=HdInterpolationConstant, bool authoredNormals=false, SdfPath const &instancerId=SdfPath())
Add a basis curves prim containing two curves.
HD_API void AddSubdiv(SdfPath const &id, GfMatrix4f const &transform, SdfPath const &insatancerId=SdfPath())
Add a subdiv with various tags.
Describes how the geometry of a prim should be displayed.
Definition: sceneDelegate.h:80
virtual HD_API GfMatrix4d GetTransform(SdfPath const &id) override
Returns the object space transform, including all parent transforms.
virtual HD_API VtValue Get(SdfPath const &id, TfToken const &key) override
Returns a named value.
virtual HD_API HdMeshTopology GetMeshTopology(SdfPath const &id) override
Gets the topological mesh data for a given prim.
HD_API void AddCamera(SdfPath const &id)
Camera.
A map with string keys and VtValue values.
Definition: dictionary.h:63
Describes the allocation structure of a render buffer bprim.
Definition: aov.h:84
virtual HD_API VtValue GetIndexedPrimvar(SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override
Returns a named primvar value.
Basic type for a vector of 3 float components.
Definition: vec3f.h:63
virtual HD_API HdRenderBufferDescriptor GetRenderBufferDescriptor(SdfPath const &id) override
Returns the allocation descriptor for a given render buffer prim.
virtual HD_API HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id) override
Gets the topological curve data for a given prim.
virtual HD_API bool GetDoubleSided(SdfPath const &id) override
Returns the doubleSided state for the given prim.
HD_API void UpdateMaterialResource(SdfPath const &materialId, VtValue materialResource)
Update a material resource.
HD_API void AddGridWithFaceColor(SdfPath const &id, int x, int y, GfMatrix4f const &transform, bool rightHanded=true, bool doubleSided=false, SdfPath const &instancerId=SdfPath())
Add a grid with division x*y.
HD_API void AddGridWithVertexColor(SdfPath const &id, int x, int y, GfMatrix4f const &transform, bool rightHanded=true, bool doubleSided=false, SdfPath const &instancerId=SdfPath())
Add a grid with division x*y.
HD_API void AddRenderBuffer(SdfPath const &id, HdRenderBufferDescriptor const &desc)
Render buffers.
virtual HD_API SdfPath GetInstancerId(SdfPath const &primId) override
Returns the parent instancer of the given rprim or instancer.
HD_API void AddCube(SdfPath const &id, GfMatrix4f const &transform, bool guide=false, SdfPath const &instancerId=SdfPath(), TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark)
Add a cube.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
HD_API void MarkRprimDirty(SdfPath path, HdDirtyBits flag)
Marks an rprim in the RenderIndex as dirty with the given dirty flags.
virtual HD_API PxOsdSubdivTags GetSubdivTags(SdfPath const &id) override
Gets the subdivision surface tags (sharpness, holes, etc).
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
Adapter class providing data exchange with the client scene graph.
HD_API void AddPolygons(SdfPath const &id, GfMatrix4f const &transform, HdInterpolation colorInterp, SdfPath const &instancerId=SdfPath())
Add a triangle, quad and pentagon.
HD_API void AddGrid(SdfPath const &id, int x, int y, GfMatrix4f const &transform, bool rightHanded=true, bool doubleSided=false, SdfPath const &instancerId=SdfPath())
Add a grid with division x*y.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
Basic type for a vector of 3 int components.
Definition: vec3i.h:61
HD_API void AddInstancer(SdfPath const &id, SdfPath const &parentId=SdfPath(), GfMatrix4f const &rootTransform=GfMatrix4f(1))
Instancer.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
virtual HD_API HdReprSelector GetReprSelector(SdfPath const &id) override
Returns the authored repr (if any) for the given prim.
Topology data for basisCurves.
virtual HD_API HdDisplayStyle GetDisplayStyle(SdfPath const &id) override
Returns the refinement level for the given prim in the range [0,8].
virtual HD_API HdPrimvarDescriptorVector GetPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolation) override
Returns descriptors for all primvars of the given interpolation type.
HD_API void AddMaterialResource(SdfPath const &id, VtValue materialResource)
Material.
virtual HD_API SdfPath GetMaterialId(SdfPath const &rprimId) override
Returns the material ID bound to the rprim rprimId.
virtual HD_API TfToken GetRenderTag(SdfPath const &id) override
Returns the render tag that will be used to bucket prims during render pass bucketing.
This file defines some macros that are useful for declaring and using static TfTokens.
Describes one or more authored display representations for an rprim.
Definition: repr.h:48
virtual HD_API bool GetVisible(SdfPath const &id) override
Returns the authored visible state of the prim.
HD_API void Remove(SdfPath const &id)
Remove a prim.
virtual HD_API GfMatrix4d GetInstancerTransform(SdfPath const &instancerId) override
Returns the instancer transform.
HD_API void Clear()
Clear all prims.
virtual HD_API VtValue GetCameraParamValue(SdfPath const &cameraId, TfToken const &paramName) override
Returns a single value for a given camera and parameter.
virtual HD_API GfRange3d GetExtent(SdfPath const &id) override
Gets the axis aligned bounds of a prim.
void AddTask(SdfPath const &id)
Tasks.
HD_API void UpdateTransform(SdfPath const &id, GfMatrix4f const &mat)
Transform.
void InsertTask(HdSceneDelegate *delegate, SdfPath const &id)
Inserts a new task into the render index with an identifier of id.
Definition: renderIndex.h:577
HD_API void AddFaceVaryingPolygons(SdfPath const &id, GfMatrix4f const &transform, SdfPath const &instancerId=SdfPath())
Add a triangle, quad and pentagon with face-varying displayColor and displayOpacity.
Topology data for meshes.
Definition: meshTopology.h:55
virtual HD_API SdfPathVector GetInstancerPrototypes(SdfPath const &instancerId) override
Returns a list of prototypes of this instancer.
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
A simple delegate class for unit test driver.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:166
HD_API void AddPrimvar(SdfPath const &id, TfToken const &name, VtValue const &value, HdInterpolation const &interp, TfToken const &role, VtIntArray const &indices=VtIntArray(0))
Primvars.
virtual HD_API VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId) override
Gets the extracted indices array of the prototype id used in the instancer.