All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 HD_UNIT_TEST_DELEGATE
25 #define HD_UNIT_TEST_DELEGATE
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"
32 #include "pxr/imaging/pxOsd/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"
42 #include "pxr/base/tf/staticTokens.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->catmark,
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->catmark,
97  TfToken const &orientation=HdTokens->rightHanded,
98  bool doubleSided=false);
99 
101  HD_API
102  void AddCube(SdfPath const &id, GfMatrix4f const &transform, bool guide=false,
103  SdfPath const &instancerId=SdfPath(),
104  TfToken const &scheme=PxOsdOpenSubdivTokens->catmark);
105 
107  HD_API
108  void AddGrid(SdfPath const &id, int x, int y, GfMatrix4f const &transform,
109  bool rightHanded=true, bool doubleSided=false,
110  SdfPath const &instancerId=SdfPath());
111 
113  HD_API
114  void AddGridWithFaceColor(SdfPath const &id, int x, int y,
115  GfMatrix4f const &transform,
116  bool rightHanded=true, bool doubleSided=false,
117  SdfPath const &instancerId=SdfPath());
118 
120  HD_API
121  void AddGridWithVertexColor(SdfPath const &id, int x, int y,
122  GfMatrix4f const &transform,
123  bool rightHanded=true, bool doubleSided=false,
124  SdfPath const &instancerId=SdfPath());
125 
127  HD_API
128  void AddGridWithFaceVaryingColor(SdfPath const &id, int x, int y,
129  GfMatrix4f const &transform,
130  bool rightHanded=true, bool doubleSided=false,
131  SdfPath const &instancerId=SdfPath());
132 
133  // Add a grid with division x*y and a custom color
134  HD_API
135  void AddGridWithCustomColor(SdfPath const &id, int nx, int ny,
136  GfMatrix4f const &transform,
137  VtValue const &color,
138  HdInterpolation colorInterpolation,
139  bool rightHanded=true, bool doubleSided=false,
140  SdfPath const &instancerId=SdfPath());
141 
143  HD_API
144  void AddPolygons(SdfPath const &id, GfMatrix4f const &transform,
145  HdInterpolation colorInterp,
146  SdfPath const &instancerId=SdfPath());
147 
149  HD_API
150  void AddSubdiv(SdfPath const &id, GfMatrix4f const &transform,
151  SdfPath const &insatancerId=SdfPath());
152 
153  // -----------------------------------------------------------------------
154 
155  HD_API
156  void AddBasisCurves(SdfPath const &id,
157  VtVec3fArray const &points,
158  VtIntArray const &curveVertexCounts,
159  VtVec3fArray const &normals,
160  TfToken const &type,
161  TfToken const &basis,
162  VtValue const &color,
163  HdInterpolation colorInterpolation,
164  VtValue const &opacity,
165  HdInterpolation opacityInterpolation,
166  VtValue const &width,
167  HdInterpolation widthInterpolation,
168  SdfPath const &instancerId=SdfPath());
169 
171  HD_API
172  void AddCurves(SdfPath const &id, TfToken const &type, TfToken const &basis,
173  GfMatrix4f const &transform,
174  HdInterpolation colorInterp=HdInterpolationConstant,
175  HdInterpolation widthInterp=HdInterpolationConstant,
176  bool authoredNormals=false,
177  SdfPath const &instancerId=SdfPath());
178 
179  HD_API
180  void AddPoints(SdfPath const &id,
181  VtVec3fArray const &points,
182  VtValue const &color,
183  HdInterpolation colorInterpolation,
184  VtValue const &opacity,
185  HdInterpolation opacityInterpolation,
186  VtValue const &width,
187  HdInterpolation widthInterpolation,
188  SdfPath const &instancerId=SdfPath());
189 
191  HD_API
192  void AddPoints(SdfPath const &id,
193  GfMatrix4f const &transform,
194  HdInterpolation colorInterp=HdInterpolationConstant,
195  HdInterpolation widthInterp=HdInterpolationConstant,
196  SdfPath const &instancerId=SdfPath());
197 
199  HD_API
200  void AddInstancer(SdfPath const &id,
201  SdfPath const &parentId=SdfPath(),
202  GfMatrix4f const &rootTransform=GfMatrix4f(1));
203 
204  HD_API
205  void SetInstancerProperties(SdfPath const &id,
206  VtIntArray const &prototypeIndex,
207  VtVec3fArray const &scale,
208  VtVec4fArray const &rotate,
209  VtVec3fArray const &translate);
210 
213  HD_API
214  void AddMaterialHydra(SdfPath const &id,
215  std::string const &sourceSurface,
216  std::string const &sourceDisplacement,
217  HdMaterialParamVector const &params);
218 
219  HD_API
220  void UpdateMaterialHydra(SdfPath const &id,
221  std::string const &sourceSurface,
222  std::string const &sourceDisplacement,
223  HdMaterialParamVector const &params);
224 
226  HD_API
227  void AddMaterialResource(SdfPath const &id,
228  VtValue materialResource);
229 
231  HD_API
232  void UpdateMaterialResource(SdfPath const &materialId,
233  VtValue materialResource);
234 
235  HD_API
236  void BindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
237 
239  HD_API
240  void RebindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
241 
243  HD_API
244  void AddRenderBuffer(SdfPath const &id, GfVec3i const& dims,
245  HdFormat format, bool multiSampled);
246 
248  HD_API
249  void AddCamera(SdfPath const &id);
250  HD_API
251  void UpdateCamera(SdfPath const &id, TfToken const &key, VtValue value);
252 
254  template<typename T>
255  void AddTask(SdfPath const &id) {
256  GetRenderIndex().InsertTask<T>(this, id);
257  _tasks[id] = _Task();
258  }
259  HD_API
260  void UpdateTask(SdfPath const &id, TfToken const &key, VtValue value);
261 
263  HD_API
264  void Remove(SdfPath const &id);
265 
267  HD_API
268  void Clear();
269 
270  // Hides an rprim, invalidating all collections it was in.
271  HD_API
272  void HideRprim(SdfPath const &id);
273 
274  // Un-hides an rprim, invalidating all collections it was in.
275  HD_API
276  void UnhideRprim(SdfPath const &id);
277 
278  // set per-prim repr
279  HD_API
280  void SetReprSelector(SdfPath const &id, HdReprSelector const &reprSelector);
281 
282  // set per-prim refine level
283  HD_API
284  void SetRefineLevel(SdfPath const &id, int refineLevel);
285 
286  // set per-prim visibility
287  HD_API
288  void SetVisibility(SdfPath const &id, bool vis);
289 
291  HD_API
292  void MarkRprimDirty(SdfPath path, HdDirtyBits flag);
293 
294  HD_API
295  void UpdatePositions(SdfPath const &id, float time);
296  HD_API
297  void UpdateRprims(float time);
298  HD_API
299  void UpdateInstancerPrimvars(float time);
300  HD_API
301  void UpdateInstancerPrototypes(float time);
302  HD_API
303  void UpdateCurvePrimvarsInterpMode(float time);
304 
305  // ---------------------------------------------------------------------- //
306  // utility functions generating test case
307  // ---------------------------------------------------------------------- //
308  HD_API
309  GfVec3f PopulateBasicTestSet();
310  HD_API
311  GfVec3f PopulateInvalidPrimsSet();
312 
313  // ---------------------------------------------------------------------- //
314  // See HdSceneDelegate for documentation of virtual methods.
315  // ---------------------------------------------------------------------- //
316  HD_API
317  virtual HdMeshTopology GetMeshTopology(SdfPath const& id) override;
318  HD_API
320  override;
321  HD_API
322  virtual TfToken GetRenderTag(SdfPath const& id) override;
323  HD_API
324  virtual PxOsdSubdivTags GetSubdivTags(SdfPath const& id) override;
325  HD_API
326  virtual GfRange3d GetExtent(SdfPath const & id) override;
327  HD_API
328  virtual GfMatrix4d GetTransform(SdfPath const & id) override;
329  HD_API
330  virtual bool GetVisible(SdfPath const & id) override;
331  HD_API
332  virtual bool GetDoubleSided(SdfPath const & id) override;
333  HD_API
334  virtual HdDisplayStyle GetDisplayStyle(SdfPath const & id) override;
335  HD_API
336  virtual VtValue Get(SdfPath const& id, TfToken const& key) override;
337  HD_API
338  virtual HdReprSelector GetReprSelector(SdfPath const &id) override;
339  HD_API
340  virtual HdPrimvarDescriptorVector
341  GetPrimvarDescriptors(SdfPath const& id,
342  HdInterpolation interpolation) override;
343 
344  HD_API
345  virtual VtIntArray GetInstanceIndices(SdfPath const& instancerId,
346  SdfPath const& prototypeId) override;
347 
348  HD_API
349  virtual GfMatrix4d GetInstancerTransform(SdfPath const& instancerId)
350  override;
351 
352  HD_API
353  virtual SdfPath GetMaterialId(SdfPath const& rprimId) override;
354  HD_API
355  virtual std::string GetSurfaceShaderSource(SdfPath const &materialId)
356  override;
357  HD_API
358  virtual std::string GetDisplacementShaderSource(SdfPath const &materialId)
359  override;
360  HD_API
361  virtual HdMaterialParamVector GetMaterialParams(SdfPath const &materialId)
362  override;
363  HD_API
364  virtual VtValue GetMaterialParamValue(SdfPath const &materialId,
365  TfToken const &paramName) override;
366  HD_API
367  virtual VtValue GetCameraParamValue(SdfPath const &cameraId,
368  TfToken const &paramName) override;
369  HD_API
370  virtual HdTextureResource::ID GetTextureResourceID(
371  SdfPath const& textureId) override;
372  HD_API
373  virtual HdTextureResourceSharedPtr GetTextureResource(
374  SdfPath const& textureId) override;
375  HD_API
376  virtual VtValue GetMaterialResource(SdfPath const &materialId) override;
377  HD_API
379  SdfPath const& id) override;
380 
381 private:
382  struct _Mesh {
383  _Mesh() { }
384  _Mesh(TfToken const &scheme,
385  TfToken const &orientation,
386  GfMatrix4f const &transform,
387  VtVec3fArray const &points,
388  VtIntArray const &numVerts,
389  VtIntArray const &verts,
390  VtIntArray const &holes,
391  PxOsdSubdivTags const &subdivTags,
392  VtValue const &color,
393  HdInterpolation colorInterpolation,
394  VtValue const &opacity,
395  HdInterpolation opacityInterpolation,
396  bool guide,
397  bool doubleSided) :
398  scheme(scheme), orientation(orientation),
399  transform(transform),
400  points(points), numVerts(numVerts), verts(verts),
401  holes(holes), subdivTags(subdivTags), color(color),
402  colorInterpolation(colorInterpolation), opacity(opacity),
403  opacityInterpolation(opacityInterpolation), guide(guide),
404  doubleSided(doubleSided) { }
405 
406  TfToken scheme;
407  TfToken orientation;
408  GfMatrix4f transform;
409  VtVec3fArray points;
410  VtIntArray numVerts;
411  VtIntArray verts;
412  VtIntArray holes;
413  PxOsdSubdivTags subdivTags;
414  VtValue color;
415  HdInterpolation colorInterpolation;
416  VtValue opacity;
417  HdInterpolation opacityInterpolation;
418  bool guide;
419  bool doubleSided;
420  HdReprSelector reprSelector;
421  };
422  struct _Curves {
423  _Curves() { }
424  _Curves(VtVec3fArray const &points,
425  VtIntArray const &curveVertexCounts,
426  VtVec3fArray const &normals,
427  TfToken const &type,
428  TfToken const &basis,
429  VtValue const &color,
430  HdInterpolation colorInterpolation,
431  VtValue const &opacity,
432  HdInterpolation opacityInterpolation,
433  VtValue const &width,
434  HdInterpolation widthInterpolation) :
435  points(points), curveVertexCounts(curveVertexCounts),
436  normals(normals),
437  type(type),
438  basis(basis),
439  color(color), colorInterpolation(colorInterpolation),
440  opacity(opacity), opacityInterpolation(opacityInterpolation),
441  width(width), widthInterpolation(widthInterpolation) { }
442 
443  VtVec3fArray points;
444  VtIntArray curveVertexCounts;
445  VtVec3fArray normals;
446  TfToken type;
447  TfToken basis;
448  VtValue color;
449  HdInterpolation colorInterpolation;
450  VtValue opacity;
451  HdInterpolation opacityInterpolation;
452  VtValue width;
453  HdInterpolation widthInterpolation;
454  };
455  struct _Points {
456  _Points() { }
457  _Points(VtVec3fArray const &points,
458  VtValue const &color,
459  HdInterpolation colorInterpolation,
460  VtValue const &opacity,
461  HdInterpolation opacityInterpolation,
462  VtValue const &width,
463  HdInterpolation widthInterpolation) :
464  points(points),
465  color(color), colorInterpolation(colorInterpolation),
466  opacity(opacity), opacityInterpolation(opacityInterpolation),
467  width(width), widthInterpolation(widthInterpolation) { }
468 
469  VtVec3fArray points;
470  VtValue color;
471  HdInterpolation colorInterpolation;
472  VtValue opacity;
473  HdInterpolation opacityInterpolation;
474  VtValue width;
475  HdInterpolation widthInterpolation;
476  };
477  struct _Instancer {
478  _Instancer() { }
479  _Instancer(VtVec3fArray const &scale,
480  VtVec4fArray const &rotate,
481  VtVec3fArray const &translate,
482  GfMatrix4f const &rootTransform) :
483  scale(scale), rotate(rotate), translate(translate),
484  rootTransform(rootTransform) {
485  }
486  VtVec3fArray scale;
487  VtVec4fArray rotate;
488  VtVec3fArray translate;
489  VtIntArray prototypeIndices;
490  GfMatrix4f rootTransform;
491 
492  std::vector<SdfPath> prototypes;
493  };
494  struct _MaterialHydra {
495  _MaterialHydra() { }
496  _MaterialHydra(std::string const &srcSurface,
497  std::string const &srcDisplacement,
498  HdMaterialParamVector const &pms)
499  : sourceSurface(srcSurface)
500  , sourceDisplacement(srcDisplacement)
501  , params(pms) {
502  }
503 
504  std::string sourceSurface;
505  std::string sourceDisplacement;
506  HdMaterialParamVector params;
507  };
508  struct _Camera {
509  VtDictionary params;
510  };
511  struct _Light {
512  VtDictionary params;
513  };
514  struct _Task {
515  VtDictionary params;
516  };
517  struct _RenderBuffer {
518  _RenderBuffer() {}
519  _RenderBuffer(GfVec3i const &d, HdFormat f, bool ms)
520  : dims(d), format(f), multiSampled(ms) {}
521  GfVec3i dims;
522  HdFormat format;
523  bool multiSampled;
524  };
525 
526  std::map<SdfPath, _Mesh> _meshes;
527  std::map<SdfPath, _Curves> _curves;
528  std::map<SdfPath, _Points> _points;
529  std::map<SdfPath, _Instancer> _instancers;
530  std::map<SdfPath, _MaterialHydra> _materialsHydra;
531  std::map<SdfPath, VtValue> _materials;
532  std::map<SdfPath, _Camera> _cameras;
533  std::map<SdfPath, _RenderBuffer> _renderBuffers;
534  std::map<SdfPath, _Light> _lights;
535  std::map<SdfPath, _Task> _tasks;
536  TfHashSet<SdfPath, SdfPath::Hash> _hiddenRprims;
537 
538  typedef std::map<SdfPath, SdfPath> SdfPathMap;
539  SdfPathMap _materialBindings;
540 
541  bool _hasInstancePrimvars;
542  int _refineLevel;
543  bool _visibility;
544  std::map<SdfPath, int> _refineLevels;
545  std::map<SdfPath, bool> _visibilities;
546 };
547 
548 
549 PXR_NAMESPACE_CLOSE_SCOPE
550 
551 #endif // HD_UNIT_TEST_DELEGATE
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.
virtual HD_API HdTextureResourceSharedPtr GetTextureResource(SdfPath const &textureId) override
Returns the texture resource for a given texture ID.
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:119
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:79
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:61
Describes the allocation structure of a render buffer bprim.
Definition: aov.h:84
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.
virtual HD_API VtValue GetMaterialParamValue(SdfPath const &materialId, TfToken const &paramName) override
Returns a single value for the given material and named parameter.
virtual HD_API HdMaterialParamVector GetMaterialParams(SdfPath const &materialId) override
Returns the material params for the given material ID.
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 HdTextureResource::ID GetTextureResourceID(SdfPath const &textureId) override
Returns the texture resource ID for a given texture ID.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
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.
virtual HD_API std::string GetSurfaceShaderSource(SdfPath const &materialId) override
Returns the surface shader source code for the given material ID.
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.
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:287
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].
HD_API void AddCube(SdfPath const &id, GfMatrix4f const &transform, bool guide=false, SdfPath const &instancerId=SdfPath(), TfToken const &scheme=PxOsdOpenSubdivTokens->catmark)
Add a cube.
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.
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.
void InsertTask(HdSceneDelegate *delegate, SdfPath const &id)
Inserts a new task into the render index with an identifier of id.
Definition: renderIndex.h:493
Topology data for meshes.
Definition: meshTopology.h:55
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
A simple delegate class for unit test driver.
virtual HD_API std::string GetDisplacementShaderSource(SdfPath const &materialId) override
Returns the displacement shader source code for the given material ID.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
HD_API void AddMaterialHydra(SdfPath const &id, std::string const &sourceSurface, std::string const &sourceDisplacement, HdMaterialParamVector const &params)
XXX : This will be removed as we integrate materials into the new material resource pipeline...
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.