【正文】
triggers the writing index+=1 Accessing data directly ? In clientserver configurations, the python script is run on the client while the data processing and hence the data is on the server ? Generally use DataInformation to obtain information about the data on the client ? () can be used to deliver data to the client ? Modes of operation for Fetch() ? Append all of the data together and bring it to the client (only available for polygonal and unstructured datasets). Note: Do not do this if data is large otherwise the client will run out of memory. ? Bring data from a given process to the client. ? Use a reduction algorithm and bring its output to the client. For example, find the minimum value of an attribute. ? To fetch the appended data on the client: data = (source) ? To fetch data from a particular processes dataP1 = (source, 1) ? To fetch the sum of values for each attribute arrays mm =() = “SUM” sumdata = (source, mm, mm) ? sumdata is polydata with 1 point (and 1 cell) with cell/point arrays containing the sum of all the values in that array across all the processess. State Files ? ParaView state files capture the state of the client including all pipeline objects, their parameter values, animation setup. ? State files a humanreadable XML files which can be edited for minor tweaking such as changing data file names etc. Loading state saved from GUI () (filename) Obtain the first render view (for multiple view use GetRenderViews()) view = () () ProxyManager is use to access objects created by loading the state file. pxm = () Print the list of available sources/filters loaded from the state. sources_map = (sources) for proxy_name in (): print proxy_name Now we want to change the PhiResolution for the Sphere1 print Changing Phi and Theta resolution of the sphere to 20. sphere1 = (sources, Sphere1) = 20 = 20 Loading state saved from GUI () The state file has a animation set up. To play the animation locate the animation scene and then simply call Play() on it. animation_map = (animation) animation_scene = None for proxy in (): if () == AnimationScene: animation_scene = proxy if animation_scene: () Scripting for pvbatch ? Same as pvpython except ? It can be run in parallel ? One cannot connect to remote server (only () calls are supported) ? The python script is run on the 0th node Scripting from within GUI ? Things to remember ? Don?t use () or (). All connection related operation have to be done using the GUI ? is automatically setup to refer to the connection made by the GUI ? The python shell and the GUI are both working on the same engine hence changes in one will have effects on the other Scripting from within GUI () Create a sphere sphere = (PhiResolution=20, ThetaResolution=20) Register the sphere so that the GUI can access it through the proxy manager. (sphere, registrationName=SphereFromPython) Get the first render view in the GUI. gui_view = () Show the sphere in that view. repr1 = (sphere, gui_view) Make the GUI aware of this representation. (repr1) = Wireframe“ Create a new view view2 = () (view2) repr2 = (sphe