Main view and UI objects

This is an API reference of the views for the main objects. The section Building applications using Mayavi gives some context on how to use them.

Scene UIs: DecoratedScene and MayaviScene

class mayavi.core.ui.api.DecoratedScene(parent, **traits)

Bases: tvtk.pyface.ui.qt4.scene.Scene

A VTK interactor scene which provides a convenient toolbar that allows the user to set the camera view, turn on the axes indicator etc.

Traits:

show_axes : false

actions : List(Either(Action, Group))

class mayavi.core.ui.api.MayaviScene(parent, **traits)

Bases: tvtk.pyface.ui.qt4.decorated_scene.DecoratedScene

A scene UI, similar to a decorated scene, but with more buttons.

Traits:image_search_path : [join(resource_path(), ‘images’)]
show_engine()

Open the engine view corresponding to the engine of the scene.

SceneEditor

class mayavi.core.ui.api.SceneEditor(*args, **traits)

Bases: traitsui.basic_editor_factory.BasicEditorFactory

A TraitsUI editor factory for SceneModel instances.

Traits:

klass : _SceneEditor

scene_class : Callable(DecoratedScene)

MlabSceneModel

class mayavi.core.ui.api.MlabSceneModel(parent=None, **traits)

Bases: tvtk.pyface.scene_model.SceneModel

An container for an mlab model, that can be exposed using a Mayavi scene in a TraitsUI view.

Traits:

engine : Instance(Engine)

mlab : Property()

mayavi_scene : Instance(Scene)

EngineView and EngineRichView

These are two objects to be used as views for an engine:

from mayavi.core.ui.api import EngineView
view = EngineView(engine=engine)
view.edit_traits()
class mayavi.core.ui.api.EngineView(**traits)

Bases: traits.has_traits.HasTraits

A view displaying the engine’s object tree.

Traits:

engine : Instance(Engine)

icon : ImageResource(‘mv2.ico’)

nodes : Any

tree_editor : Instance(TreeEditor)

toolbar : Instance(ToolBar)

actions : List(Either(Action, Separator))

scenes : Delegate(‘engine’)

current_selection : Delegate(‘engine’)

default_traits_view()

The default traits view of the Engine View.

class mayavi.core.ui.api.EngineRichView(**traits)

Bases: mayavi.core.ui.engine_view.EngineView

A view displaying the engine’s object tree, alongside with a panel to edit the objects.

default_traits_view()

The default traits view of the Engine View.