Miscellaneous Utilities

Shader and ShaderProgram wrapper classes for vertex and fragment shaders used in Interactive Data Visualization

class yt_idv.opengl_support.ColormapTexture(**kwargs)[source]

Bases: yt_idv.opengl_support.Texture1D

colormap_name

A casting version of the unicode trait.

class yt_idv.opengl_support.DepthBuffer(**kwargs)[source]

Bases: yt_idv.opengl_support.Texture2D

create_texture(w, h)[source]
class yt_idv.opengl_support.Framebuffer(**kwargs)[source]

Bases: traitlets.traitlets.HasTraits

bind(clear=True)[source]
property data
db_tex

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

property depth_data
fb_id

A casting version of the int trait.

fb_tex

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

initialized

A boolean (True, False) trait.

input_bind(fb_target=0, db_target=1)[source]
rb_id

A casting version of the int trait.

viewport

An instance of a Python tuple.

class yt_idv.opengl_support.GLValue(default_value=traitlets.Undefined, allow_none=False, read_only=None, help=None, config=None, **kwargs)[source]

Bases: traitlets.traitlets.TraitType

default_value = GL_NONE
info_text = 'An OpenGL constant.'
validate(obj, value)[source]
class yt_idv.opengl_support.Texture(**kwargs)[source]

Bases: traitlets.traitlets.HasTraits

bind(target=0)[source]
channels
data

A numpy array trait type.

mag_filter
min_filter
texture_name

A casting version of the int trait.

class yt_idv.opengl_support.Texture1D(**kwargs)[source]

Bases: yt_idv.opengl_support.Texture

boundary_x
dim_enum
dims = 1
class yt_idv.opengl_support.Texture2D(**kwargs)[source]

Bases: yt_idv.opengl_support.Texture

boundary_x
boundary_y
channels = 1
dim_enum
dims = 2
class yt_idv.opengl_support.Texture3D(**kwargs)[source]

Bases: yt_idv.opengl_support.Texture

boundary_x
boundary_y
boundary_z
dim_enum
dims = 3
class yt_idv.opengl_support.Texture3DIterator(**kwargs)[source]

Bases: traitlets.traitlets.HasTraits

items

A trait which allows any value.

class yt_idv.opengl_support.TextureBoundary(default_value=traitlets.Undefined, allow_none=False, read_only=None, help=None, config=None, **kwargs)[source]

Bases: traitlets.traitlets.TraitType

default_value = GL_CLAMP_TO_EDGE
info_text = 'A boundary type of mirror, clamp, or repeat'
validate(obj, value)[source]
class yt_idv.opengl_support.TransferFunctionTexture(**kwargs)[source]

Bases: yt_idv.opengl_support.Texture2D

class yt_idv.opengl_support.VertexArray(**kwargs)[source]

Bases: traitlets.traitlets.HasTraits

attributes

An instance of a Python list.

bind(program=None)[source]
each

A casting version of the int trait.

id

A casting version of the int trait.

index_id

A casting version of the int trait.

indices

A numpy array trait type.

name

A casting version of the unicode trait.

class yt_idv.opengl_support.VertexAttribute(**kwargs)[source]

Bases: traitlets.traitlets.HasTraits

bind(program=None)[source]
data

A numpy array trait type.

each

A casting version of the int trait.

id

A casting version of the int trait.

name

A casting version of the unicode trait.

opengl_type

A casting version of the int trait.

yt_idv.opengl_support.coerce_uniform_type(val, gl_type)[source]
yt_idv.opengl_support.compute_box_geometry(left_edge, right_edge)[source]

Shader and ShaderProgram wrapper classes for vertex and fragment shaders used in Interactive Data Visualization

class yt_idv.shader_objects.Shader(**kwargs)[source]

Bases: traitlets.traitlets.HasTraits

Creates a shader from source

Parameters

source (str) – This can either be a string containing a full source of a shader, an absolute path to a source file or a filename of a shader residing in the ./shaders/ directory.

blend_equation
blend_equation_separate

An instance of a Python tuple.

blend_func

An instance of a Python tuple.

blend_func_separate

An instance of a Python tuple.

compile(source=None, parameters=None)[source]
delete_shader()[source]
depth_test
info

A casting version of the unicode trait.

setup_blend()[source]
property shader
shader_name

A casting version of the unicode trait.

shader_type

An enum of strings where the case should be ignored.

source

A trait which allows any value.

use_separate_blend

A boolean (True, False) trait.

class yt_idv.shader_objects.ShaderProgram(vertex_shader=None, fragment_shader=None, geometry_shader=None)[source]

Bases: object

Wrapper class that compiles and links vertex and fragment shaders into a shader program.

Parameters
  • vertex_shader (string) – or yt.visualization.volume_rendering.shader_objects.VertexShader The vertex shader used in the Interactive Data Visualization pipeline.

  • fragment_shader (string) – or yt.visualization.volume_rendering.shader_objects.FragmentShader The fragment shader used in the Interactive Data Visualization pipeline.

  • geometry_shader (string) – or yt_idv.shader_objects.GeometryShader The geometry shader used in the pipeline; optional.

delete_program()[source]
enable()[source]
introspect()[source]
class yt_idv.shader_objects.ShaderTrait(default_value=traitlets.Undefined, allow_none=False, read_only=None, help=None, config=None, **kwargs)[source]

Bases: traitlets.traitlets.TraitType

default_value = None
info_text = 'A shader (vertex, fragment or geometry)'
validate(obj, value)[source]
class yt_idv.simple_gui.SimpleGUI(window)[source]

Bases: object

callbacks = None
context = None
draw = False
property keyboard_event_handled
property mouse_event_handled
render(scene)[source]
render_camera(scene)[source]
renderer = None
window = None
class yt_idv.traitlets_support.FontTrait(default_value=traitlets.Undefined, allow_none=False, read_only=None, help=None, config=None, **kwargs)[source]

Bases: traitlets.traitlets.TraitType

info_text = 'A font instance from matplotlib'
validate(obj, value)[source]
class yt_idv.traitlets_support.YTPositionTrait(default_value=traitlets.Undefined, allow_none=False, read_only=None, help=None, config=None, **kwargs)[source]

Bases: traitlets.traitlets.TraitType

default_value = None
info_text = 'A position in code_length'
validate(obj, value)[source]
yt_idv.traitlets_support.ndarray_ro()[source]
yt_idv.traitlets_support.ndarray_shape(*dimensions)[source]