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