class AddModuleManager(ModuleAction): """ An action that adds a ModuleManager to the tree. """ tooltip = "Add a ModuleManager to the current source/filter" description = "Add a ModuleManager to the current source/filter" metadata = ModuleMetadata( id="AddModuleManager", class_name="mayavi.core.module_manager.ModuleManager", menu_name="&Add ModuleManager", tooltip="Add a ModuleManager to the current source/filter", description="Add a ModuleManager to the current source/filter", input_info=PipelineInfo(datasets=['any'], attribute_types=['any'], attributes=['any'])) def perform(self, event): """ Performs the action. """ from mayavi.core.module_manager import ModuleManager mm = ModuleManager() mv = self.mayavi mv.add_module(mm) mv.engine.current_selection = mm
# Author: Prabhu Ramachandran <*****@*****.**> # Copyright (c) 2006-2020, Enthought, Inc. # License: BSD Style. from mayavi.core.registry import registry from mayavi.core.pipeline_info import PipelineInfo from mayavi.core.metadata import ModuleMetadata # Metadata for the new module we want to add -- notice that we use a # factory function here for convenience, we could also use a class but # the reasons for doing this are documented below. user_outline = ModuleMetadata( id="UserOutlineModule", menu_name="&UserOutline", factory='user_mayavi.user_outline', desc="Draw a cornered outline for given input", tooltip="Draw a cornered outline for given input", help="Draw a cornered outline for given input", input_info=PipelineInfo(datasets=['any'], attribute_types=['any'], attributes=['any'])) # Register the module with the mayavi registry. registry.modules.append(user_outline) ####### # The all important function that returns the plugin we wish to add to # the default mayavi application. def get_plugins(): # We simply return a list containing the WorkerPlugin defined below. return [WorkerPlugin()]
# Local imports. from mayavi.core.metadata import ModuleMetadata from mayavi.core.pipeline_info import PipelineInfo BASE = 'mayavi.modules' ################################################################################ # Metadata. axes_module = ModuleMetadata( id = "AxesModule", menu_name = "&Axes", class_name = BASE + '.axes.Axes', desc = "Draw cubical axes on the outline for given input", tooltip = "Draw axes on the outline of input data", help = "Draw axes on the outline of input data", input_info = PipelineInfo(datasets=['any'], attribute_types=['any'], attributes=['any']) ) contour_grid_plane_module = ModuleMetadata( id = "ContourGridPlaneModule", menu_name = "&ContourGridPlane", class_name = BASE + '.contour_grid_plane.ContourGridPlane', desc = "Shows a contour grid plane for the given input", tooltip = "Shows a contour grid plane for the given input", help = "Shows a contour grid plane for the given input", input_info = PipelineInfo(datasets=['image_data', 'structured_grid',