Miscellaneous Utilities¶
Shader and ShaderProgram wrapper classes for vertex and fragment shaders used in Interactive Data Visualization
- class yt_idv.opengl_support.ColormapTexture(**kwargs: Any)[source]¶
Bases:
Texture1D- colormap_name¶
A casting version of the unicode trait.
- class yt_idv.opengl_support.Framebuffer(**kwargs: Any)[source]¶
Bases:
HasTraits- 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.
- rb_id¶
A casting version of the int trait.
- viewport¶
An instance of a Python tuple.
- class yt_idv.opengl_support.GLValue(default_value: t.Any = traitlets.Undefined, allow_none: bool = False, read_only: bool | None = None, help: str | None = None, config: t.Any = None, **kwargs: t.Any)[source]¶
Bases:
TraitType- default_value: t.Any = GL_NONE¶
- info_text: str = 'An OpenGL constant.'¶
- class yt_idv.opengl_support.Texture(**kwargs: Any)[source]¶
Bases:
HasTraits- 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: Any)[source]¶
Bases:
Texture- boundary_x¶
- dim_enum¶
- dims = 1¶
- class yt_idv.opengl_support.Texture2D(**kwargs: Any)[source]¶
Bases:
Texture- boundary_x¶
- boundary_y¶
- channels = 1¶
- dim_enum¶
- dims = 2¶
- class yt_idv.opengl_support.Texture3D(**kwargs: Any)[source]¶
Bases:
Texture- boundary_x¶
- boundary_y¶
- boundary_z¶
- dim_enum¶
- dims = 3¶
- class yt_idv.opengl_support.Texture3DIterator(**kwargs: Any)[source]¶
Bases:
HasTraits- items¶
A trait which allows any value.
- class yt_idv.opengl_support.TextureBoundary(default_value: t.Any = traitlets.Undefined, allow_none: bool = False, read_only: bool | None = None, help: str | None = None, config: t.Any = None, **kwargs: t.Any)[source]¶
Bases:
TraitType- default_value: t.Any = GL_CLAMP_TO_EDGE¶
- info_text: str = 'A boundary type of mirror, clamp, or repeat'¶
- class yt_idv.opengl_support.VertexArray(**kwargs: Any)[source]¶
Bases:
HasTraits- attributes¶
An instance of a Python list.
- 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: Any)[source]¶
Bases:
HasTraits- data¶
A numpy array trait type.
- divisor¶
A casting version of the int trait.
- 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.
Shader and ShaderProgram wrapper classes for vertex and fragment shaders used in Interactive Data Visualization
- class yt_idv.shader_objects.PreprocessorDefinitionState[source]¶
Bases:
object- add_definition(shader_type: str, value: Tuple[str, str])[source]¶
add a definition for specified shader_type, will overwrite existing definitions.
- clear_definition(shader_type: str, value: Tuple[str, str])[source]¶
remove the definition of value for specified shader_type
- class yt_idv.shader_objects.Shader(**kwargs: Any)[source]¶
Bases:
HasTraitsCreates 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.
allow_null (bool) – If True (default) then shader compilation errors will be caught and printed without raising exception (convenient for general use and for developing new shaders). If False, any compilation errors will raise a RunTimeError (useful for CI testing).
- allow_null¶
A boolean (True, False) trait.
- 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.
- property defines¶
- depth_test¶
- info¶
A casting version of the unicode trait.
- preprocessor_defs¶
An instance of a Python list.
- 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, preprocessor_defs=None)[source]¶
Bases:
objectWrapper class that compiles and links vertex and fragment shaders into a shader program.
- Parameters:
vertex_shader (string) – or
yt.visualization.volume_rendering.shader_objects.VertexShaderThe vertex shader used in the Interactive Data Visualization pipeline.fragment_shader (string) – or
yt.visualization.volume_rendering.shader_objects.FragmentShaderThe fragment shader used in the Interactive Data Visualization pipeline.geometry_shader (string) – or
yt_idv.shader_objects.GeometryShaderThe geometry shader used in the pipeline; optional.preprocessor_defs (PreprocessorDefinitionState) – a PreprocessorDefinitionState instance defining any preprocessor definitions if used; optional.
- class yt_idv.shader_objects.ShaderTrait(default_value: t.Any = traitlets.Undefined, allow_none: bool = False, read_only: bool | None = None, help: str | None = None, config: t.Any = None, **kwargs: t.Any)[source]¶
Bases:
TraitType- default_value: t.Any = None¶
- info_text: str = 'A shader (vertex, fragment or geometry)'¶
- class yt_idv.simple_gui.SimpleGUI(window)[source]¶
Bases:
object- callbacks = None¶
- context = None¶
- draw = False¶
- property keyboard_event_handled¶
- property mouse_event_handled¶
- renderer = None¶
- window = None¶
- class yt_idv.traitlets_support.FontTrait(default_value: t.Any = traitlets.Undefined, allow_none: bool = False, read_only: bool | None = None, help: str | None = None, config: t.Any = None, **kwargs: t.Any)[source]¶
Bases:
TraitType- info_text: str = 'A font instance from matplotlib'¶
- class yt_idv.traitlets_support.YTPositionTrait(default_value: t.Any = traitlets.Undefined, allow_none: bool = False, read_only: bool | None = None, help: str | None = None, config: t.Any = None, **kwargs: t.Any)[source]¶
Bases:
TraitType- default_value: t.Any = None¶
- info_text: str = 'A position in code_length'¶