helios.backends.fury.tools

VTK/FURY Tools

This module implements a set o tools to enhance VTK given new functionalities.

List of Objects

Uniform

class helios.backends.fury.tools.Uniform(name, uniform_type, value)[source]

Bases: object

This creates a uniform shader variable

It’s responsible to store the value of a given uniform variable and call the related vtk_program

Parameters
  • name (str) – name of the uniform variable

  • uniform_type (str) –

    Uniform variable type which will be used inside the shader. Any of this are valid: 1fv, 1iv, 2f, 2fv, 2i, 3f, 3fv,

    3uc, 4f, 4fv, 4uc, GroupUpdateTime, Matrix, Matrix3x3, Matrix4x4, Matrix4x4v, f, i value: float or ndarray

  • value (type(uniform_type)) – should be a value which represent’s the shader uniform variable. For example, if uniform_type is ‘f’ then value should be a float; if uniform_type is ‘3f’ then value should be a 1x3 array.

execute_program(program)[source]

Given a shader program, this method will update the value with the associated uniform variable in a draw call

Parameters

program (vtkmodules.vtkRenderingOpenGL2.vtkShaderProgram) – A shader program which will be used to update the uniform

Uniforms

class helios.backends.fury.tools.Uniforms(uniforms)[source]

Bases: object

Creates an object which store and execute an uniform variable.

Parameters

uniforms (list) – List of Uniform objects.

Examples

uniforms = [
    Uniform(name='edgeWidth', uniform_type='f', value=edgeWidth)...
]
CustomUniforms = Uniforms(markerUniforms)
add_shader_callback(
        sq_actor, CustomUniforms)
sq_actor.CustomUniforms = CustomUniforms
sq_actor.CustomUniforms.edgeWidth = 0.5
__call__(_caller, _event, calldata=None)[source]

This method should be used as a callback for a vtk Observer

Execute the shader program with the given uniform variables.