Plugin module

This module simphony_mayavi.plugin provides a set of tools to visualize CUDS objects. The tools are also available as a visualisation plug-in to the simphony library.

simphony_mayavi.show.show(cuds)[source]

Show the cuds objects using the default visualisation.

Parameters:cuds – A top level cuds object (e.g. a mesh). The method will detect the type of object and create the appropriate visualisation.
simphony_mayavi.snapshot.snapshot(cuds, filename)[source]

Shave a snapshot of the cuds object using the default visualisation.

Parameters:
  • cuds – A top level cuds object (e.g. a mesh). The method will detect the type of object and create the appropriate visualisation.
  • filename (string) – The filename to use for the output file.
simphony_mayavi.adapt2cuds.adapt2cuds(data_set, name='CUDS container', kind=None, rename_arrays=None)[source]

Adapt a TVTK dataset to a CUDS container.

Parameters:
  • data_set (tvtk.Dataset) – The dataset to import and wrap into CUDS container.
  • name (string) – The name of the CUDS container. Default is ‘CUDS container’.
kind : {‘mesh’, ‘lattice’, ‘particles’}
The kind of the container to return. Default is None, where the function will use some heuristics to infer the most appropriate type of CUDS container to return
rename_array : dict

Dictionary mapping the array names used in the dataset object to their related CUBA keywords that will be used in the returned CUDS container.

Note

When set a shallow copy of the input data_set is created and used by the related vtk -> cuds wrapper.

Raises:
ValueError:
When kind is not a valid CUDS container type.
TypeError:
When it is not possible to wrap the provided data_set.
simphony_mayavi.load.load(filename, name=None, kind=None, rename_arrays=None)[source]

Load the file data into a CUDS container.

Parameters:
  • filename (string) – The file name of the file to load.
  • name (string) – The name of the returned CUDS container. Default is ‘CUDS container’.
kind : {‘mesh’, ‘lattice’, ‘particles’}
The kind of the container to return. Default is None, where the function will use some heuristics to infer the most appropriate type of CUDS container to return (using adapt2cuds).
rename_array : dict

Dictionary mapping the array names used in the dataset object to their related CUBA keywords that will be used in the returned CUDS container.

Note

Only CUBA keywords are supported for array names so use this option to provide a translation mapping to the CUBA keys.