Free Electron
Public Member Functions | Private Types | Private Attributes | List of all members
HydraDelegate Class Reference

A simple delegate class for unit test driver. More...

#include <HydraDelegate.h>

Inherits HdSceneDelegate.

Public Member Functions

 HydraDelegate (HdRenderIndex *parentIndex, SdfPath const &delegateID)
 
void SetUseInstancePrimVars (bool v)
 
void SetRefineLevel (int level)
 
void SetCamera (GfMatrix4d const &viewMatrix, GfMatrix4d const &projMatrix)
 
void SetCamera (SdfPath const &id, GfMatrix4d const &viewMatrix, GfMatrix4d const &projMatrix)
 
void AddCamera (SdfPath const &id)
 
bool HasLight (SdfPath const &id)
 
void AddLight (SdfPath const &id, GlfSimpleLight const &light)
 
void SetLight (SdfPath const &id, TfToken const &key, VtValue value)
 
void AddRenderTask (SdfPath const &id)
 
void AddRenderSetupTask (SdfPath const &id)
 
void AddSimpleLightTask (SdfPath const &id)
 
void AddShadowTask (SdfPath const &id)
 
void AddSelectionTask (SdfPath const &id)
 
void AdjustRenderSetupTask (SdfPath const &id, BWORD a_lighting, const GfVec4f &viewport)
 
void SetTaskParam (SdfPath const &id, TfToken const &name, VtValue val)
 
VtValue GetTaskParam (SdfPath const &id, TfToken const &name)
 
HdTaskSharedPtrVector GetRenderTasks (void)
 
void AddMesh (SdfPath const &id, GfMatrix4f const &transform, VtVec3rArray const &points, VtIntArray const &numVerts, VtIntArray const &verts, VtVec3rArray const &normals, PxOsdSubdivTags const &subdivTags, VtValue const &uv, HdInterpolation uvInterpolation, VtValue const &color, HdInterpolation colorInterpolation, bool guide=false, SdfPath const &instancerId=SdfPath(), TfToken const &scheme=PxOsdOpenSubdivTokens->catmullClark, TfToken const &orientation=HdTokens->rightHanded, bool doubleSided=false)
 
void AddBasisCurves (SdfPath const &id, GfMatrix4f const &transform, VtVec3rArray const &points, VtIntArray const &curveVertexCounts, VtVec3rArray const &normals, TfToken const &basis, VtValue const &color, HdInterpolation colorInterpolation, VtValue const &width, HdInterpolation widthInterpolation, SdfPath const &instancerId=SdfPath())
 
void AddPoints (SdfPath const &id, GfMatrix4f const &transform, VtVec3rArray const &points, VtVec3rArray const &normals, VtValue const &color, HdInterpolation colorInterpolation, VtValue const &width, HdInterpolation widthInterpolation, SdfPath const &instancerId=SdfPath())
 
void AddInstancer (SdfPath const &id, SdfPath const &parentId=SdfPath(), GfMatrix4f const &rootTransform=GfMatrix4f(1))
 
void SetInstancerProperties (SdfPath const &id, VtIntArray const &prototypeIndex, VtVec3rArray const &scale, VtVec4fArray const &rotate, VtVec3rArray const &translate)
 
void AddTexture (SdfPath const &id, GlfTextureRefPtr const &texture)
 
void AddMaterialResource (SdfPath const &id, VtValue materialResource)
 Material. More...
 
void UpdateMaterialResource (SdfPath const &materialId, VtValue materialResource)
 Update a material resource. More...
 
void BindMaterial (SdfPath const &rprimId, SdfPath const &materialId)
 
void RebindMaterial (SdfPath const &rprimId, SdfPath const &materialId)
 Example to update a material binding on the fly. More...
 
virtual SdfPath GetMaterialId (SdfPath const &rprimId) override
 
virtual VtValue GetMaterialResource (SdfPath const &materialId) override
 
void Remove (SdfPath const &id)
 
void Clear (void)
 Remove all. More...
 
void HideRprim (SdfPath const &id)
 Hides an rprim, invalidating all collections it was in. More...
 
void UnhideRprim (SdfPath const &id)
 Un-hides an rprim, invalidating all collections it was in. More...
 
void SetReprSelector (SdfPath const &id, HdReprSelector const &reprSelector)
 set per-prim repr More...
 
void SetRefineLevel (SdfPath const &id, int refineLevel)
 set per-prim refine level More...
 
void MarkRprimDirty (SdfPath path, HdChangeTracker::RprimDirtyBits flag)
 Marks an rprim in the RenderIndex as dirty with the given dirty flags. More...
 
void UpdatePositions (SdfPath const &id, float time)
 
void UpdateRprims (float time)
 
void UpdateInstancerPrimVars (float time)
 
void UpdateInstancerPrototypes (float time)
 
void UpdateCamera (SdfPath const &id, TfToken const &key, VtValue value)
 
