當前位置: 首頁>>代碼示例>>Python>>正文


Python null_engine.NullEngine類代碼示例

本文整理匯總了Python中mayavi.core.null_engine.NullEngine的典型用法代碼示例。如果您正苦於以下問題:Python NullEngine類的具體用法?Python NullEngine怎麽用?Python NullEngine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了NullEngine類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setUp

    def setUp(self):

        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        # e = Engine()
        e.start()
        s = e.new_scene()

        image_data = BuiltinImage()
        e.add_source(image_data)

        outline = Outline()
        e.add_module(outline)

        surface = Surface()
        e.add_module(surface)

        image_data.data_source.radius = array([80.0, 80.0, 80.0])
        image_data.data_source.center = array([150.0, 150.0, 0.0])
        image_data.data_source.whole_extent = array([10, 245, 10, 245, 0, 0])
        if is_old_pipeline():
            image_data.data_source.update_whole_extent()
        else:
            image_data.data_source.set_update_extent_to_whole_extent()

        self.e = e
        self.scene = e.current_scene

        return
開發者ID:B-Rich,項目名稱:mayavi,代碼行數:29,代碼來源:test_builtin_image.py

示例2: get_null_engine

    def get_null_engine(self):
        """Return a suitable null engine and make that the current
        engine.
        """
        # First check if the current engine is running and if it is in
        # the registered engines.
        ce = self.current_engine
        if ce is not None:
            if not ce.running or ce not in registry.engines.values():
                self.current_engine = None

        if self.current_engine is not None:
            engines = list((self.current_engine,))
        else:
            engines = list()
        engines.extend(registry.engines.values())
        engine = None
        for e in engines:
            if e.__class__.__name__ == 'NullEngine':
                engine = e
                break
        else:
            engine = NullEngine(name='Null Mlab Engine')
            engine.start()
        self.current_engine = engine
        return engine
開發者ID:GaelVaroquaux,項目名稱:mayavi,代碼行數:26,代碼來源:engine_manager.py

示例3: setUp

    def setUp(self):
        """Initial setting up of test fixture, automatically called by
        TestCase before any other test method is invoked"""

        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        # e = Engine()
        e.start()
        s = e.new_scene()

        poly_data = BuiltinSurface()
        e.add_source(poly_data)

        outline = Outline()
        e.add_module(outline)

        surface = Surface()
        e.add_module(surface)

        poly_data.data_source.shaft_radius = 0.05
        poly_data.data_source.shaft_resolution = 7
        poly_data.data_source.tip_radius = 0.1

        self.e = e
        self.scene = e.current_scene

        return
開發者ID:Thirumalesh-HS,項目名稱:mayavi,代碼行數:27,代碼來源:test_builtin_surface.py

示例4: setUp

 def setUp(self):
     e = NullEngine()
     e.start()
     registry.register_engine(e)
     engine_manager.current_engine = e
     self.e = e
     self.s = e.new_scene()
     self.s.scene = DummyScene()
開發者ID:PerryZh,項目名稱:mayavi,代碼行數:8,代碼來源:test_mouse_pick_dispatcher.py

示例5: setUp

    def setUp(self):
        # Create dataset with multiple scalars.
        arr1 = zeros(27, 'f')
        for n in range(27):
            arr1[n] = (1+float(n))/10.0
        arr2 = (arr1 + 1).astype('d')
        arr3 = arr1 + 2.0*(0.5 - random.random(27))
        arr3 = arr3.astype('f')

        p = tvtk.ImageData(dimensions=[3,3,3],spacing=[1,1,1],
                scalar_type='int')
        p.point_data.scalars = arr1
        p.point_data.scalars.name = 'first'
        j2 = p.point_data.add_array(arr2)
        p.point_data.get_array(j2).name='second'
        j3 = p.point_data.add_array(arr3)
        p.point_data.get_array(j3).name='third'
        p.update()
        self.img = p
        self.first = arr1
        self.second = arr2
        self.third = arr3

        # Setup the mayavi pipeline.
        e = NullEngine()
        e.start()
        e.new_scene()
        self.e = e

        src = VTKDataSource(data=p)
        e.add_source(src)
        self.src = src
        ipw = ImagePlaneWidget()
        e.add_module(ipw)
        self.ipw = ipw
開發者ID:GaelVaroquaux,項目名稱:mayavi,代碼行數:35,代碼來源:test_ipw_multiple_scalars.py

示例6: new_engine

    def new_engine(self):
        """ Creates a new engine, envisage or not depending on the
            options.
        """
        check_backend()
        if options.backend == "envisage":
            from mayavi.plugins.app import Mayavi

            m = Mayavi(start_gui_event_loop=False)
            m.main()
            process_ui_events()
            window = m.application.workbench.active_window
            engine = window.get_service(Engine)
        elif options.backend == "test":
            engine = NullEngine(name="Null Mlab Engine")
            engine.start()
        else:
            if options.offscreen:
                engine = OffScreenEngine(name="Mlab offscreen Engine")
                engine.start()
            else:
                engine = Engine(name="Mlab Engine")
                engine.start()
        self.current_engine = engine
        return engine
開發者ID:B-Rich,項目名稱:mayavi,代碼行數:25,代碼來源:engine_manager.py

示例7: setUp

    def setUp(self):
        """Initial setting up of test fixture, automatically called by TestCase
           before any other test method is invoked"""

        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        #from mayavi.core.engine import Engine
        #e = Engine()
        e.start()
        e.new_scene()
        self.e = e
開發者ID:PerryZh,項目名稱:mayavi,代碼行數:11,代碼來源:test_cut_plane.py

示例8: setUp

 def setUp(self):
     """Initial setting up of test fixture, automatically called by TestCase
     before any other test method is invoked"""
     e = NullEngine()
     #Uncomment to see visualization for debugging etc.
     #e = Engine()
     e.start()
     e.new_scene()
     self.e=e
     self.scene = e.current_scene
     return
開發者ID:PerryZh,項目名稱:mayavi,代碼行數:11,代碼來源:test_registry.py

示例9: setUp

    def setUp(self):

        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        #e = Engine()
        e.start()
        self.e = e
        s = e.new_scene()
        self.scene = e.current_scene

        self.setup_reader()
        self.setup_viz()
        return
開發者ID:GaelVaroquaux,項目名稱:mayavi,代碼行數:13,代碼來源:data_reader_test_base.py

示例10: create_fn

 def create_fn():
     e = NullEngine()
     e.start()
     e.new_scene()
     e.new_scene()
     e.new_scene()
     return e
開發者ID:PerryZh,項目名稱:mayavi,代碼行數:7,代碼來源:test_garbage_collection.py

示例11: setUp

    def setUp(self):

        self.root = tempfile.mkdtemp()
        abc1 = os.path.join(self.root, "abc_1.vti")
        abc2 = os.path.join(self.root, "abc_2.vti")
        def1 = os.path.join(self.root, "def_1.vti")
        def2 = os.path.join(self.root, "def_2.vti")
        xyz1 = os.path.join(self.root, "xyz_1.vti")
        cube = get_example_data("cube.vti")
        self.abc1, self.abc2 = abc1, abc2
        self.def1, self.def2 = def1, def2
        self.xyz1 = xyz1
        self.cube = cube
        for i in (abc1, abc2, def1, def2, xyz1):
            shutil.copy(cube, i)

        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        # e = Engine()
        e.start()
        e.new_scene()
        self.engine = e
開發者ID:prabhuramachandran,項目名稱:mayavi,代碼行數:22,代碼來源:test_file_timestep.py

示例12: setUp

 def setUp(self):
     e = NullEngine()
     e.start()
     e.new_scene()
     scene = e.scenes[-1]
     s = ParametricSurface()
     e.add_source(s)
     o = Outline()
     s.add_child(o)
     o1 = Outline()
     s.add_child(o1)
     self.scene = scene
     self.e = e
     self.s = s
     self.o = o
     self.o1 = o1
     return
開發者ID:arkyaC,項目名稱:mayavi,代碼行數:17,代碼來源:test_core_common.py

示例13: setUp

    def setUp(self):
        """Initial setting up of test fixture, automatically called by TestCase before any other test method is invoked"""
        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        #e = Engine()
        e.start()
        s=e.new_scene()
        self.e=e
        self.s=s

        ############################################################
        # Create a new scene and set up the visualization.

        d = ArraySource()
        sc = self.make_data()
        d.scalar_data = sc

        e.add_source(d)
        self.t = Text3D()
        e.add_module(self.t)

        self.scene = e.current_scene
        return
開發者ID:PerryZh,項目名稱:mayavi,代碼行數:23,代碼來源:test_text3d.py

示例14: setUp

    def setUp(self):
        """Initial setting up of test fixture, automatically called by TestCase before any other test method is invoked"""
        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        #e = Engine()
        e.start()
        e.new_scene()
        self.e=e

        sgrid=datasets.generateStructuredGrid()
        src = VTKDataSource(data = sgrid)
        e.add_source(src)

        c = Contour()
        # `name` is used for the notebook tabs.
        n = PolyDataNormals(name='Normals')
        o = Optional(filter=n, label_text='Compute normals')
        coll = Collection(filters=[c, o], name='IsoSurface')
        e.add_filter(coll)
        s = Surface()
        e.add_module(s)
        self.coll = coll
        self.scene = e.current_scene
        return
開發者ID:PerryZh,項目名稱:mayavi,代碼行數:24,代碼來源:test_optional_collection.py

示例15: setUp

    def setUp(self):
        """Initial setting up of test fixture, automatically called by TestCase before any other test method is invoked"""
        e = NullEngine()
        # Uncomment to see visualization for debugging etc.
        #e = Engine()
        e.start()
        e.new_scene()
        self.e=e

        r = VTKXMLFileReader()
        r.initialize(get_example_data('pyramid_ug.vtu'))
        e.add_source(r)
        r.point_scalars_name = 'temperature'
        o = Outline()
        e.add_module(o)
        c = Contour()
        e.add_filter(c)
        n = PolyDataNormals()
        e.add_filter(n)
        aa = SetActiveAttribute()
        e.add_filter(aa)
        aa.point_scalars_name = 'pressure'
        s = Surface()
        e.add_module(s)
        self.scene = e.current_scene
        return
開發者ID:dmsurti,項目名稱:mayavi,代碼行數:26,代碼來源:test_set_active_attribute.py


注:本文中的mayavi.core.null_engine.NullEngine類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。