Esempio n. 1
0
    def run_standalone(self):
        from enthought.mayavi.core.engine import Engine
        from enthought.mayavi.plugins.script import Script
        from enthought.pyface.api import ApplicationWindow, GUI

        self.setup_logger()
        if self.offscreen:
            engine = Engine(scene_factory=off_screen_viewer)
        else:
            engine = Engine()
        engine.start()

        self.script = Script(engine=engine)
        self.gui = g = GUI()
        self.app_window = a = ApplicationWindow()
        a.open()
        a.show(False)
        g.invoke_later(self.run)
        g.start_event_loop()
Esempio n. 2
0
def show_mesh(file_name, ndim):
    mayavi_engine = Engine()
    mayavi_engine.start()
    mayavi_engine.new_scene()

    # View the MayaVi pipeline
    engine_view = EngineView(engine=mayavi_engine)
    ui = engine_view.edit_traits()

    # Setup MayaVi pipeline
    src = TriangleReader()
    
    if (ndim == 2):
        src.initialize(file_name+'.edge') # Load the 2D .edge file
    else:
        src.initialize(file_name+'.face') # Load the 3D .face file

    mayavi_engine.add_source(src)
    # Add any filters, modules here in the order that they are to appear in the pipeline
    mayavi_engine.add_module(Surface())
Esempio n. 3
0
 def setUp(self):
     e = Engine()
     e.start()
     self._non_null_engine = e
     mlab.set_engine(e)
Esempio n. 4
0
 def __engine_default(self):
     e = Engine()
     e.start()
     e.new_scene(self._scene)
     return e
Esempio n. 5
0
 def __engine_default(self):
     e = Engine()
     e.start()
     e.new_scene(self._scene)
     return e