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