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