Ejemplo n.º 1
0
def main():
    # Create the MayaVi engine and start it.
    e = Engine()
    # Starting the engine registers the engine with the registry and
    # notifies others that the engine is ready.
    e.start()

    # Do this if you need to see the MayaVi tree view UI.
    ev = EngineView(engine=e)
    ui = ev.edit_traits()

    # Create a new scene.
    scene = e.new_scene()
    # Now create a new scene just for kicks.
    scene1 = e.new_scene()

    # Now setup a normal MayaVi pipeline.
    src = VTKXMLFileReader()
    src.initialize(join(get_data_dir(abspath(__file__)),
                        'fire_ug.vtu'))
    e.add_source(src)
    e.add_module(Outline())
    e.add_module(ScalarCutPlane())
    e.add_module(Streamline())
    return e, ui
Ejemplo 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())
Ejemplo n.º 3
0
def main():
    # Create the MayaVi engine and start it.
    e = Engine()
    # Starting the engine registers the engine with the registry and
    # notifies others that the engine is ready.
    e.start()

    # Do this if you need to see the MayaVi tree view UI.
    ev = EngineView(engine=e)
    ui = ev.edit_traits()

    # Create a new scene.
    scene = e.new_scene()
    # Now create a new scene just for kicks.
    scene1 = e.new_scene()

    # Now setup a normal MayaVi pipeline.
    src = VTKXMLFileReader()
    src.initialize(join(get_data_dir(abspath(__file__)), 'fire_ug.vtu'))
    e.add_source(src)
    e.add_module(Outline())
    e.add_module(ScalarCutPlane())
    e.add_module(Streamline())
    return e, ui