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 public:
53  HD_API
54  HdUnitTestDelegate(HdRenderIndex *parentIndex,
55  SdfPath const& delegateID);
56 
57  void SetUseInstancePrimvars(bool v) { _hasInstancePrimvars = v; }
58 
59  HD_API
60  void SetRefineLevel(int level);
61 
62  HD_API
63  void SetVisibility(bool vis);
64 
65  // -----------------------------------------------------------------------
66 
67  HD_API
68  void AddMesh(SdfPath const& id);
69 
70  HD_API
71  void AddMesh(SdfPath const &id,
72  GfMatrix4f const &transform,
73  VtVec3fArray const &points,
74  VtIntArray const &numVerts,
75  VtIntArray const &verts,
76  bool guide=false,
77  SdfPath const &instancerId=SdfPath(),
78  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
79  TfToken const &orientation=HdTokens->rightHanded,
80  bool doubleSided=false);
81 
82  HD_API
83  void AddMesh(SdfPath const &id,
84  GfMatrix4f const &transform,
85  VtVec3fArray const &points,
86  VtIntArray const &numVerts,
87  VtIntArray const &verts,
88  VtIntArray const &holes,
89  PxOsdSubdivTags const &subdivTags,
90  VtValue const &color,
91  HdInterpolation colorInterpolation,
92  VtValue const &opacity,
93  HdInterpolation opacityInterpolation,
94  bool guide=false,
95  SdfPath const &instancerId=SdfPath(),
96  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
97  TfToken const &orientation=HdTokens->rightHanded,
98  bool doubleSided=false);
99 
100  HD_API
101  void AddMesh(SdfPath const &id,
102  GfMatrix4f const &transform,
103  VtVec3fArray const &points,
104  VtIntArray const &numVerts,
105  VtIntArray const &verts,
106  VtIntArray const &holes,
107  PxOsdSubdivTags const &subdivTags,
108  VtValue const &color,
109  VtIntArray const &colorIndices,
110  HdInterpolation colorInterpolation,
111  VtValue const &opacity,
112  VtIntArray const &opacityIndices,
113  HdInterpolation opacityInterpolation,
114  bool guide=false,
115  SdfPath const &instancerId=SdfPath(),
116  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
117  TfToken const &orientation=HdTokens->rightHanded,
118  bool doubleSided=false);
119 
121  HD_API
122  void AddCube(SdfPath const &id, GfMatrix4f const &transform, bool guide=false,
123  SdfPath const &instancerId=SdfPath(),
124  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark);
125 
127  HD_API
128  void AddGrid(SdfPath const &id, int x, int y, GfMatrix4f const &transform,
129  bool rightHanded=true, bool doubleSided=false,
130  SdfPath const &instancerId=SdfPath());
131 
133  HD_API
134  void AddGridWithFaceColor(SdfPath const &id, int x, int y,
135  GfMatrix4f const &transform,
136  bool rightHanded=true, bool doubleSided=false,
137  SdfPath const &instancerId=SdfPath());
138 
140  HD_API
141  void AddGridWithVertexColor(SdfPath const &id, int x, int y,
142  GfMatrix4f const &transform,
143  bool rightHanded=true, bool doubleSided=false,
144  SdfPath const &instancerId=SdfPath());
145 
147  HD_API
148  void AddGridWithFaceVaryingColor(SdfPath const &id, int x, int y,
149  GfMatrix4f const &transform,
150  bool rightHanded=true, bool doubleSided=false,
151  SdfPath const &instancerId=SdfPath());
152 
153  // Add a grid with division x*y and a custom color
154  HD_API
155  void AddGridWithCustomColor(SdfPath const &id, int nx, int ny,
156  GfMatrix4f const &transform,
157  VtValue const &color,
158  HdInterpolation colorInterpolation,
159  bool rightHanded=true, bool doubleSided=false,
160  SdfPath const &instancerId=SdfPath());
161 
163  HD_API
164  void AddPolygons(SdfPath const &id, GfMatrix4f const &transform,
165  HdInterpolation colorInterp,
166  SdfPath const &instancerId=SdfPath());
167 
170  HD_API
172  SdfPath const &id, GfMatrix4f const &transform,
173  SdfPath const &instancerId=SdfPath());
174 
176  HD_API
177  void AddSubdiv(SdfPath const &id, GfMatrix4f const &transform,
178  SdfPath const &insatancerId=SdfPath());
179 
180  // -----------------------------------------------------------------------
181 
182  HD_API
183  void AddBasisCurves(SdfPath const &id,
184  VtVec3fArray const &points,
185  VtIntArray const &curveVertexCounts,
186  VtIntArray const &curveIndices,
187  VtVec3fArray const &normals,
188  TfToken const &type,
189  TfToken const &basis,
190  VtValue const &color,
191  HdInterpolation colorInterpolation,
192  VtValue const &opacity,
193  HdInterpolation opacityInterpolation,
194  VtValue const &width,
195  HdInterpolation widthInterpolation,
196  SdfPath const &instancerId=SdfPath());
197 
199  HD_API
200  void AddCurves(SdfPath const &id, TfToken const &type, TfToken const &basis,
201  GfMatrix4f const &transform,
202  HdInterpolation colorInterp=HdInterpolationConstant,
203  HdInterpolation widthInterp=HdInterpolationConstant,
204  bool authoredNormals=false,
205  SdfPath const &instancerId=SdfPath());
206 
207  HD_API
208  void AddPoints(SdfPath const &id,
209  VtVec3fArray const &points,
210  VtValue const &color,
211  HdInterpolation colorInterpolation,
212  VtValue const &opacity,
213  HdInterpolation opacityInterpolation,
214  VtValue const &width,
215  HdInterpolation widthInterpolation,
216  SdfPath const &instancerId=SdfPath());
217 
219  HD_API
220  void AddPoints(SdfPath const &id,
221  GfMatrix4f const &transform,
222  HdInterpolation colorInterp=HdInterpolationConstant,
223  HdInterpolation widthInterp=HdInterpolationConstant,
224  SdfPath const &instancerId=SdfPath());
225 
227  HD_API
228  void AddInstancer(SdfPath const &id,
229  SdfPath const &parentId=SdfPath(),
230  GfMatrix4f const &rootTransform=GfMatrix4f(1));
231 
232  HD_API
233  void SetInstancerProperties(SdfPath const &id,
234  VtIntArray const &prototypeIndex,
235  VtVec3fArray const &scale,
236  VtVec4fArray const &rotate,
237  VtVec3fArray const &translate);
238 
239  HD_API
240  void UpdateInstancer(SdfPath const& rprimId, SdfPath const& instancerId);
241 
243  HD_API
244  void AddPrimvar(SdfPath const& id,
245  TfToken const& name,
246  VtValue const& value,
247  HdInterpolation const& interp,
248  TfToken const& role,
249  VtIntArray const& indices=VtIntArray(0));
250 
251  HD_API
252  void UpdatePrimvarValue(SdfPath const& id,
253  TfToken const& name,
254  VtValue const& value,
255  VtIntArray const& indices=VtIntArray(0));
256 
257  HD_API
258  void RemovePrimvar(SdfPath const& id, TfToken const& name);
259 
261  HD_API
262  void UpdateTransform(SdfPath const& id, GfMatrix4f const& mat);
263 
265  HD_API
266  void AddMaterialResource(SdfPath const &id,
267  VtValue materialResource);
268 
270  HD_API
271  void UpdateMaterialResource(SdfPath const &materialId,
272  VtValue materialResource);
273 
274  HD_API
275  void BindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
276 
278  HD_API
279  void RebindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
280 
282  HD_API
283  void AddRenderBuffer(SdfPath const &id, GfVec3i const& dims,
284  HdFormat format, bool multiSampled);
285 
287  HD_API
288  void AddCamera(SdfPath const &id);
289  HD_API
290  void UpdateCamera(SdfPath const &id, TfToken const &key, VtValue value);
291 
293  template<typename T>
294  void AddTask(SdfPath const &id) {
295  GetRenderIndex().InsertTask<T>(this, id);
296  _tasks[id] = _Task();
297  }
298  HD_API
299  void UpdateTask(SdfPath const &id, TfToken const &key, VtValue value);
300 
302  HD_API
303  void Remove(SdfPath const &id);
304 
306  HD_API
307  void Clear();
308 
309  // Hides an rprim, invalidating all collections it was in.
310  HD_API
311  void HideRprim(SdfPath const &id);
312 
313  // Un-hides an rprim, invalidating all collections it was in.
314  HD_API
315  void UnhideRprim(SdfPath const &id);
316 
317  // set per-prim repr
318  HD_API
319  void SetReprSelector(SdfPath const &id, HdReprSelector const &reprSelector);
320 
321  // set per-prim refine level
322  HD_API
323  void SetRefineLevel(SdfPath const &id, int refineLevel);
324 
325  // set per-prim visibility
326  HD_API
327  void SetVisibility(SdfPath const &id, bool vis);
328 
330  HD_API
331  void MarkRprimDirty(SdfPath path, HdDirtyBits flag);
332 
333  HD_API
334  void UpdatePositions(SdfPath const &id, float time);
335  HD_API
336  void UpdateRprims(float time);
337  HD_API
338  void UpdateInstancerPrimvars(float time);
339  HD_API
340  void UpdateInstancerPrototypes(float time);
341  HD_API
342  void UpdateCurvePrimvarsInterpMode(float time);
343 
344  // ---------------------------------------------------------------------- //
345  // utility functions generating test case
346  // ---------------------------------------------------------------------- //
347  HD_API
348  GfVec3f PopulateBasicTestSet();
349  HD_API
350  GfVec3f PopulateInvalidPrimsSet();
351 
352  // ---------------------------------------------------------------------- //
353  // See HdSceneDelegate for documentation of virtual methods.
354  // ---------------------------------------------------------------------- //
355  HD_API
356  virtual HdMeshTopology GetMeshTopology(SdfPath const& id) override;
357  HD_API
359  override;
360  HD_API
361  virtual TfToken GetRenderTag(SdfPath const& id) override;
362  HD_API
363  virtual TfTokenVector GetTaskRenderTags(SdfPath const &taskId) override;
364  HD_API
365  virtual PxOsdSubdivTags GetSubdivTags(SdfPath const& id) override;
366  HD_API
367  virtual GfRange3d GetExtent(SdfPath const & id) override;
368  HD_API
369  virtual GfMatrix4d GetTransform(SdfPath const & id) override;
370  HD_API
371  virtual bool GetVisible(SdfPath const & id) override;
372  HD_API
373  virtual bool GetDoubleSided(SdfPath const & id) override;
374  HD_API
375  virtual HdDisplayStyle GetDisplayStyle(SdfPath const & id) override;
376  HD_API
377  virtual VtValue Get(SdfPath const& id, TfToken const& key) override;
378  HD_API
379  virtual VtValue GetIndexedPrimvar(SdfPath const& id, TfToken const& key,
380  VtIntArray *outIndices) override;
381  HD_API
382  virtual HdReprSelector GetReprSelector(SdfPath const &id) override;
383  HD_API
384  virtual HdPrimvarDescriptorVector
385  GetPrimvarDescriptors(SdfPath const& id,
386  HdInterpolation interpolation) override;
387 
388  HD_API
389  virtual VtIntArray GetInstanceIndices(SdfPath const& instancerId,
390  SdfPath const& prototypeId) override;
391 
392  HD_API
393  virtual SdfPathVector GetInstancerPrototypes(SdfPath const& instancerId)
394  override;
395 
396  HD_API
397  virtual GfMatrix4d GetInstancerTransform(SdfPath const& instancerId)
398  override;
399 
400  HD_API
401  virtual SdfPath GetMaterialId(SdfPath const& rprimId) override;
402 
403  HD_API
404  virtual SdfPath GetInstancerId(SdfPath const& primId) override;
405 
406  HD_API
407  virtual VtValue GetMaterialResource(SdfPath const &materialId) override;
408 
409  HD_API
410  virtual VtValue GetCameraParamValue(SdfPath const &cameraId,
411  TfToken const &paramName) override;
412 
413  HD_API
415  SdfPath const& id) override;
416 
417 private:
418  // ---------------------------------------------------------------------- //
419  // private utility methods
420  // ---------------------------------------------------------------------- //
421  VtValue _GetPrimvarValue(SdfPath const& id, TfToken const& name);
422 
423  // ---------------------------------------------------------------------- //
424  // internal types
425  // ---------------------------------------------------------------------- //
426  struct _Mesh {
427  _Mesh() { }
428  _Mesh(TfToken const &scheme,
429  TfToken const &orientation,
430  GfMatrix4f const &transform,
431  VtVec3fArray const &points,
432  VtIntArray const &numVerts,
433  VtIntArray const &verts,
434  VtIntArray const &holes,
435  PxOsdSubdivTags const &subdivTags,
436  bool guide,
437  bool doubleSided) :
438  scheme(scheme), orientation(orientation),
439  transform(transform),
440  points(points), numVerts(numVerts), verts(verts),
441  holes(holes), subdivTags(subdivTags), guide(guide),
442  doubleSided(doubleSided) { }
443 
444  TfToken scheme;
445  TfToken orientation;
446  GfMatrix4f transform;
447  VtVec3fArray points;
448  VtIntArray numVerts;
449  VtIntArray verts;
450  VtIntArray holes;
451  PxOsdSubdivTags subdivTags;
452  bool guide;
453  bool doubleSided;
454  HdReprSelector reprSelector;
455  };
456  struct _Curves {
457  _Curves() { }
458  _Curves(VtVec3fArray const &points,
459  VtIntArray const &curveVertexCounts,
460  VtIntArray const &curveIndices,
461  TfToken const &type,
462  TfToken const &basis) :
463  points(points), curveVertexCounts(curveVertexCounts),
464  curveIndices(curveIndices), type(type), basis(basis) { }
465 
466  VtVec3fArray points;
467  VtIntArray curveVertexCounts;
468  VtIntArray curveIndices;
469  TfToken type;
470  TfToken basis;
471  };
472  struct _Points {
473  _Points() { }
474  _Points(VtVec3fArray const &points) : points(points) { }
475 
476  VtVec3fArray points;
477  };
478  struct _Instancer {
479  _Instancer() { }
480  _Instancer(VtVec3fArray const &scale,
481  VtVec4fArray const &rotate,
482  VtVec3fArray const &translate,
483  GfMatrix4f const &rootTransform) :
484  scale(scale), rotate(rotate), translate(translate),
485  rootTransform(rootTransform) {
486  }
487  VtVec3fArray scale;
488  VtVec4fArray rotate;
489  VtVec3fArray translate;
490  VtIntArray prototypeIndices;
491  GfMatrix4f rootTransform;
492 
493  std::vector<SdfPath> prototypes;
494  };
495  struct _Primvar {
496  _Primvar() {}
497  _Primvar(TfToken const& _name,
498  VtValue const& _value,
499  HdInterpolation const& _interp,
500  TfToken const& _role,
501  VtIntArray const& _indices=VtIntArray(0)) :
502  name(_name),
503  value(_value),
504  interp(_interp),
505  role(_role),
506  indices(_indices) {}
507 
508  TfToken name;
509  VtValue value;
510  HdInterpolation interp;
511  TfToken role;
512  VtIntArray indices;
513  };
514  using _Primvars = std::vector<_Primvar>;
515  // Given an rprim id and primvar name, looks up the primvars map (see below)
516  // and returns true with the iterator to the entry if it was found.
517  bool _FindPrimvar(SdfPath const& id,
518  TfToken const& name,
519  _Primvars::iterator *pvIt);
520 
521  struct _Camera {
522  VtDictionary params;
523  };
524  struct _Light {
525  VtDictionary params;
526  };
527  struct _Task {
528  VtDictionary params;
529  };
530  struct _RenderBuffer {
531  _RenderBuffer() {}
532  _RenderBuffer(GfVec3i const &d, HdFormat f, bool ms)
533  : dims(d), format(f), multiSampled(ms) {}
534  GfVec3i dims;
535  HdFormat format;
536  bool multiSampled;
537  };
538 
539  std::map<SdfPath, _Mesh> _meshes;
540  std::map<SdfPath, _Curves> _curves;
541  std::map<SdfPath, _Points> _points;
542  std::map<SdfPath, _Instancer> _instancers;
543  std::map<SdfPath, _Primvars> _primvars;
544  std::map<SdfPath, VtValue> _materials;
545  std::map<SdfPath, _Camera> _cameras;
546  std::map<SdfPath, _RenderBuffer> _renderBuffers;
547  std::map<SdfPath, _Light> _lights;
548  std::map<SdfPath, _Task> _tasks;
549  TfHashSet<SdfPath, SdfPath::Hash> _hiddenRprims;
550 
551  typedef std::map<SdfPath, SdfPath> SdfPathMap;
552  SdfPathMap _materialBindings;
553  SdfPathMap _instancerBindings;
554 
555  bool _hasInstancePrimvars;
556  int _refineLevel;
557  bool _visibility;
558  std::map<SdfPath, int> _refineLevels;
559  std::map<SdfPath, bool> _visibilities;
560 };
561 
562 
563 PXR_NAMESPACE_CLOSE_SCOPE
564 
565 #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:41
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:118
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.
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:288
virtual HD_API HdReprSelector GetReprSelector(SdfPath const &id) override
Returns the authored repr (if any) for the given prim.
HD_API void AddRenderBuffer(SdfPath const &id, GfVec3i const &dims, HdFormat format, bool multiSampled)
Render buffers.
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:528
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:168
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.