Scene Data Components

class yt_idv.scene_data.base_data.SceneData(**kwargs: Any)[source]

Bases: traitlets.traitlets.HasTraits

A class that defines a collection of GPU-managed data.

This class contains the largest common set of features that can be used OpenGL rendering: a set of vertices and a set of vertex attributes. Note that this is distinct from the shader, which can be swapped out and provided with these items.

max_val

A casting version of the float trait.

min_val

A casting version of the float trait.

name

A trait for unicode strings.

textures

An instance of a Python list.

property val_range
vertex_array

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

class yt_idv.scene_data.block_collection.BlockCollection(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

add_data(field, no_ghost=False)[source]

Adds a source of data for the block collection.

Given a data_source and a field to populate from, adds the data to the block collection so that is able to be rendered.

Parameters:
  • data_source (YTRegion) – A YTRegion object to use as a data source.

  • field (string) – A field to populate from.

  • no_ghost (bool (False)) – Should we speed things up by skipping ghost zone generation?

bitmap_objects

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

blocks

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

blocks_by_grid

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

data_source

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

filter_callback(callback)[source]
grids_by_block

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

name = 'block_collection'
scale

A boolean (True, False) trait.

texture_objects

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

viewpoint_iter(camera)[source]
class yt_idv.scene_data.octree_block_collection.OctreeBlockCollection(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

add_data(field)[source]

Adds a source of data for the block collection.

Given a data_source and a field to populate from, adds the data to the block collection so that is able to be rendered.

Parameters:
  • data_source (YTRegion) – A YTRegion object to use as a data source.

  • field (string) – A field to populate from.

  • no_ghost (bool (False)) – Should we speed things up by skipping ghost zone generation?

bitmap_textures

An instance of a Python list.

data_source

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

data_textures

An instance of a Python list.

name = 'octree_block_collection'
shapes

An instance of a Python list.

class yt_idv.scene_data.box.BoxData(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

left_edge
name = 'box_data'
right_edge
class yt_idv.scene_data.line.LineData(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

add_data(lines)[source]
n_values

A casting version of the int trait.

name = 'line_data'
class yt_idv.scene_data.mesh.MeshData(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

add_data(field)[source]
blocks

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

data_source

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

get_mesh_data(data_source, field)[source]

This reads the mesh data into a form that can be fed in to OpenGL.

name = 'mesh'
scale

A boolean (True, False) trait.

size

A casting version of the int trait.

texture_objects

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

class yt_idv.scene_data.rgba.RGBAData(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

add_data(lines)[source]
colormap_texture

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

name = 'rgba_data'
class yt_idv.scene_data.text_characters.TextCharacters(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

build_textures()[source]
characters

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

font
font_size

A casting version of the int trait.

name = 'text_overlay'
class yt_idv.scene_data.curve.CurveData(**kwargs: Any)[source]

Bases: yt_idv.scene_data.base_data.SceneData

Data component for a single curve.

add_data(curve)[source]

add curve data

Parameters:

curve (ArrayLike) – an array of shape (N, 3) specifying the position (in x, y, z) of N points.

data

A numpy array trait type.

n_vertices

A casting version of the int trait.

name = 'curve_data'
class yt_idv.scene_data.curve.CurveCollection(**kwargs: Any)[source]

Bases: yt_idv.scene_data.curve.CurveData

Data component for a collection of curves

add_curve(curve)[source]

add a single curve to the collection

Parameters:

curve (ArrayLike) – an array of shape (N, 3) specifying the position (in x, y, z) of N points.

add_data()[source]

finalize the current collection of curves.

data

A numpy array trait type.

n_vertices

A casting version of the int trait.

name = 'curve_collection'