Inherits from
- HasStrictTraits: enthought.traits.has_traits.HasStrictTraits
Attributes
- children_ui_list
The list to provide to a TreeEditor. Always add on a AdderNode. TODO: It makes more sense to put the modification of the list in some other UI module, and not here.
children_ui_list = Property(record = False)
- current_object
Current object.
current_object = Property(record = False)
- current_scene
Current scene.
current_scene = Property(Instance(Scene), record = False)
- current_selection
Current selection -- the currently selected object on the tree.
current_selection = Property(record = False)
- current_selection_view
View related traits.
current_selection_view = View(Item(name = '_current_selection', enabled_when = '_current_selection is not None', style = 'custom', springy = True, show_label = False), resizable = True, scrollable = True)
- name
Our name.
name = Str('Mayavi Engine')
- recorder
The recorder for script recording.
recorder = Instance(Recorder, record = False)
- running
Are we running?
running = Bool(False, record = False)
- scene_factory
An optional callable that will generate a usable new viewer containing a enthought.tvtk.pyface.TVTKScene instance. Ideally the viewer should have an interface like enthought.tvtk.pyface.TVTKWindow -- basically it must implement the closing and activated events, however, this is not necessary. The created viewer is used by the new_scene method to create a new Viewer. This is a mechanism to use a user specified scene with the Engine and have the ability to load saved visualizations using the new scene. Handy for things like off-screen rendering.
scene_factory = Callable(viewer_factory)
- scenes
The scenes associated with this project.
scenes = List(Scene, record = True)
- started
Has the Engine started? Use this event to do something after the engine has been started.
started = Event(record = False)
Inherited from base classes
Method summary
- __get_pure_state__(self)
- __getstate__(self)
- __init__(self, **traits)
- __set_pure_state__(self, state)
- __setstate__(self, str_state)
- add_filter(self, fil, obj = None)
- add_module(self, mod, obj = None)
- add_scene(self, scene, name = None)
- add_source(self, src, scene = None)
- close_scene(self, scene)
- dialog_view(self)
- get_viewer(self, scene)
- load_visualization(self, file_or_fname)
- new_scene(self, viewer = None, name = None, **kwargs)
- open(self, filename, scene = None)
- record(self, msg)
- remove_scene(self, scene, **kwargs)
- save_visualization(self, file_or_fname)
- start(self)
- stop(self)
Inherited from base classes
- __deepcopy__(self, memo)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __get_pure_state__(self)
- __getstate__(self)
- __init__(self, **traits)
- __set_pure_state__(self, state)
- __setstate__(self, str_state)
- add_filter(self, fil, obj = None)
Adds a filter to the pipeline at an appropriate point. Adds it to the selected object, or to an object passed as the kwarg obj.
- add_module(self, mod, obj = None)
Adds a module to the pipeline at an appropriate point. Adds it to the selected object, or to an object passed through the kwarg obj.
- add_scene(self, scene, name = None)
Add given scene (a pyface.tvtk.scene.Scene instance) to the mayavi engine so that mayavi can manage the scene. This is used when the user creates a scene. Note that for the EnvisageEngine this is automatically taken care of when you create a new scene using the TVTK scene plugin.
Parameters:
scene - pyface.tvtk.scene.Scene
The scene that needs to be managed from mayavi.
- name - str
- The name assigned to the scene. It tries to determine the name of the scene from the passed scene instance. If this is not possible it defaults to 'TVTK Scene'.
- add_source(self, src, scene = None)
Adds a source to the pipeline. Uses the current scene unless a scene is given in the scene keyword argument.
- close_scene(self, scene)
Given a scene created from new_scene, this method closes it and removes the scene from the list of scenes we manage.
Parameters:
scene - pyface.tvtk.scene.Scene or an object that holds a reference to a pyface.tvtk.scene.Scene in a scene attribute.
- dialog_view(self)
Default dialog view for Engine objects.
- get_viewer(self, scene)
Return the viewer associated with a given scene.
Parameters:
scene - An enthought.mayavi.core.scene.Scene instance.
- load_visualization(self, file_or_fname)
Given a file/file name this loads the visualization.
- new_scene(self, viewer = None, name = None, **kwargs)
Create or manage a new VTK scene window. If no viewer argument is provided, the method creates a new viewer using self.scene_factory. If self.scene_factory is None then it creates an ivtk viewer. This code requires that the viewer has a scene attribute/trait that is a pyface.tvtk.scene.Scene. It also works best if the viewer supports closing and activated events.
The method returns the created viewer.
Parameters:
viewer - The viewer object, if None, one is created for you.
name - The name attribute of the viewer
**kwargs - The extra keyword arguments are passed along to the scene factory.
- open(self, filename, scene = None)
Open a file given a filename if possible in either the current scene or the passed scene.
- record(self, msg)
This is merely a convenience method to record messages to the script recorder.
- remove_scene(self, scene, **kwargs)
Remove a given scene (a pyface.tvtk.scene.Scene instance) from the mayavi engine if it is already being managed by mayavi. Note that for the EnvisageEngine this is automatically taken care of when you close a scene started using the TVTK scene plugin.
Parameters:
scene - pyface.tvtk.scene.Scene
The scene that needs to be removed from mayavi.
- save_visualization(self, file_or_fname)
Given a file or a file name, this saves the current visualization to the file.
- start(self)
This is called by the plugin when the plugin actually starts.
- stop(self)