void BindSurfaceShader (SdfPath const &rprimId, SdfPath const &shaderId)
 
GfRange3d GetExtents (void)
 
virtual bool IsInCollection (SdfPath const &id, TfToken const &collectionName)
 
virtual HdBasisCurvesTopology GetBasisCurvesTopology (SdfPath const &id)
 
virtual PxOsdSubdivTags GetSubdivTags (SdfPath const &id)
 
virtual GfRange3d GetExtent (SdfPath const &id) override
 
virtual GfMatrix4d GetTransform (SdfPath const &id) override
 
virtual bool GetVisible (SdfPath const &id) override
 
virtual HdMeshTopology GetMeshTopology (SdfPath const &id) override
 
virtual bool GetDoubleSided (SdfPath const &id)
 
virtual HdDisplayStyle GetDisplayStyle (SdfPath const &id) override
 
virtual VtValue Get (SdfPath const &id, TfToken const &key)
 
virtual HdReprSelector GetReprSelector (SdfPath const &id) override
 
virtual TfTokenVector GetPrimVarVertexNames (SdfPath const &id)
 
virtual TfTokenVector GetPrimVarVaryingNames (SdfPath const &id)
 
virtual TfTokenVector GetPrimVarFacevaryingNames (SdfPath const &id)
 
virtual TfTokenVector GetPrimVarUniformNames (SdfPath const &id)
 
virtual TfTokenVector GetPrimVarConstantNames (SdfPath const &id)
 
virtual TfTokenVector GetPrimVarInstanceNames (SdfPath const &id)
 
virtual int GetPrimVarDataType (SdfPath const &id, TfToken const &key)
 
virtual int GetPrimVarComponents (SdfPath const &id, TfToken const &key)
 
virtual VtIntArray GetInstanceIndices (SdfPath const &instancerId, SdfPath const &prototypeId) override
 
virtual GfMatrix4d GetInstancerTransform (SdfPath const &instancerId) override
 
virtual VtValue GetCameraParamValue (SdfPath const &cameraId, TfToken const &paramName) override
 
void SetTransform (SdfPath const &id, GfMatrix4f const &transform)
 

Private Types

typedef std::map< SdfPath, SdfPath > SdfPathMap
 
typedef TfHashMap< TfToken, VtValue, TfToken::HashFunctor > ValueCache
 
typedef TfHashMap< SdfPath, ValueCache, SdfPath::Hash > ValueCacheMap
 

Private Attributes

std::map< SdfPath, Mesh > m_meshes
 
std::map< SdfPath, Curves > m_curves
 
std::map< SdfPath, Points > m_points
 
std::map< SdfPath, Instancer > m_instancers
 
std::map< SdfPath, SdfPath > m_surfaceShaderBindings
 
std::map< SdfPath, Texture > m_textures
 
std::map< SdfPath, VtValue > m_materials
 
TfHashSet< SdfPath, SdfPath::Hash > m_hiddenRprims
 
SdfPathMap m_materialBindings
 
SdfPath m_cameraId
 
bool m_runShadows
 
bool m_hasInstancePrimVars
 
int m_refineLevel
 
std::map< SdfPath, int > m_refineLevels
 
ValueCacheMap m_valueCacheMap
 

Detailed Description

A simple delegate class for unit test driver.

Member Function Documentation

◆ AddMaterialResource()

void HydraDelegate::AddMaterialResource ( SdfPath const &  id,
VtValue  materialResource 
)

Material.

◆ Clear()

void HydraDelegate::Clear ( void  )

Remove all.

◆ HideRprim()

void HydraDelegate::HideRprim ( SdfPath const &  id)

Hides an rprim, invalidating all collections it was in.

◆ MarkRprimDirty()

void HydraDelegate::MarkRprimDirty ( SdfPath  path,
HdChangeTracker::RprimDirtyBits  flag 
)

Marks an rprim in the RenderIndex as dirty with the given dirty flags.

◆ RebindMaterial()

void HydraDelegate::RebindMaterial ( SdfPath const &  rprimId,
SdfPath const &  materialId 
)

Example to update a material binding on the fly.

◆ SetRefineLevel()

void HydraDelegate::SetRefineLevel ( SdfPath const &  id,
int  refineLevel 
)

set per-prim refine level

◆ SetReprSelector()

void HydraDelegate::SetReprSelector ( SdfPath const &  id,
HdReprSelector const &  reprSelector 
)

set per-prim repr

◆ UnhideRprim()

void HydraDelegate::UnhideRprim ( SdfPath const &  id)

Un-hides an rprim, invalidating all collections it was in.

◆ UpdateMaterialResource()

void HydraDelegate::UpdateMaterialResource ( SdfPath const &  materialId,
VtValue  materialResource 
)

Update a material resource.

XXX : Make sure all rprims know they have an invalid binding,


The documentation for this class was generated from the following files: