<s> """<STR_LIT>""" <EOL> from os . path import join , abspath , dirname <EOL> from mayavi . scripts import mayavi2 <EOL> from mayavi . sources . vtk_xml_file_reader import VTKXMLFileReader <EOL> from mayavi . sources . vrml_importer import VRMLImporter <EOL> from mayavi . modules . outline import Outline <EOL> from mayavi . modules . streamline import Streamline <EOL> from mayavi . modules . iso_surface import IsoSurface <EOL> def setup_data ( fname ) : <EOL> """<STR_LIT>""" <EOL> r = VTKXMLFileReader ( ) <EOL> r . initialize ( fname ) <EOL> mayavi . add_source ( r ) <EOL> return r <EOL> def show_vrml ( fname ) : <EOL> """<STR_LIT>""" <EOL> r = VRMLImporter ( ) <EOL> r . initialize ( fname ) <EOL> mayavi . add_source ( r ) <EOL> return r <EOL> def streamline ( ) : <EOL> """<STR_LIT>""" <EOL> o = Outline ( ) <EOL> mayavi . add_module ( o ) <EOL> s = Streamline ( streamline_type = '<STR_LIT>' ) <EOL> mayavi . add_module ( s ) <EOL> s . stream_tracer . integration_direction = '<STR_LIT>' <EOL> s . seed . widget . center = <NUM_LIT> , <NUM_LIT> , <NUM_LIT> <EOL> s . module_manager . scalar_lut_manager . show_scalar_bar = True <EOL> i = IsoSurface ( ) <EOL> mayavi . add_module ( i ) <EOL> i . contour . contours [ <NUM_LIT:0> ] = <NUM_LIT> <EOL> i . actor . property . opacity = <NUM_LIT:0.5> <EOL> @ mayavi2 . standalone <EOL> def main ( ) : <EOL> mayavi . new_scene ( ) <EOL> data_dir = mayavi2 . get_data_dir ( dirname ( abspath ( __file__ ) ) ) <EOL> vrml_fname = join ( data_dir , '<STR_LIT>' ) <EOL> r = show_vrml ( vrml_fname ) <EOL> fname = join ( data_dir , '<STR_LIT>' ) <EOL> r = setup_data ( fname ) <EOL> streamline ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
