7 #ifndef PXR_IMAGING_HD_UNIT_TEST_DELEGATE_H
8 #define PXR_IMAGING_HD_UNIT_TEST_DELEGATE_H
24 #include "pxr/base/vt/array.h"
58 VtVec3fArray
const &
points,
59 VtIntArray
const &numVerts,
60 VtIntArray
const &verts,
63 TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
64 TfToken const &orientation=HdTokens->rightHanded,
65 bool doubleSided=
false);
70 VtVec3fArray
const &points,
71 VtIntArray
const &numVerts,
72 VtIntArray
const &verts,
73 VtIntArray
const &holes,
81 TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
82 TfToken const &orientation=HdTokens->rightHanded,
83 bool doubleSided=
false);
88 VtVec3fArray
const &points,
89 VtIntArray
const &numVerts,
90 VtIntArray
const &verts,
91 VtIntArray
const &holes,
94 VtIntArray
const &colorIndices,
97 VtIntArray
const &opacityIndices,
101 TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark,
102 TfToken const &orientation=HdTokens->rightHanded,
103 bool doubleSided=
false);
112 TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark);
117 bool rightHanded=
true,
bool doubleSided=
false,
124 bool rightHanded=
true,
bool doubleSided=
false,
131 bool rightHanded=
true,
bool doubleSided=
false,
138 bool rightHanded=
true,
bool doubleSided=
false,
147 bool rightHanded=
true,
bool doubleSided=
false,
172 VtVec3fArray
const &points,
173 VtIntArray
const &curveVertexCounts,
174 VtIntArray
const &curveIndices,
175 VtVec3fArray
const &normals,
192 bool authoredNormals=
false,
200 VtVec3fArray
const &points,
225 VtIntArray
const &prototypeIndex,
226 VtVec3fArray
const &
scale,
227 VtVec4fArray
const &
rotate,
240 VtIntArray
const&
indices=VtIntArray(0));
246 VtIntArray
const&
indices=VtIntArray(0));
290 _tasks[
id] = _Task();
376 VtIntArray *outIndices)
override;
386 SdfPath const& prototypeId)
override;
407 TfToken const ¶mName)
override;
427 VtVec3fArray
const &points,
428 VtIntArray
const &numVerts,
429 VtIntArray
const &verts,
430 VtIntArray
const &holes,
434 scheme(scheme), orientation(orientation),
435 transform(transform),
436 points(points), numVerts(numVerts), verts(verts),
437 holes(holes), subdivTags(subdivTags), guide(guide),
455 _Curves(VtVec3fArray
const &points,
456 VtIntArray
const &curveVertexCounts,
457 VtIntArray
const &curveIndices,
460 TfToken const &wrap = HdTokens->nonperiodic) :
461 points(points), curveVertexCounts(curveVertexCounts),
462 curveIndices(curveIndices), type(type), basis(basis), wrap(wrap) { }
465 VtIntArray curveVertexCounts;
466 VtIntArray curveIndices;
473 _Points(VtVec3fArray
const &points) : points(points) { }
479 _Instancer(VtVec3fArray
const &
scale,
480 VtVec4fArray
const &
rotate,
483 scale(scale), rotate(rotate), translate(translate),
484 rootTransform(rootTransform) {
489 VtIntArray prototypeIndices;
492 std::vector<SdfPath> prototypes;
500 VtIntArray
const& _indices=VtIntArray(0)) :
513 using _Primvars = std::vector<_Primvar>;
516 bool _FindPrimvar(
SdfPath const&
id,
518 _Primvars::iterator *pvIt);
530 struct _RenderBuffer {
533 : dims(d),
format(f), multiSampled(ms) {}
539 std::map<SdfPath, _Mesh> _meshes;
540 std::map<SdfPath, _Curves> _curves;
541 std::map<SdfPath, _Points> _points;
542 std::map<SdfPath, _Instancer> _instancers;
543 std::map<SdfPath, _Primvars> _primvars;
544 std::map<SdfPath, VtValue> _materials;
545 std::map<SdfPath, _Camera> _cameras;
546 std::map<SdfPath, _RenderBuffer> _renderBuffers;
547 std::map<SdfPath, _Light> _lights;
548 std::map<SdfPath, _Task> _tasks;
551 typedef std::map<SdfPath, SdfPath> SdfPathMap;
552 SdfPathMap _materialBindings;
553 SdfPathMap _instancerBindings;
555 bool _hasInstancePrimvars;
558 std::map<SdfPath, int> _refineLevels;
559 std::map<SdfPath, bool> _visibilities;
565 #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.
GLsizei GLenum const void * indices
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)
GLdouble GLdouble GLint GLint const GLdouble * points
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.
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.
GLsizei const GLfloat * value
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
HD_API void SetCurveWrapMode(SdfPath const &id, TfToken const &wrap)
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.
HD_API void UnhideRprim(SdfPath const &id)
HD_API void AddInstancer(SdfPath const &id, SdfPath const &parentId=SdfPath(), GfMatrix4f const &rootTransform=GfMatrix4f(1))
Instancer.
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
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
Returns the display style for the given prim.
virtual HD_API SdfPath GetMaterialId(SdfPath const &rprimId) override
Returns the material ID bound to the rprim rprimId.
GLint GLint GLsizei GLint GLenum GLenum type
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.
std::vector< class SdfPath > SdfPathVector
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
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
HD_API void UpdateInstancer(SdfPath const &rprimId, SdfPath const &instancerId)
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.
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
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())
GA_API const UT_StringHolder transform
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)
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 ¶mName) 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
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.
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
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
HD_API void UpdatePositions(SdfPath const &id, float time)
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)
std::vector< HdPrimvarDescriptor > HdPrimvarDescriptorVector
HD_API void UpdateInstancerPrimvars(float time)
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.