def start_using_workbench_application():
    """ Run the application. """

    from enthought.envisage.ui.workbench.api import WorkbenchApplication
    # Enthought plugins.
    from enthought.envisage.core_plugin import CorePlugin
    from enthought.envisage.developer.developer_plugin import DeveloperPlugin
    from enthought.envisage.developer.ui.developer_ui_plugin import DeveloperUIPlugin
    from enthought.envisage.ui.workbench.workbench_plugin import WorkbenchPlugin
    from enthought.envisage.ui.single_project.project_plugin import ProjectPlugin
    from enthought.envisage.ui.workbench.api import WorkbenchApplication
    from enthought.plugins.python_shell.python_shell_plugin import PythonShellPlugin

    plugins = mayavi_app.get_plugins()
    
    # Create an application with the specified plugins.
    application = WorkbenchApplication(
        plugins=[
#            CorePlugin(), WorkbenchPlugin(), 
            MyModelUIPlugin(),
        ] + plugins
    )

    # Run it! This starts the application, starts the GUI event loop, and when
    # that terminates, stops the application.
    application.run()

    return
Example #2
0
def get_non_gui_plugins():
    """Get list of basic tloop plugins that do not add any views or
    actions."""
    plugins = mayavi_app.get_plugins()
    plugins.insert(0, TLoopPlugin() )
    plugins.insert(1, TStepperPlugin() )
    plugins.insert(2, RTracePlugin() )
    return plugins
Example #3
0
def get_plugins():
    """Get list of default plugins to use for IBVPy."""
    plugins = mayavi_app.get_plugins()
    plugins.insert(0, IBVModelPlugin() )
    plugins.insert(1, IBVModelUIPlugin() )
    plugins.insert(2, TLoopPlugin() )
    plugins.insert(3, TLoopUIPlugin() )
    plugins.insert(4, TStepperPlugin() )
    plugins.insert(5, TStepperUIPlugin() )
#    plugins.insert(6, SDomainPlugin() )
#    plugins.insert(7, SDomainUIPlugin() )
    plugins.insert(6, RTracePlugin() )
    plugins.insert(7, RTraceUIPlugin() )
    return plugins
Example #4
0
def main():

    # Get the default mayavi plugins.
    plugins = get_plugins()
    # Inject our plugin up front so our perspective becomes the default.
    plugins.insert(0, ExplorerPlugin())

    # Create an Envisage application.
    id = 'explorer3d.Explorer3D'
    application = WorkbenchApplication(id=id, plugins=plugins)
    # This needs to be done here since the ETSConfig.application_home is
    # not set correctly up to this point.
    setup_logger(logger, 'explorer3d.log', mode=logging.ERROR)

    # Start the application.
    application.run()
Example #5
0
def main():

    # Get the default mayavi plugins.
    plugins = get_plugins()
    # Inject our plugin up front so our perspective becomes the default.
    plugins.insert(0, ExplorerPlugin())
    # plugins = [ ExplorerPlugin() ]

    # Create an Envisage application.
    id = "explorer3d.Explorer3D"
    application = WorkbenchApplication(id=id, plugins=plugins)
    # This needs to be done here since the ETSConfig.application_home is
    # not set correctly up to this point.
    setup_logger(logger, "explorer3d.log", mode=logging.ERROR)

    # Start the application.
    application.run()
        #cel_type = 7
        #mesh.set_cells(cel_type, triangles)
        #mesh.point_data.scalars = temperature
        #mesh.point_data.scalars.name = 'Temperature'
        mesh.point_data.vectors = warp
        src = VTKDataSource(data = mesh)
        e.add_source(src)
        e.add_filter(WarpVector())
        e.add_module(Outline())
        e.add_module(Surface())
        
        
    def _selection_change(self, old, new):
        self.trait_property_changed('current_selection', old, new)

    def _get_current_selection(self):
        return self.scene.engine.current_selection

    def _data_source_changed(self, value):
        self.scene.mlab.clf()
        if value == 'mayavi':
            self.generate_data_mayavi()
        elif value == 'mlab':
            self.generate_data_mlab()


if __name__ == '__main__':
    get_plugins()
    m = Mayavi()
    m.configure_traits()