CreateExtractor ( rawProxy, name, registrationName ) extractor = servermanager. vtkSMExtractsController () rawExtractor = controller. :type name: `str`, optional :return: The extractor created, on success, else None :rtype: :class:`` or `None` """ if proxy is None : proxy = GetActiveSource () if not proxy : raise RuntimeError ( "Could determine input for extractor" ) if proxy. If not specified a unique name will be generated. :type proxy: :class:``, optional :param registrationName: The registration name to use to register the extractor with the ProxyManager. If not specified `GetActiveSource()` is used. :type name: `str` :param proxy: The proxy to generate the extract from. :param name: The type of the extractor to create. def CreateExtractor ( name, proxy = None, registrationName = None ): """ Creates a new extractor and returns it. tail import IsInsitu, RegisterView if IsInsitu (): # tag the view to know which pipeline this came from. MakeRenderWindowInteractor ( True ) from. This overcomes the problem where VTK # segfaults if the interactor is created after the window was created. UseColorPaletteForBackground = 0 # setup an interactor if current process support interaction if an # interactor hasn't already been set. GetVersion () <= ( 5, 9 ): if hasattr ( view, "UseColorPaletteForBackground" ): view. GetVersion () <= ( 5, 6 ): # older versions automatically assigned view to a # layout. RegisterViewProxy ( view, registrationName ) if paraview. PreInitializeProxy ( view ) SetProperties ( view, ** params ) controller. ParaViewPipelineController () controller. _create_view ( view_xml_name ) if not view : raise RuntimeError ( "Failed to create requested view", view_xml_name ) try : registrationName = params del params except KeyError : try : registrationName = params del params except KeyError : registrationName = None controller = servermanager. Also set params keywords arguments as view properties. def CreateView ( view_xml_name, ** params ): """Creates and returns the specified proxy view based on its name/label. Connect ( ds_host, ds_port, rs_host, rs_port, timeout ) if not ( connection is None ): _initializeSession ( connection ) _add_functions ( globals ()) return connection #. Example usage:: > Connect("amber") # Connect to a single server at default port > Connect("amber", 12345) # Connect to a single server at port 12345 > Connect("amber", 11111, "vis_cluster", 11111) # connect to data server, render server pair > Connect("amber", timeout=30) # Connect to a single server at default port with a 30s timeout instead of default 60s > Connect("amber", timeout=-1) # Connect to a single server at default port with no timeout instead of default 60s > Connect("amber", timeout=0) # Connect to a single server at default port without retrying instead of retrying for the default 60s""" Disconnect ( globals (), False ) connection = servermanager. def Connect ( ds_host = None, ds_port = 11111, rs_host = None, rs_port = 11111, timeout = 60 ): """Creates a connection to a server. selection import * import sys import warnings if sys. from rvermanager import OutputPort # Bring in selection from. Show(shrink) # Render the scene Render() """ from _future_ import absolute_import, division, print_function import paraview from paraview import servermanager import paraview._backwardscompatibilityhelper from import vtkPVSession # Bring OutputPort in our namespace. sphere = Sphere(ThetaResolution=16, PhiResolution=32) # Apply a shrink filter shrink = Shrink(sphere) # Turn the visibility of the shrink object on. A simple example:: from paraview.simple import * # Create a new sphere proxy on the active connection and register it # in the sources group. It provides a simple convenience layer to functionality provided by the C++ classes wrapped to Python as well as the servermanager module. # SPDX-License-Identifier: BSD-3-Clause r """simple is a module for using paraview server manager in Python. # SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |