HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
unitTestDelegate.h
Go to the documentation of this file.
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"
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"
39 #include "pxr/base/gf/matrix4f.h"
40 #include "pxr/base/gf/matrix4d.h"
41 #include "pxr/base/vt/array.h"
42 #include "pxr/base/vt/dictionary.h"
44 
46 
47 
48 /// \class HdUnitTestDelegate
49 ///
50 /// A simple delegate class for unit test driver.
51 ///
53 {
54 public:
55  HD_API
56  HdUnitTestDelegate(HdRenderIndex *parentIndex,
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 
125  /// Add a cube
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 
131  /// Add a grid with division x*y
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 
137  /// Add a grid with division x*y
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 
144  /// Add a grid with division x*y
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 
151  /// Add a grid with division x*y
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 
167  /// Add a triangle, quad and pentagon.
168  HD_API
169  void AddPolygons(SdfPath const &id, GfMatrix4f const &transform,
170  HdInterpolation colorInterp,
171  SdfPath const &instancerId=SdfPath());
172 
173  /// Add a triangle, quad and pentagon with face-varying displayColor and
174  /// displayOpacity
175  HD_API
177  SdfPath const &id, GfMatrix4f const &transform,
178  SdfPath const &instancerId=SdfPath());
179 
180  /// Add a subdiv with various tags
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 
203  /// Add a basis curves prim containing two curves
204  HD_API
205  void AddCurves(SdfPath const &id, TfToken const &type, TfToken const &basis,
206  GfMatrix4f const &transform,
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 
226  /// Add a points prim
227  HD_API
228  void AddPoints(SdfPath const &id,
229  GfMatrix4f const &transform,
232  SdfPath const &instancerId=SdfPath());
233 
234  /// Instancer
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 
250  /// Primvars
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 
268  /// Transform
269  HD_API
270  void UpdateTransform(SdfPath const& id, GfMatrix4f const& mat);
271 
272  /// Material
273  HD_API
274  void AddMaterialResource(SdfPath const &id,
275  VtValue materialResource);
276 
277  /// Update a material resource
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 
285  /// Example to update a material binding on the fly
286  HD_API
287  void RebindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
288 
289  /// Render buffers
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 
297  /// Camera
298  HD_API
299  void AddCamera(SdfPath const &id);
300  HD_API
301  void UpdateCamera(SdfPath const &id, TfToken const &key, VtValue value);
302 
303  /// Tasks
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 
312  /// Remove a prim
313  HD_API
314  void Remove(SdfPath const &id);
315 
316  /// Clear all prims
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 
340  /// Marks an rprim in the RenderIndex as dirty with the given dirty flags.
341  HD_API
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
354 
355  // ---------------------------------------------------------------------- //
356  // utility functions generating test case
357  // ---------------------------------------------------------------------- //
358  HD_API
360  HD_API
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
398  GetPrimvarDescriptors(SdfPath const& id,
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 
430 private:
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;
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 {
540  };
541  struct _Light {
543  };
544  struct _Task {
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;
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 
581 
582 #endif // PXR_IMAGING_HD_UNIT_TEST_DELEGATE_H
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.
virtual HD_API HdCullStyle GetCullStyle(SdfPath const &id) override
Returns the cullstyle for the given prim.
void InsertTask(HdSceneDelegate *delegate, SdfPath const &id)
Inserts a new task into the render index with an identifier of id.
Definition: renderIndex.h:594
HdFormat
Definition: types.h:423
GLsizei GLenum const void * indices
Definition: glcorearb.h:406
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.
HdCullStyle
Definition: enums.h:122
HD_API void UpdateCurvePrimvarsInterpMode(float time)
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
HD_API void AddMaterialResource(SdfPath const &id, VtValue materialResource)
Material.
HD_API void AddMesh(SdfPath const &id)
virtual HD_API VtValue GetIndexedPrimvar(SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override
HD_API void UpdateRenderBuffer(SdfPath const &id, HdRenderBufferDescriptor const &desc)
HD_API void SetReprSelector(SdfPath const &id, HdReprSelector const &reprSelector)
HD_API void UpdateTask(SdfPath const &id, TfToken const &key, VtValue value)
GT_API const UT_StringHolder time
virtual HD_API bool GetDoubleSided(SdfPath const &id) override
Returns the doubleSided state for the given prim.
const GLdouble * v
Definition: glcorearb.h:837
HD_API void RemovePrimvar(SdfPath const &id, TfToken const &name)
virtual HD_API VtValue Get(SdfPath const &id, TfToken const &key) override
Returns a named value.
uint32_t HdDirtyBits
Definition: types.h:158
GLsizei const GLfloat * value
Definition: glcorearb.h:824
HD_API void UpdateCamera(SdfPath const &id, TfToken const &key, VtValue value)
HD_API void AddPolygons(SdfPath const &id, GfMatrix4f const &transform, HdInterpolation colorInterp, SdfPath const &instancerId=SdfPath())
Add a triangle, quad and pentagon.
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
HD_API void SetCurveWrapMode(SdfPath const &id, TfToken const &wrap)
GLint level
Definition: glcorearb.h:108
Definition: vec3f.h:62
HD_API void AddSubdiv(SdfPath const &id, GfMatrix4f const &transform, SdfPath const &insatancerId=SdfPath())
Add a subdiv with various tags.
void AddTask(SdfPath const &id)
Tasks.
#define HD_API
Definition: api.h:40
HD_API void UnhideRprim(SdfPath const &id)
HD_API void AddInstancer(SdfPath const &id, SdfPath const &parentId=SdfPath(), GfMatrix4f const &rootTransform=GfMatrix4f(1))
Instancer.
GLint y
Definition: glcorearb.h:103
virtual HD_API bool GetVisible(SdfPath const &id) override
Returns the authored visible state of the prim.
HD_API void AddBasisCurves(SdfPath const &id, VtVec3fArray const &points, VtIntArray const &curveVertexCounts, VtIntArray const &curveIndices, VtVec3fArray const &normals, TfToken const &type, TfToken const &basis, VtValue const &color, HdInterpolation colorInterpolation, VtValue const &opacity, HdInterpolation opacityInterpolation, VtValue const &width, HdInterpolation widthInterpolation, SdfPath const &instancerId=SdfPath())
virtual HD_API VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId) override
GLenum const GLfloat * params
Definition: glcorearb.h:105
virtual HD_API GfRange3d GetExtent(SdfPath const &id) override
virtual HD_API VtValue GetMaterialResource(SdfPath const &materialId) override
Returns the material ID bound to the rprim rprimId.
virtual HD_API HdMeshTopology GetMeshTopology(SdfPath const &id) override
Gets the topological mesh data for a given prim.
GA_API const UT_StringHolder scale
HD_API void HideRprim(SdfPath const &id)
virtual HD_API HdDisplayStyle GetDisplayStyle(SdfPath const &id) override
virtual HD_API SdfPath GetMaterialId(SdfPath const &rprimId) override
Returns the material ID bound to the rprim rprimId.
GLfloat f
Definition: glcorearb.h:1926
Definition: token.h:87
virtual HD_API PxOsdSubdivTags GetSubdivTags(SdfPath const &id) override
Gets the subdivision surface tags (sharpness, holes, etc).
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 Clear()
Clear all prims.
HD_API void BindMaterial(SdfPath const &rprimId, SdfPath const &materialId)
HD_API void AddCamera(SdfPath const &id)
Camera.
HD_API void RebindMaterial(SdfPath const &rprimId, SdfPath const &materialId)
Example to update a material binding on the fly.
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.
void SetUseInstancePrimvars(bool v)
HD_API void AddPoints(SdfPath const &id, VtVec3fArray const &points, VtValue const &color, HdInterpolation colorInterpolation, VtValue const &opacity, HdInterpolation opacityInterpolation, VtValue const &width, HdInterpolation widthInterpolation, SdfPath const &instancerId=SdfPath())
virtual HD_API TfToken GetRenderTag(SdfPath const &id) override
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
HD_API void UpdateInstancer(SdfPath const &rprimId, SdfPath const &instancerId)
GLuint id
Definition: glcorearb.h:655
virtual HD_API HdPrimvarDescriptorVector GetPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolation) override
Returns descriptors for all primvars of the given interpolation type.
HD_API void AddGrid(SdfPath const &id, int x, int y, GfMatrix4f const &transform, bool rightHanded=true, bool doubleSided=false, SdfPath const &instancerId=SdfPath())
Add a grid with division x*y.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
Definition: vec3i.h:60
HD_API void MarkRprimDirty(SdfPath path, HdDirtyBits flag)
Marks an rprim in the RenderIndex as dirty with the given dirty flags.
GLuint const GLchar * name
Definition: glcorearb.h:786
HD_API void UpdatePrimvarValue(SdfPath const &id, TfToken const &name, VtValue const &value, VtIntArray const &indices=VtIntArray(0))
HD_API void AddFaceVaryingPolygons(SdfPath const &id, GfMatrix4f const &transform, SdfPath const &instancerId=SdfPath())
Definition: path.h:290
GA_API const UT_StringHolder transform
GLint GLenum GLint x
Definition: glcorearb.h:409
ImageBuf OIIO_API rotate(const ImageBuf &src, float angle, string_view filtername=string_view(), float filterwidth=0.0f, bool recompute_roi=false, ROI roi={}, int nthreads=0)
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:211
HD_API HdUnitTestDelegate(HdRenderIndex *parentIndex, SdfPath const &delegateID)
HD_API void SetVisibility(bool vis)
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 Remove(SdfPath const &id)
Remove a prim.
HD_API void UpdateRprims(float time)
virtual HD_API SdfPathVector GetInstancerPrototypes(SdfPath const &instancerId) override
virtual HD_API VtValue GetCameraParamValue(SdfPath const &cameraId, TfToken const &paramName) override
HD_API void SetRefineLevel(int level)
HD_API void SetInstancerProperties(SdfPath const &id, VtIntArray const &prototypeIndex, VtVec3fArray const &scale, VtVec4fArray const &rotate, VtVec3fArray const &translate)
HD_API void UpdateMaterialResource(SdfPath const &materialId, VtValue materialResource)
Update a material resource.
HD_API GfVec3f PopulateBasicTestSet()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
virtual HD_API HdRenderBufferDescriptor GetRenderBufferDescriptor(SdfPath const &id) override
Returns the allocation descriptor for a given render buffer prim.
GLuint color
Definition: glcorearb.h:1261
virtual HD_API HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id) override
Gets the topological curve data for a given prim.
HD_API void UpdateInstancerPrototypes(float time)
virtual HD_API HdReprSelector GetReprSelector(SdfPath const &id) override
Returns the authored repr (if any) for the given prim.
virtual HD_API TfTokenVector GetTaskRenderTags(SdfPath const &taskId) override
HdInterpolation
Definition: enums.h:194
HD_API void UpdateTransform(SdfPath const &id, GfMatrix4f const &mat)
Transform.
GLbyte ny
Definition: glad.h:2247
virtual HD_API GfMatrix4d GetInstancerTransform(SdfPath const &instancerId) override
Returns the instancer transform.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
GLint GLsizei width
Definition: glcorearb.h:103
HD_API void UpdatePositions(SdfPath const &id, float time)
Definition: core.h:1131
HD_API void AddGridWithCustomColor(SdfPath const &id, int nx, int ny, GfMatrix4f const &transform, VtValue const &color, HdInterpolation colorInterpolation, bool rightHanded=true, bool doubleSided=false, SdfPath const &instancerId=SdfPath())
PUGI__FN char_t * translate(char_t *buffer, const char_t *from, const char_t *to, size_t to_length)
Definition: pugixml.cpp:8352
std::vector< HdPrimvarDescriptor > HdPrimvarDescriptorVector
HD_API void UpdateInstancerPrimvars(float time)
type
Definition: core.h:1059
Definition: value.h:164
HD_API void SetMeshCullStyle(SdfPath const &id, HdCullStyle const &cullstyle)
virtual HD_API SdfPath GetInstancerId(SdfPath const &primId) override
Returns the parent instancer of the given rprim or instancer.
HD_API GfVec3f PopulateInvalidPrimsSet()
HD_API void AddRenderBuffer(SdfPath const &id, HdRenderBufferDescriptor const &desc)
Render buffers.
virtual HD_API GfMatrix4d GetTransform(SdfPath const &id) override
Returns the object space transform, including all parent transforms.
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.