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"
31 #include "pxr/imaging/hd/tokens.h"
33 
34 #include "pxr/base/gf/vec3f.h"
35 #include "pxr/base/gf/vec3d.h"
36 #include "pxr/base/gf/vec4f.h"
37 #include "pxr/base/gf/vec4d.h"
38 #include "pxr/base/gf/matrix4f.h"
39 #include "pxr/base/gf/matrix4d.h"
40 #include "pxr/base/vt/array.h"
41 #include "pxr/base/vt/dictionary.h"
43 
45 
46 
47 /// \class HdUnitTestDelegate
48 ///
49 /// A simple delegate class for unit test driver.
50 ///
52 public:
53  HD_API
54  HdUnitTestDelegate(HdRenderIndex *parentIndex,
55  SdfPath const& delegateID);
56 
57  void SetUseInstancePrimvars(bool v) { _hasInstancePrimvars = v; }
58 
59  HD_API
60  void SetRefineLevel(int level);
61 
62  HD_API
63  void SetVisibility(bool vis);
64 
65  // -----------------------------------------------------------------------
66 
67  HD_API
68  void AddMesh(SdfPath const& id);
69 
70  HD_API
71  void AddMesh(SdfPath const &id,
72  GfMatrix4f const &transform,
73  VtVec3fArray const &points,
74  VtIntArray const &numVerts,
75  VtIntArray const &verts,
76  bool guide=false,
77  SdfPath const &instancerId=SdfPath(),
78  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
79  TfToken const &orientation=HdTokens->rightHanded,
80  bool doubleSided=false);
81 
82  HD_API
83  void AddMesh(SdfPath const &id,
84  GfMatrix4f const &transform,
85  VtVec3fArray const &points,
86  VtIntArray const &numVerts,
87  VtIntArray const &verts,
88  VtIntArray const &holes,
89  PxOsdSubdivTags const &subdivTags,
90  VtValue const &color,
91  HdInterpolation colorInterpolation,
92  VtValue const &opacity,
93  HdInterpolation opacityInterpolation,
94  bool guide=false,
95  SdfPath const &instancerId=SdfPath(),
96  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
97  TfToken const &orientation=HdTokens->rightHanded,
98  bool doubleSided=false);
99 
100  HD_API
101  void AddMesh(SdfPath const &id,
102  GfMatrix4f const &transform,
103  VtVec3fArray const &points,
104  VtIntArray const &numVerts,
105  VtIntArray const &verts,
106  VtIntArray const &holes,
107  PxOsdSubdivTags const &subdivTags,
108  VtValue const &color,
109  VtIntArray const &colorIndices,
110  HdInterpolation colorInterpolation,
111  VtValue const &opacity,
112  VtIntArray const &opacityIndices,
113  HdInterpolation opacityInterpolation,
114  bool guide=false,
115  SdfPath const &instancerId=SdfPath(),
116  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
117  TfToken const &orientation=HdTokens->rightHanded,
118  bool doubleSided=false);
119 
120  /// Add a cube
121  HD_API
122  void AddCube(SdfPath const &id, GfMatrix4f const &transform, bool guide=false,
123  SdfPath const &instancerId=SdfPath(),
124  TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark);
125 
126  /// Add a grid with division x*y
127  HD_API
128  void AddGrid(SdfPath const &id, int x, int y, GfMatrix4f const &transform,
129  bool rightHanded=true, bool doubleSided=false,
130  SdfPath const &instancerId=SdfPath());
131 
132  /// Add a grid with division x*y
133  HD_API
134  void AddGridWithFaceColor(SdfPath const &id, int x, int y,
135  GfMatrix4f const &transform,
136  bool rightHanded=true, bool doubleSided=false,
137  SdfPath const &instancerId=SdfPath());
138 
139  /// Add a grid with division x*y
140  HD_API
141  void AddGridWithVertexColor(SdfPath const &id, int x, int y,
142  GfMatrix4f const &transform,
143  bool rightHanded=true, bool doubleSided=false,
144  SdfPath const &instancerId=SdfPath());
145 
146  /// Add a grid with division x*y
147  HD_API
148  void AddGridWithFaceVaryingColor(SdfPath const &id, int x, int y,
149  GfMatrix4f const &transform,
150  bool rightHanded=true, bool doubleSided=false,
151  SdfPath const &instancerId=SdfPath());
152 
153  // Add a grid with division x*y and a custom color
154  HD_API
155  void AddGridWithCustomColor(SdfPath const &id, int nx, int ny,
156  GfMatrix4f const &transform,
157  VtValue const &color,
158  HdInterpolation colorInterpolation,
159  bool rightHanded=true, bool doubleSided=false,
160  SdfPath const &instancerId=SdfPath());
161 
162  /// Add a triangle, quad and pentagon.
163  HD_API
164  void AddPolygons(SdfPath const &id, GfMatrix4f const &transform,
165  HdInterpolation colorInterp,
166  SdfPath const &instancerId=SdfPath());
167 
168  /// Add a triangle, quad and pentagon with face-varying displayColor and
169  /// displayOpacity
170  HD_API
172  SdfPath const &id, GfMatrix4f const &transform,
173  SdfPath const &instancerId=SdfPath());
174 
175  /// Add a subdiv with various tags
176  HD_API
177  void AddSubdiv(SdfPath const &id, GfMatrix4f const &transform,
178  SdfPath const &insatancerId=SdfPath());
179 
180  // -----------------------------------------------------------------------
181 
182  HD_API
183  void AddBasisCurves(SdfPath const &id,
184  VtVec3fArray const &points,
185  VtIntArray const &curveVertexCounts,
186  VtVec3fArray const &normals,
187  TfToken const &type,
188  TfToken const &basis,
189  VtValue const &color,
190  HdInterpolation colorInterpolation,
191  VtValue const &opacity,
192  HdInterpolation opacityInterpolation,
193  VtValue const &width,
194  HdInterpolation widthInterpolation,
195  SdfPath const &instancerId=SdfPath());
196 
197  /// Add a basis curves prim containing two curves
198  HD_API
199  void AddCurves(SdfPath const &id, TfToken const &type, TfToken const &basis,
200  GfMatrix4f const &transform,
203  bool authoredNormals=false,
204  SdfPath const &instancerId=SdfPath());
205 
206  HD_API
207  void AddPoints(SdfPath const &id,
208  VtVec3fArray const &points,
209  VtValue const &color,
210  HdInterpolation colorInterpolation,
211  VtValue const &opacity,
212  HdInterpolation opacityInterpolation,
213  VtValue const &width,
214  HdInterpolation widthInterpolation,
215  SdfPath const &instancerId=SdfPath());
216 
217  /// Add a points prim
218  HD_API
219  void AddPoints(SdfPath const &id,
220  GfMatrix4f const &transform,
223  SdfPath const &instancerId=SdfPath());
224 
225  /// Instancer
226  HD_API
227  void AddInstancer(SdfPath const &id,
228  SdfPath const &parentId=SdfPath(),
229  GfMatrix4f const &rootTransform=GfMatrix4f(1));
230 
231  HD_API
232  void SetInstancerProperties(SdfPath const &id,
233  VtIntArray const &prototypeIndex,
234  VtVec3fArray const &scale,
235  VtVec4fArray const &rotate,
236  VtVec3fArray const &translate);
237 
238  HD_API
239  void UpdateInstancer(SdfPath const& rprimId, SdfPath const& instancerId);
240 
241  /// Primvars
242  HD_API
243  void AddPrimvar(SdfPath const& id,
244  TfToken const& name,
245  VtValue const& value,
246  HdInterpolation const& interp,
247  TfToken const& role,
248  VtIntArray const& indices=VtIntArray(0));
249 
250  HD_API
251  void UpdatePrimvarValue(SdfPath const& id,
252  TfToken const& name,
253  VtValue const& value,
254  VtIntArray const& indices=VtIntArray(0));
255 
256  HD_API
257  void RemovePrimvar(SdfPath const& id, TfToken const& name);
258 
259  /// Transform
260  HD_API
261  void UpdateTransform(SdfPath const& id, GfMatrix4f const& mat);
262 
263  /// Material
264  HD_API
265  void AddMaterialResource(SdfPath const &id,
266  VtValue materialResource);
267 
268  /// Update a material resource
269  HD_API
270  void UpdateMaterialResource(SdfPath const &materialId,
271  VtValue materialResource);
272 
273  HD_API
274  void BindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
275 
276  /// Example to update a material binding on the fly
277  HD_API
278  void RebindMaterial(SdfPath const &rprimId, SdfPath const &materialId);
279 
280  /// Render buffers
281  HD_API
282  void AddRenderBuffer(SdfPath const &id, GfVec3i const& dims,
283  HdFormat format, bool multiSampled);
284 
285  /// Camera
286  HD_API
287  void AddCamera(SdfPath const &id);
288  HD_API
289  void UpdateCamera(SdfPath const &id, TfToken const &key, VtValue value);
290 
291  /// Tasks
292  template<typename T>
293  void AddTask(SdfPath const &id) {
294  GetRenderIndex().InsertTask<T>(this, id);
295  _tasks[id] = _Task();
296  }
297  HD_API
298  void UpdateTask(SdfPath const &id, TfToken const &key, VtValue value);
299 
300  /// Remove a prim
301  HD_API
302  void Remove(SdfPath const &id);
303 
304  /// Clear all prims
305  HD_API
306  void Clear();
307 
308  // Hides an rprim, invalidating all collections it was in.
309  HD_API
310  void HideRprim(SdfPath const &id);
311 
312  // Un-hides an rprim, invalidating all collections it was in.
313  HD_API
314  void UnhideRprim(SdfPath const &id);
315 
316  // set per-prim repr
317  HD_API
318  void SetReprSelector(SdfPath const &id, HdReprSelector const &reprSelector);
319 
320  // set per-prim refine level
321  HD_API
322  void SetRefineLevel(SdfPath const &id, int refineLevel);
323 
324  // set per-prim visibility
325  HD_API
326  void SetVisibility(SdfPath const &id, bool vis);
327 
328  /// Marks an rprim in the RenderIndex as dirty with the given dirty flags.
329  HD_API
331 
332  HD_API
333  void UpdatePositions(SdfPath const &id, float time);
334  HD_API
335  void UpdateRprims(float time);
336  HD_API
337  void UpdateInstancerPrimvars(float time);
338  HD_API
339  void UpdateInstancerPrototypes(float time);
340  HD_API
342 
343  // ---------------------------------------------------------------------- //
344  // utility functions generating test case
345  // ---------------------------------------------------------------------- //
346  HD_API
348  HD_API
350 
351  // ---------------------------------------------------------------------- //
352  // See HdSceneDelegate for documentation of virtual methods.
353  // ---------------------------------------------------------------------- //
354  HD_API
355  virtual HdMeshTopology GetMeshTopology(SdfPath const& id) override;
356  HD_API
358  override;
359  HD_API
360  virtual TfToken GetRenderTag(SdfPath const& id) override;
361  HD_API
362  virtual PxOsdSubdivTags GetSubdivTags(SdfPath const& id) override;
363  HD_API
364  virtual GfRange3d GetExtent(SdfPath const & id) override;
365  HD_API
366  virtual GfMatrix4d GetTransform(SdfPath const & id) override;
367  HD_API
368  virtual bool GetVisible(SdfPath const & id) override;
369  HD_API
370  virtual bool GetDoubleSided(SdfPath const & id) override;
371  HD_API
372  virtual HdDisplayStyle GetDisplayStyle(SdfPath const & id) override;
373  HD_API
374  virtual VtValue Get(SdfPath const& id, TfToken const& key) override;
375  HD_API
376  virtual VtValue GetIndexedPrimvar(SdfPath const& id, TfToken const& key,
377  VtIntArray *outIndices) override;
378  HD_API
379  virtual HdReprSelector GetReprSelector(SdfPath const &id) override;
380  HD_API
382  GetPrimvarDescriptors(SdfPath const& id,
383  HdInterpolation interpolation) override;
384 
385  HD_API
386  virtual VtIntArray GetInstanceIndices(SdfPath const& instancerId,
387  SdfPath const& prototypeId) override;
388 
389  HD_API
390  virtual GfMatrix4d GetInstancerTransform(SdfPath const& instancerId)
391  override;
392 
393  HD_API
394  virtual SdfPath GetMaterialId(SdfPath const& rprimId) override;
395 
396  HD_API
397  virtual SdfPath GetInstancerId(SdfPath const& primId) override;
398 
399  HD_API
400  virtual VtValue GetMaterialResource(SdfPath const &materialId) override;
401 
402  HD_API
403  virtual VtValue GetCameraParamValue(SdfPath const &cameraId,
404  TfToken const &paramName) override;
405 
406  HD_API
408  SdfPath const& id) override;
409 
410 private:
411  // ---------------------------------------------------------------------- //
412  // private utility methods
413  // ---------------------------------------------------------------------- //
414  VtValue _GetPrimvarValue(SdfPath const& id, TfToken const& name);
415 
416  // ---------------------------------------------------------------------- //
417  // internal types
418  // ---------------------------------------------------------------------- //
419  struct _Mesh {
420  _Mesh() { }
421  _Mesh(TfToken const &scheme,
422  TfToken const &orientation,
423  GfMatrix4f const &transform,
424  VtVec3fArray const &points,
425  VtIntArray const &numVerts,
426  VtIntArray const &verts,
427  VtIntArray const &holes,
428  PxOsdSubdivTags const &subdivTags,
429  bool guide,
430  bool doubleSided) :
431  scheme(scheme), orientation(orientation),
432  transform(transform),
433  points(points), numVerts(numVerts), verts(verts),
434  holes(holes), subdivTags(subdivTags), guide(guide),
435  doubleSided(doubleSided) { }
436 
437  TfToken scheme;
438  TfToken orientation;
440  VtVec3fArray points;
441  VtIntArray numVerts;
442  VtIntArray verts;
443  VtIntArray holes;
444  PxOsdSubdivTags subdivTags;
445  bool guide;
446  bool doubleSided;
447  HdReprSelector reprSelector;
448  };
449  struct _Curves {
450  _Curves() { }
451  _Curves(VtVec3fArray const &points,
452  VtIntArray const &curveVertexCounts,
453  TfToken const &type,
454  TfToken const &basis) :
455  points(points), curveVertexCounts(curveVertexCounts),
456  type(type), basis(basis) { }
457 
458  VtVec3fArray points;
459  VtIntArray curveVertexCounts;
460  TfToken type;
461  TfToken basis;
462  };
463  struct _Points {
464  _Points() { }
465  _Points(VtVec3fArray const &points) : points(points) { }
466 
467  VtVec3fArray points;
468  };
469  struct _Instancer {
470  _Instancer() { }
471  _Instancer(VtVec3fArray const &scale,
472  VtVec4fArray const &rotate,
473  VtVec3fArray const &translate,
474  GfMatrix4f const &rootTransform) :
475  scale(scale), rotate(rotate), translate(translate),
476  rootTransform(rootTransform) {
477  }
478  VtVec3fArray scale;
479  VtVec4fArray rotate;
480  VtVec3fArray translate;
481  VtIntArray prototypeIndices;
482  GfMatrix4f rootTransform;
483 
484  std::vector<SdfPath> prototypes;
485  };
486  struct _Primvar {
487  _Primvar() {}
488  _Primvar(TfToken const& _name,
489  VtValue const& _value,
490  HdInterpolation const& _interp,
491  TfToken const& _role,
492  VtIntArray const& _indices=VtIntArray(0)) :
493  name(_name),
494  value(_value),
495  interp(_interp),
496  role(_role),
497  indices(_indices) {}
498 
499  TfToken name;
500  VtValue value;
502  TfToken role;
503  VtIntArray indices;
504  };
505  using _Primvars = std::vector<_Primvar>;
506  // Given an rprim id and primvar name, looks up the primvars map (see below)
507  // and returns true with the iterator to the entry if it was found.
508  bool _FindPrimvar(SdfPath const& id,
509  TfToken const& name,
510  _Primvars::iterator *pvIt);
511 
512  struct _Camera {
514  };
515  struct _Light {
517  };
518  struct _Task {
520  };
521  struct _RenderBuffer {
522  _RenderBuffer() {}
523  _RenderBuffer(GfVec3i const &d, HdFormat f, bool ms)
524  : dims(d), format(f), multiSampled(ms) {}
525  GfVec3i dims;
527  bool multiSampled;
528  };
529 
530  std::map<SdfPath, _Mesh> _meshes;
531  std::map<SdfPath, _Curves> _curves;
532  std::map<SdfPath, _Points> _points;
533  std::map<SdfPath, _Instancer> _instancers;
534  std::map<SdfPath, _Primvars> _primvars;
535  std::map<SdfPath, VtValue> _materials;
536  std::map<SdfPath, _Camera> _cameras;
537  std::map<SdfPath, _RenderBuffer> _renderBuffers;
538  std::map<SdfPath, _Light> _lights;
539  std::map<SdfPath, _Task> _tasks;
540  TfHashSet<SdfPath, SdfPath::Hash> _hiddenRprims;
541 
542  typedef std::map<SdfPath, SdfPath> SdfPathMap;
543  SdfPathMap _materialBindings;
544  SdfPathMap _instancerBindings;
545 
546  bool _hasInstancePrimvars;
547  int _refineLevel;
548  bool _visibility;
549  std::map<SdfPath, int> _refineLevels;
550  std::map<SdfPath, bool> _visibilities;
551 };
552 
553 
555 
556 #endif // PXR_IMAGING_HD_UNIT_TEST_DELEGATE_H
type
Definition: core.h:977
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.
void InsertTask(HdSceneDelegate *delegate, SdfPath const &id)
Inserts a new task into the render index with an identifier of id.
Definition: renderIndex.h:519
HdFormat
Definition: types.h:390
HD_API void AddCurves(SdfPath const &id, TfToken const &type, TfToken const &basis, GfMatrix4f const &transform, HdInterpolation colorInterp=HdInterpolationConstant, HdInterpolation widthInterp=HdInterpolationConstant, bool authoredNormals=false, SdfPath const &instancerId=SdfPath())
Add a basis curves prim containing two curves.
HD_API void UpdateCurvePrimvarsInterpMode(float time)
HD_API void AddMaterialResource(SdfPath const &id, VtValue materialResource)
Material.
HD_API void AddMesh(SdfPath const &id)
GLenum GLenum GLenum GLenum GLenum scale
Definition: glew.h:14163
virtual HD_API VtValue GetIndexedPrimvar(SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override
HD_API void AddBasisCurves(SdfPath const &id, VtVec3fArray const &points, VtIntArray const &curveVertexCounts, 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())
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.
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:127
GLuint color
Definition: glcorearb.h:1260
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:3340
GLint level
Definition: glcorearb.h:107
Definition: vec3f.h:63
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.
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual HD_API bool GetVisible(SdfPath const &id) override
Returns the authored visible state of the prim.
virtual HD_API VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId) override
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.
GLint GLenum GLint x
Definition: glcorearb.h:408
GLuint GLenum GLenum transform
Definition: glew.h:15055
virtual HD_API HdMeshTopology GetMeshTopology(SdfPath const &id) override
Gets the topological mesh data for a given prim.
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.
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.
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
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.
GLuint interp
Definition: glew.h:8307
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.
const GLdouble * v
Definition: glcorearb.h:836
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
GLsizei GLenum const void * indices
Definition: glcorearb.h:405
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
HD_API void UpdateInstancer(SdfPath const &rprimId, SdfPath const &instancerId)
GLuint id
Definition: glcorearb.h:654
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.
Definition: vec3i.h:61
HD_API void MarkRprimDirty(SdfPath path, HdDirtyBits flag)
Marks an rprim in the RenderIndex as dirty with the given dirty flags.
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:288
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)
GLint GLsizei width
Definition: glcorearb.h:102
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)
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3460
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:107
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:1375
virtual HD_API HdRenderBufferDescriptor GetRenderBufferDescriptor(SdfPath const &id) override
Returns the allocation descriptor for a given render buffer prim.
virtual HD_API HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id) override
Gets the topological curve data for a given prim.
GLfloat GLfloat GLfloat GLfloat nx
Definition: glew.h:16622
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.
HdInterpolation
Definition: enums.h:194
HD_API void UpdateTransform(SdfPath const &id, GfMatrix4f const &mat)
Transform.
virtual HD_API GfMatrix4d GetInstancerTransform(SdfPath const &instancerId) override
Returns the instancer transform.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
GLsizei const GLfloat * value
Definition: glcorearb.h:823
GLfloat f
Definition: glcorearb.h:1925
GLenum const GLfloat * params
Definition: glcorearb.h:104
HD_API void UpdatePositions(SdfPath const &id, float time)
GLhalf ny
Definition: glew.h:13506
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())
HD_API void AddRenderBuffer(SdfPath const &id, GfVec3i const &dims, HdFormat format, bool multiSampled)
Render buffers.
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)
GLint y
Definition: glcorearb.h:102
Definition: value.h:168
virtual HD_API SdfPath GetInstancerId(SdfPath const &primId) override
Returns the parent instancer of the given rprim or instancer.
HD_API GfVec3f PopulateInvalidPrimsSet()
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.