simple Module¶
For generated server-side proxies, please refer to Available readers, sources, writers, filters and animation cues
simple is a module for using paraview server manager in Python. It provides a simple convenience layer to functionality provided by the C++ classes wrapped to Python as well as the servermanager module.
A simple example:
from paraview.simple import *
# Create a new sphere proxy on the active connection and register it
# in the sources group.
sphere = Sphere(ThetaResolution=16, PhiResolution=32)
# Apply a shrink filter
shrink = Shrink(sphere)
# Turn the visibility of the shrink object on.
Show(shrink)
# Render the scene
Render()
Scripts generated by ParaView’s Python Tracing, Python state saving, and Catalyst saving use functions in this module.
- paraview.simple.AddCameraLink(viewProxy, viewProxyOther, linkName='')[source]¶
Create a named camera link between two view proxies. If a link with the given name already exists it will be removed first and replaced with the newly created link.
- Parameters
viewProxy (View proxy.) – The first view to link.
viewProxyOther (View proxy.) – The second view to link.
linkName (str) – The name of the link to create. Optional, defaults to automatically generating a link name.
- Returns
The link registration name.
- Return type
str
- paraview.simple.AddLight(view=None)[source]¶
Makes a new light and adds it to the designated or active view.
- Parameters
view – The view to add the light to. Optional, defaults to the active view.
- Returns
The new light
- Return type
paraview.servermanager.Light
- paraview.simple.AddProxyLink(proxy1, proxy2, linkName='', link=None)[source]¶
Create a link between two proxies and return its name.
An instance of a vtkSMProxyLink subclass can be given, otherwise a vtkSMProxyLink is created. This does not link proxy properties. See vtkSMProxyLink.LinkProxyPropertyProxies.
- Parameters
linkName (str) – Name of link to create. If empty, a default one is created for registration. If a link with the given name already exists it will be removed first.
- Returns
The link registration name.
- Return type
str
- paraview.simple.AddRenderViewLink(viewProxy, viewProxyOther, linkName='', linkCameras=False)[source]¶
Create a named view link between two render view proxies.
It also creates links for the AxesGrid proxy property in each view. By default, cameras are not linked.
If a link with the given name already exists it will be removed first and replaced with the newly created link.
- Parameters
viewProxy (View proxy.) – The first view to link.
viewProxyOther (View proxy.) – The second view to link.
linkName (str) – The name of the link to create.
linkCameras – If True, also link the view cameras.
- Returns
The link registration name.
- Return type
str
- paraview.simple.AddSelectionLink(objProxy, objProxyOther, linkName, convertToIndices=True)[source]¶
Create a named selection link between two source proxies. If a link with the given name already exists it will be removed first and repaced with the newly created link.
- Parameters
objProxy (Source proxy) – First proxy to link.
objProxyOther (Source proxy) – Second proxy to link. If None, uses the active source.
linkName (str) – Name of the created link.
convertToIndices (bool) – When True (default value), the input selection will always be converted into an indices-based selection before being applied to outputs.
- paraview.simple.AddViewLink(viewProxy, viewProxyOther, linkName='')[source]¶
Create a view link between two view proxies.
A view link is an extension of a proxy link that also performs rendering when a property changes.
Cameras in the views are not linked.
If a link with the given name already exists it will be removed first and replaced with the newly created link.
- Parameters
viewProxy (View proxy.) – The first view to link.
viewProxyOther (View proxy.) – The second view to link.
linkName (str) – The name of the link to create. Optional, defaults to automatically generating a link name.
- Returns
The link registration name.
- Return type
str
- paraview.simple.AnimateReader(reader=None, view=None)[source]¶
This is a utility function that, given a reader and a view animates over all time steps of the reader.
- Parameters
reader (reader proxy) – The reader source to iterate over. Optional, defaults to the active source.
view (view proxy) – The view to animate. Optional, defaults to the active view.
- Returns
A new animation scene used to play the animation.
- Return type
paraview.simple.AnimationSceneProxy
- paraview.simple.AssignLookupTable(arrayInfo, lutName, rangeOveride=[])[source]¶
Assign a lookup table to an array by lookup table name.
Example usage:
track = GetAnimationTrack("Center", 0, sphere) or arrayInfo = source.PointData["Temperature"] AssignLookupTable(arrayInfo, "Cool to Warm")
- Parameters
arrayInfo (paraview.modules.vtkRemotingCore.vtkPVArrayInformation) – The information object for the array. The array name and its range is determined using the info object provided.
lutName (str) – The name for the transfer function preset.
rangeOveride (2-element tuple or list of floats) – The range to use instead of the range of the array determined using the arrayInfo parameter. Defaults to [], meaning the array info range will be used.
- Returns
True on success, False otherwise.
- Return type
bool
- paraview.simple.AssignViewToLayout(view=None, layout=None, hint=0)[source]¶
Assigns the view provided to the layout provided. If no layout exists, then a new layout will be created.
It is an error to assign the same view to multiple layouts.
- Parameters
view (View proxy.) – The view to assign to the layout. Optional, defaults to the active view.
layout (Layout proxy.) – If layout is None, then either the active layout or an existing layout on the same server will be used.
- Returns
Returns True on success.
- Return type
bool
- paraview.simple.ClearSelection(proxy=None)[source]¶
Clears the selection on the active source.
- Parameters
proxy (Source proxy) – Source proxy whose selection should be cleared.
- paraview.simple.ColorBlocksBy(rep=None, selectors=None, value=None, separate=False)[source]¶
Like
ColorBy()
, set data array by which to color selected blocks within a representation, but color only selected blocks with the specified properties. This will automatically set up the color maps and others necessary state for the representations.- Parameters
rep (Representation proxy) – Must be a representation proxy i.e. the value returned by the
GetRepresentation()
. Optional, defaults to the display properties for the active source, if possible.selectors (list of str) – List of block selectors that choose which blocks to modify with this call.
value (str) – Name of the array to color by.
separate (bool) – Set to True to create a color map unique to this representation. Optional, default is that the color map used will be the global color map ParaView uses for any object colored by an array of the same name.
- paraview.simple.ColorBy(rep=None, value=None, separate=False)[source]¶
Set data array to color a representation by. This will automatically set up the color maps and others necessary state for the representations.
- Parameters
rep (Representation proxy) – Must be a representation proxy i.e. the value returned by the
GetRepresentation()
. Optional, defaults to the display properties for the active source, if possible.value (str) – Name of the array to color by.
separate (bool) – Set to True to create a color map unique to this representation. Optional, defaults to the global color map ParaView uses for any object colored by an array of the same name.
- paraview.simple.Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111, timeout=60)[source]¶
Creates a connection to a server.
- Parameters
ds_host (string) – Data server hostname. Needed to set up a client/data server/render server connection.
ds_port (int) – Data server port to listen on.
rs_host (string) – Render server hostname. Needed to set up a client/data server/render server connection.
rs_port (int) – Render server port to listen on.
timeout (int) – Time in seconds at which the connection is abandoned if not made.
Example usage connecting to a host named “amber”:
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
- paraview.simple.Create2DRenderView(**params)[source]¶
Create the standard 3D render view with the 2D interaction mode turned on. See
CreateView()
for argument documentation
- paraview.simple.CreateBarChartView(**params)[source]¶
Create Bar Chart view. See
CreateView()
for argument documentation
- paraview.simple.CreateComparativeBarChartView(**params)[source]¶
Create comparative Bar Chart view. See
CreateView()
for argument documentation
- paraview.simple.CreateComparativeRenderView(**params)[source]¶
Create Comparative view. See
CreateView()
for argument documentation
- paraview.simple.CreateComparativeXYPlotView(**params)[source]¶
Create comparative XY plot Chart view. See
CreateView()
for argument documentation
- paraview.simple.CreateExtractor(name, proxy=None, registrationName=None)[source]¶
Creates a new extractor and returns it.
- Parameters
name (str, optional) – The type of the extractor to create.
proxy (
paraview.servermanager.Proxy
, optional) – The proxy to generate the extract from. If not specified the active source is used.registrationName – The registration name to use to register the extractor with the ProxyManager. If not specified a unique name will be generated.
- Returns
The extractor created, on success, else None
- Return type
paraview.servermanager.Proxy
or None
- paraview.simple.CreateLayout(name=None)[source]¶
Create a new layout with no active view.
- Parameters
name – The name of the layout. Optional, defaults to an automatically created name.
- paraview.simple.CreateLight()[source]¶
Makes a new light and returns it, unattached to a view.
- Returns
The new light
- Return type
paraview.servermanager.Light
- paraview.simple.CreateLookupTable(**params)[source]¶
Create and return a lookup table.
- Parameters
params – A variadic list of key=value pairs giving values of specific named properties of the lookup table.
- Returns
Lookup table
- Return type
Lookup table proxy
- paraview.simple.CreateParallelCoordinatesChartView(**params)[source]¶
Create Parallel Coordinates Chart view. See
CreateView()
for argument documentation
- paraview.simple.CreatePiecewiseFunction(**params)[source]¶
Create and return a piecewise function.
- Parameters
params – A variadic list of key=value pairs giving values of specific named properties of the opacity function.
- Returns
Piecewise opacity function
- Return type
Opacity functon proxy
- paraview.simple.CreateRenderView(**params)[source]¶
Create standard 3D render view. See
CreateView()
for argument documentation
- paraview.simple.CreateSteerableParameters(steerable_proxy_type_name, steerable_proxy_registration_name='SteeringParameters', result_mesh_name='steerable')[source]¶
Creates a steerable proxy for Catalyst use cases.
- Parameters
steerable_proxy_type_name (str) – Name of the proxy type to create.
steerable_proxy_registration_name (str) – Registration name of the proxy created by this function. If not provided, defaults to “SteeringParameters”.
result_mesh_name (str) – The name of the resulting mesh. If not provided, defaults to “steerable”.
- Returns
Proxy of the specified type.
- Return type
Steerable proxy.
- paraview.simple.CreateTexture(filename=None, trivial_producer_key=None, proxyname=None)[source]¶
Creates and returns a new ImageTexture proxy. The texture is not attached to anything by default but it can be applied to things, for example the view, like so:
GetActiveView().UseTexturedBackground = 1 GetActiveView().BackgroundTexture = CreateTexture("foo.png")
- Parameters
filename (str) – The name of the image file to load as a texture. If can be None, in which case the texture is read from a trivial producer indentified by the trivial_producer_key
trivial_producer_key (str) – Identifier of the texture image source on the server. This is mainly used by scene importers when filename is None.
proxyname (str) – The name for the texture when it is registered in ParaView.
- Returns
The newly created texture.
- Return type
Image texture proxy.
- paraview.simple.CreateView(view_xml_name, **params)[source]¶
Creates and returns the specified proxy view based on its name/label. Also set params keywords arguments as view properties.
- Parameters
view_xml_name – Name of the requested View as it appears in the proxy definition XML. Examples include RenderView, ImageChartView, SpreadSheetView, etc.
params – Dictionary created from named arguments. If one of these arguments is named ‘registrationName’, the string value associated with it will be used as the name of the proxy. That name will appear in the Pipeline Browser of the ParaView GUI, and it is the name to be passed to the FindView() function to find this view. Any additional named arguments will be passed as properties to initialize the view.
- Returns
The created view Python object.
- Return type
- paraview.simple.CreateWriter(filename, proxy=None, **extraArgs)[source]¶
Creates a writer that can write the data produced by the source proxy in the given file format (identified by the extension). This function doesn’t actually write the data, it simply creates the writer and returns it
- Parameters
filename (str) – The name of the output data file.
proxy (Source proxy.) – Source proxy whose output should be written. Optional, defaults to the creating a writer for the active source.
extraArgs (A variadic list of key=value pairs giving values of specific named properties in the writer.) – Additional arguments that should be passed to the writer proxy.
- paraview.simple.CreateXYPlotView(**params)[source]¶
Create XY plot Chart view. See
CreateView()
for argument documentation
- paraview.simple.CreateXYPointPlotView(**params)[source]¶
Create XY plot point Chart view. See
CreateView()
for argument documentation
- paraview.simple.Delete(proxy=None)[source]¶
Deletes the given pipeline source or the active source if no argument is specified.
- Parameters
proxy (Source proxy. Optional, defaults to deleting the active source.) – the proxy to remove
- paraview.simple.Disconnect(ns=None, force=True)[source]¶
Disconnect from the currently connected server and free the active session. Does not shut down the client application where the call is executed.
- Parameters
ns (Dict or None) – Namespace in which ParaView functions were created. Optional, defaults to the namespace returned by globals()
force (bool) – Force disconnection in a simultaneous connection. Optional, defaults to forcing disconnection.
- paraview.simple.EqualizeViewsBoth(layout=None)[source]¶
Equalizes the vertical and horizontal view sizes in the provided layout.
- Parameters
layout (Layout proxy.) – Layout the layout contain the views to equalize. Optional, defaults to the active layout.
- paraview.simple.EqualizeViewsHorizontally(layout=None)[source]¶
Equalizes horizontal view sizes in the provided layout.
- Parameters
layout (Layout proxy.) – Layout the layout contain the views to equalize. Optional, defaults to the active layout.
- paraview.simple.EqualizeViewsVertically(layout=None)[source]¶
Equalizes vertical view sizes in the provided layout.
- Parameters
layout (Layout proxy.) – Layout the layout contain the views to equalize. Optional, defaults to the active layout.
- paraview.simple.ExportTransferFunction(colortransferfunction, opacitytransferfunction, tfname, filename, location=16)[source]¶
Export transfer function to a file. The file will be saved in the new JSON format.
- Parameters
colortransferfunction (Color transfer function proxy.) – The color transfer function to export.
opacitytransferfunction (Opacity transfer function proxy.) – The opacity transfer functon to export, if provided. can be None.
tfname (str) – The name that will be given to the transfer function preset if imported back into ParaView.
filename (str) – Path to file where exported transfer function should be saved.
location (vtkPVServer.ServerFlags enum value) – Where the statefile should be saved, e.g., pass vtkPVSession.CLIENT if the statefile is located on the client system (default value), pass in vtkPVSession.SERVERS if on the server. Optional, defaults to vtkPVSession.CLIENT.
- Returns
True on success, False otherwise.
- paraview.simple.ExportView(filename, view=None, **params)[source]¶
Export a view to the specified output file. Based on the view and file extension, an exporter of the right type will be chosen to export the view.
- Parameters
filename (str) – Name of the exported file.
view (View proxy.) – The view proxy to export. Optional, defaults to the active view.
params – A variadic list of key=value pairs giving values of specific named properties of the exporter.
- paraview.simple.ExtendFileSeries(proxy=None)[source]¶
For a reader proxy that supports reading files series, detect any new files added to the series and update the reader’s filename property.
- Parameters
proxy – Reader proxy that should check for a extended file series. Optional, defaults to extending file series in the active source.
- Returns
True if the operation succeeded, False otherwise
- Return type
bool
- paraview.simple.FetchData(proxy=None, **kwargs)[source]¶
Fetches data from the specified data producer for processing locally. Use this function with caution since this can cause large amounts of data to be gathered and delivered to the client.
If no producer is specified, the active source is used.
Basic Usage
#to fetch data from port 0
dataMap = FetchData(producer)
# to fetch data from a specific port
dataMap = FetchData(OutputPort(producer, 1))
FetchData() does not explicitly update the pipeline. It is expected that the pipeline is already updated. This will simply deliver the current data.
Returns a map where the key is an integer representing a rank and value is the dataset fetched from that rank.
Keyword Parameters
The following keyword parameters can be used to customize the fetchs.
- GatherOnAllRanks (bool/int, optional):
This is used only in symmetric batch (or ParaView-Catalyst) mode. If True, then FetchData() will gather the data on all ranks. Default is to only gather the data on the root node.
- SourceRanks (list(int), optional):
List of ints to specity explicitly the ranks from which to fetch data. By default, data from all ranks is fetched.
- paraview.simple.FindExtractor(registrationName)[source]¶
Returns an extractor with a specific registrationName.
- Parameters
registrationName (str) – Registration name for the extractor.
- Returns
The extractor or None
- Return type
paraview.servermanager.Proxy
or None
- paraview.simple.FindSource(name)[source]¶
Return a pipeline source based on the name that was used to register it with ParaView.
Example usage:
Cone(guiName='MySuperCone') Show() Render() myCone = FindSource('MySuperCone')
- Parameters
name (str) – The name that the pipeline source was registered with during creation or after renaming.
- Returns
The pipeline source if found.
- Return type
Pipeline source proxy.
- paraview.simple.FindTextureOrCreate(registrationName, filename=None, trivial_producer_key=None)[source]¶
Finds or creates a new ImageTexture proxy.
- Parameters
registrationName (str) – The name for the texture when it is registered in ParaView.
filename (str) – Path to the texture image source file. Optional, if not provided, the trivial_producer_key should be provided to tell which image source to use for the texture.
trivial_producer_key (str) – Identifier of the texture image source on the server. This is mainly used by scene importers when filename is None.
- paraview.simple.FindView(name)[source]¶
Return a view proxy based on the name that was used to register it with ParaView.
Example usage:
CreateRenderView(guiName='RenderView1') myView = FindSource('RenderView1')
- Parameters
name (str) – The name that the view was registered with during creation or after renaming.
- Returns
The view if found.
- Return type
View proxy.
- paraview.simple.FindViewOrCreate(name, viewtype)[source]¶
Returns the view if a view with the given name exists and is of the the given viewtype, otherwise creates a new view of the requested type. Note, if a new view is created, it will be assigned to a layout by calling AssignViewToLayout.
- Parameters
name (str) – Name of the view to find.
viewtype (str) – Type of the view to create.
- paraview.simple.GetActiveCamera()[source]¶
Returns the active camera for the active view.
- Returns
The active camera
- Return type
vtkCamera
- paraview.simple.GetActiveSource()[source]¶
Returns the active source.
- Returns
Active pipeline source.
- Return type
Source proxy
- paraview.simple.GetActiveView()[source]¶
Returns the active view.
- Returns
Active view.
- Return type
View proxy.
- paraview.simple.GetActiveViewOrCreate(viewtype)[source]¶
Returns the active view if the active view is of the given type, otherwise creates a new view of the requested type. Note, if a new view is created, it will be assigned to a layout by calling
AssignViewToLayout()
.- Parameters
viewtype (str) – The type of view to access if it is the active view or create if it doesn’t exist.
- Returns
The active view if it is of type viewtype.
- Return type
View proxy.
- paraview.simple.GetAllSettings()[source]¶
Get a list of strings that return valid settings proxy types for the :func:GetSettingsProxy() function.
- Returns
List of valid settings proxy names
- Return type
list of str
- paraview.simple.GetAnimationScene()[source]¶
Returns the application-wide animation scene. ParaView has only one global animation scene. This method provides access to that. You are free to create additional animation scenes directly, but those scenes won’t be shown in the ParaView GUI.
- Returns
The animation scene
- Return type
paraview.servermanager.AnimationScene
- paraview.simple.GetAnimationTrack(propertyname_or_property, index=None, proxy=None)[source]¶
Returns an animation cue for the property. If one doesn’t exist then a new one will be created. Typical usage:
track = GetAnimationTrack("Center", 0, sphere) or track = GetAnimationTrack(sphere.GetProperty("Radius")) or # this returns the track to animate visibility of the active source in # all views. track = GetAnimationTrack("Visibility")
For animating properties on implicit planes etc., use the following signatures:
track = GetAnimationTrack(slice.SliceType.GetProperty("Origin"), 0) or track = GetAnimationTrack("Origin", 0, slice.SliceType)
- paraview.simple.GetBlockColorTransferFunction(selector, arrayname, representation=None, separate=False, **params)[source]¶
Get the color transfer function used to map a data array with the given name to colors in the blocks referred to by a selector expresson.
- Parameters
selector (str) – Selector expression used to select blocks from whom the color transfer should be retrieved.
arrayname (str) – Name of the array whose color transfer function is requested.
representation (Representation proxy.) – Used to modify the array name when using a separate color transfer function. Optional, defaults to the active proxy.
separate (bool) – If True, used to recover the separate color transfer function even if it is not used currently by the representation. Optional, defaults to False.
- Returns
This may create a new color transfer function if none exists, or return an existing one if found.
- Return type
Color transfer function proxy
- paraview.simple.GetCameraTrack(view=None)[source]¶
Returns the camera animation track for the given view.
- Parameters
view (View proxy) – The view whose camera animation track should be retrieved. If no view is specified, the active view will be used. If no existing camera animation track is found, a new one will be created.
- Returns
Camera animation cue
- Return type
paraview.servermanager.CameraAnimationCue
- paraview.simple.GetColorTransferFunction(arrayname, representation=None, separate=False, **params)[source]¶
Get the color transfer function used to map a data array with the given name to colors.
- Parameters
arrayname (str) – Name of the array whose color transfer function is requested.
representation (Representation proxy.) – Used to modify the array name when using a separate color transfer function. Optional, defaults to the active proxy.
separate (bool) – If True, used to recover the separate color transfer function even if it is not used currently by the representation. Optional, defaults to False.
- Returns
This may create a new color transfer function if none exists, or return an existing one if found.
- Return type
Color transfer function proxy
- paraview.simple.GetDisplayProperties(proxy=None, view=None)[source]¶
Identical to GetRepresentation()
- paraview.simple.GetDisplayProperty(*arguments, **keywords)[source]¶
Same as
GetProperty()
, except that if no proxy parameter is passed, it will use the active representation, rather than the active source.
- paraview.simple.GetExtractors(proxy=None)[source]¶
Returns a list of extractors associated with the proxy.
- Parameters
proxy (
paraview.servermanager.Proxy
, optional) – The proxy to return the extractors associated with. If not specified (or is None) then all extractors are returned.- Returns
List of associated extractors if any. May return an empty list.
- Return type
list of
paraview.servermanager.Proxy
- paraview.simple.GetLayout(view=None)[source]¶
Return the layout containing the given view, if any.
- Parameters
view – A view in the layout to be removed. Optional, defaults to the active view.
- Returns
The layout containing the view
- Return type
paraview.servermanager.ViewLayout
- paraview.simple.GetLayoutByName(name)[source]¶
Return the first layout with the given name, if any.
- Parameters
name (str) – Name of the layout
- Returns
The named layout if it exists
- Return type
Layout proxy or None
- paraview.simple.GetLayouts()[source]¶
Returns all the layout proxies.
- Returns
A list of all the layouts.
- Return type
list of layout proxies
- paraview.simple.GetLight(number, view=None)[source]¶
Get a previously added light.
- Parameters
number (int) – The index of the light to obtain.
view (View proxy. Option, if not provided the active view is used.) – The view holding the light.
- Returns
The requested light.
- Return type
paraview.servermanager.Light
or None
- paraview.simple.GetLookupTableNames()[source]¶
Returns a list containing the currently available transfer function preset names.
- Returns
List of currently availabe transfer function preset names.
- Return type
List of str
- paraview.simple.GetMaterialLibrary()[source]¶
Returns the material library for the active session.
- Returns
The material library
- Return type
paraview.servermanager.MaterialLibrary
- paraview.simple.GetNumberOfCallbackThreads(n)[source]¶
Gets the number of threads used by the threaded callback queue that can be used for saving screenshots.
- Parameters
n (int) – Not used
- paraview.simple.GetOpacityTransferFunction(arrayname, representation=None, separate=False, **params)[source]¶
Get the opacity transfer function used to map a data array with the given name to opacities in the blocks referred to by a selector expresson.
- Parameters
arrayname (str) – Name of the array whose opacity transfer function is requested.
representation (Representation proxy.) – Used to modify the array name when using a separate opacity transfer function. Optional, defaults to the active representation.
separate (bool) – If True, used to recover the separate opacity transfer function even if it is not used currently by the representation. Optional, defaults to False.
- Returns
This may create a new opacity transfer function if none exists, or return an existing one if found.
- Return type
Opacity transfer function proxy
- paraview.simple.GetOpenGLInformation(location=16)[source]¶
Recover OpenGL information on either the client or server.
- Parameters
location (vtkPVServer.ServerFlags enum value) – Where the OpenGL information should be retrieved, e.g., pass vtkPVSession.CLIENT if you want OpenGL info from the client system (default value), pass in vtkPVSession.SERVERS if you want the server.
- paraview.simple.GetParaViewSourceVersion()[source]¶
- Returns
the ParaView source version string, e.g., ‘paraview version x.x.x, Date: YYYY-MM-DD’.
- Return type
str
- paraview.simple.GetParaViewVersion()[source]¶
- Returns
The version of the ParaView build in (major, minor) form.
- Return type
2-element tuple
- paraview.simple.GetProperty(*arguments, **keywords)[source]¶
Get one property of the given pipeline object. If keywords are used, you can set the proxy and the name of the property that you want to get as shown in the following example:
GetProperty({proxy=sphere, name="Radius"})
If arguments are used, then you have two cases:
if only one argument is used that argument will be the property name.
if two arguments are used then the first one will be the proxy and the second one the property name.
Several example are given below:
GetProperty({name="Radius"}) GetProperty({proxy=sphereProxy, name="Radius"}) GetProperty( sphereProxy, "Radius" ) GetProperty( "Radius" )
- paraview.simple.GetRenderView()[source]¶
Returns the active view if there is one. Else creates and returns a new view. :return: the active view
- paraview.simple.GetRenderViews()[source]¶
Get all render views in a list. :return: all render views in a list.
- paraview.simple.GetRepresentation(proxy=None, view=None)[source]¶
Given a pipeline proxy and a view, returns the corresponding representation object. If proxy and view are not specified, active objects are used.
- Parameters
proxy (Source proxy) – Pipeline proxy whose representation in the given view is requested. Optional, defaults to the active view.
view (View proxy) – The view associated with the requested representation. Optional, defaults to returning the representation associated with the active view.
- Returns
The representation for the given proxy in the view.
- Return type
Representation proxy
- paraview.simple.GetRepresentationAnimationHelper(sourceproxy)[source]¶
Method that returns the representation animation helper for a source proxy. It creates a new one if none exists.
- paraview.simple.GetRepresentations()[source]¶
Returns all available representation proxies (display properties) in all views.
- Returns
dictionary of representations. Keys are tuples consisting of the registration name and integer ID of the representation proxy, and values are the representation proxies themselves.
- Return type
dict
- paraview.simple.GetScalarBar(ctf, view=None)[source]¶
Returns the scalar bar for the given color transfer function in the given view.
- Parameters
ctf (Color transfer function proxy.) – The color transfer function proxy whose scalar bar representation should be returned.
view (View proxy.) – View from which the scalar bar proxy should be retrieved. Optional, defaults to the active view, if possible.
- Returns
The scalar bar proxy for the color transfer function if found. his will either return an existing scalar bar or create a new one.
- Return type
Scalar bar proxy
- paraview.simple.GetSettingsProxy(type)[source]¶
Given a string giving the type of settings to access, returns the proxy for those settings.
- Parameters
type (str) – The type of settings to access. Valid types may be found by calling
GetAllSettings()
.
- paraview.simple.GetSources()[source]¶
Get all available pipeline sources.
- Returns
dictionary of pipeline sources. Keys are tuples consisting of the registration name and integer ID of the proxy, and values are the pipeline sources themselves.
- Return type
dictionary
- paraview.simple.GetTimeKeeper()[source]¶
Returns the timekeeper proxy for the active session. Timekeeper is often used to manage time step information known to the ParaView application.
- Returns
timekeeper
- Return type
paraview.servermanager.TimeKeeper
- paraview.simple.GetTimeTrack()[source]¶
Returns the animation track used to control the time requested from all sources during playback
- Returns
The time animation track.
- Return type
paraview.servermanager.TimeAnimationCue
- paraview.simple.GetTransferFunction2D(arrayname, array2name=None, representation=None, separate=False, **params)[source]¶
Get the 2D color transfer function used to map a data array with the given name to colors.
- Parameters
arrayname (str) – Name of the first array whose color transfer function is requested.
array2name (str) – Name of the second array whose color transfer function is requested.
representation (Representation proxy.) – Used to modify the array name when using a separate color transfer function. Optional, defaults to the active representation.
separate (bool) – If True, used to recover the separate color transfer function even if it is not used currently by the representation. Optional, defaults to False.
- Returns
This may create a new 2D color transfer function if none exists, or return an existing one if found.
- Return type
2D color transfer function proxy
- paraview.simple.GetViewForLight(proxy)[source]¶
Given a light proxy, find which view it belongs to
- Parameters
proxy (Light proxy) – The light proxy whose view you want to retrieve.
- Returns
The view associated with the light if found, otherwise None
- Return type
View proxy or None
- paraview.simple.GetViewProperties(view=None)[source]¶
Same as
GetActiveView()
. this API is provided just for consistency withGetDisplayProperties()
.
- paraview.simple.GetViewProperty(*arguments, **keywords)[source]¶
Same as
GetProperty()
, except that if no ‘proxy’ parameter is passed, it will use the active view properties, rather than the active source.
- paraview.simple.GetViews(viewtype=None)[source]¶
Returns all views in a list.
- Parameters
viewtype (str) – If provided, only the views of the specified type are returned. Optional, defaults to None.
- Returns
list of views of the given viewtype, or all views if viewtype is None.
- Return type
list of view proxies
- paraview.simple.GetViewsInLayout(layout=None)[source]¶
Returns a list of views in the given layout.
- Parameters
layout (Layout proxy.) – Layout whose views should be returned. Optional, defaults to the layout for the active view, if possible.
- Returns
List of views in the layout.
- Return type
list
- paraview.simple.Hide(proxy=None, view=None)[source]¶
Turns the visibility of a given pipeline source off in the given view. If pipeline object and/or view are not specified, active objects are used.
- Parameters
proxy (Pipeline source proxy to hide.) – The pipeline source. Optional, defaults to the active source.
view (View proxy.) – The view in which the pipeline source should be hidden. Optional, defaults to the active view.
- paraview.simple.HideAll(view=None)[source]¶
Hide all pipeline sources in the given view.
- Parameters
view (View proxy.) – The view in which to hide all pipeline sources. Optional, defaults to the active view.
- paraview.simple.HideInteractiveWidgets(proxy=None)[source]¶
If possible in the current environment, this function will request the application to hide the interactive widget(s) for the given proxy.
- Parameters
proxy (Source proxy.) – The proxy whose associated interactive widgets should be hidden. Optional, if not provided the active source’s widgets are hidden.
- paraview.simple.HideScalarBarIfNotNeeded(lut, view=None)[source]¶
Hides the given scalar bar if it is not used by any of the displayed data.
- Parameters
lut (Scalar bar proxy) – The lookup table (lut) or scalar bar proxy
view – The view in which the scalar bar should be hidden. Optional, defaults to hiding scalar bars in the active view.
- paraview.simple.HideUnusedScalarBars(view=None)[source]¶
Hides all unused scalar bars from the view. A scalar bar is used if some data is shown in that view that is coloring using the transfer function shown by the scalar bar.
- Parameters
view (View proxy) – View in which unused scalar bars should be hidden. Optional, defaults to the active view.
- paraview.simple.ImportPresets(filename, location=16)[source]¶
Import presets from a file. The file can be in the legacy color map XML format or in the new JSON format.
- Parameters
filename (str) – Path of the file containing the presets.
location (vtkPVServer.ServerFlags enum value) – Where the statefile should be save, e.g., pass vtkPVSession.CLIENT if the statefile is located on the client system (default value), pass in vtkPVSession.SERVERS if on the server. Optional, defaults to vtkPVSession.CLIENT.
- Returns
True on success, False otherwise.
- paraview.simple.ImportView(filename, view=None, **params)[source]¶
Import a view from a specified input scene file.
- Parameters
filename (str) – The name of the file to import.
view (View proxy.) – View proxy into which the scene should be imported. Optional, defaults to the active view.
params – A variadic list of key=value pairs giving values of specific named properties of the importer.
- paraview.simple.Interact(view=None)[source]¶
Call this method to start interacting with a view. This method will block until the interaction is done. If the local process cannot support interactions, this method will simply return without doing anything.
- Parameters
view (View proxy.) – The interaction occurs with this view. Optional, defaults to the active view.
- paraview.simple.ListProperties(proxyOrCreateFunction)[source]¶
Given a proxy or a proxy creation function, e.g. paraview.simple.Sphere, returns the list of properties for the proxy that would be created.
- Parameters
proxyOrCreateFunction (Proxy or proxy creation function) – Proxy or proxy creation function whose property names are desired.
- Returns
List of property names
- Return type
List of str
- paraview.simple.LoadCustomFilters(filename, ns=None)[source]¶
Loads a custom filter XML file and updates this module with new constructors if any. If you loaded the simple module with
from paraview.simple import *
, make sure to passglobals()
as an argument.- Parameters
filename (str) – Path to XML file with custom filter definitions.
ns (dict) – Namespace in which new functions will be loaded. Optional, defaults to None.
- paraview.simple.LoadDistributedPlugin(pluginname, remote=True, ns=None)[source]¶
Loads a plugin that’s distributed with the ParaView executable. This uses the information known about plugins distributed with ParaView to locate the shared library for the plugin to load.
- Parameters
pluginname (str) – Short name of the plugin (not a file path)
remote (bool) – If True, loads the plugin on the server unless the connection is not remote. If False, loads the plugin on the client. Optional, defaults to True.
ns (dict) – Namespace in which new functions will be loaded. Optional, defaults to None.
- Raises
RuntimeError – If the plugin was not found.
- paraview.simple.LoadLookupTable(fileName)[source]¶
Load transfer function preset from a file. Both JSON (new) and XML (legacy) preset formats are supported.
- Parameters
fileName (str) – If the filename ends with a .xml, it’s assumed to be a legacy color map XML and will be converted to the new format before processing.
- Returns
True if successful, False otherwise.
- Return type
bool
- paraview.simple.LoadPalette(paletteName)[source]¶
Load a color palette to override the default foreground and background colors used by ParaView views. The current global palette’s colors are set to the colors in the loaded palette.
- Parameters
paletteName (str) – Name of the palette to load from this list: ‘WarmGrayBackground’, ‘DarkGrayBackground’, ‘NeutralGrayBackground’, ‘LightGrayBackground’, ‘WhiteBackground’, ‘BlackBackground’, ‘GradientBackground’.
- paraview.simple.LoadPlugin(filename, remote=True, ns=None)[source]¶
Loads a ParaView plugin and updates this module with new constructors if any. The remote argument (default to
True
) is to specify whether the plugin will be loaded on the client (remote=False
) or on the server (remote=True
).If you loaded the simple module with
from paraview.simple import *
, make sure to passglobals()
as an argument:LoadPlugin("myplugin", False, globals()) # to load on client LoadPlugin("myplugin", True, globals()) # to load on server LoadPlugin("myplugin", ns=globals()) # to load on server
Otherwise, the new functions will not appear in the global namespace.
- Parameters
filename (str) – Path to the plugin to load.
remote (bool) – If True, loads the plugin on the server unless the connection is not remote. If False, loads the plugin on the client. Optional, defaults to True.
ns (dict) – Namespace in which new functions will be loaded. Optional, defaults to None.
- Returns
None
- paraview.simple.LoadPlugins(*args, **kwargs)[source]¶
Loads ParaView plugins and updates this module with new constructors if any. The remote keyword argument (default to
True
) is to specify whether the plugin will be loaded on client (remote=False
) or on server (remote=True
). Proxy definition updates are deferred until all plugins have been read, which can be more computationally efficient when multiple plugins are loaded in sequence.If you loaded the simple module with
from paraview.simple import *
, make sure to passglobals()
as a keyword argument:LoadPlugins("myplugin1", "myplugin2", remote=False, ns=globals()) # to load on client LoadPlugins("myplugin", "myplugin2", remote=True, ns=globals()) # to load on server LoadPlugins("myplugin", "myplugin2", ns=globals()) # to load on server
Otherwise, the new functions will not appear in the global namespace.
Note, remote=True has no effect when the connection is not remote.
- paraview.simple.LoadState(statefile, data_directory=None, restrict_to_data_directory=False, filenames=None, location=16, *args, **kwargs)[source]¶
Load PVSM state file.
This will load the state specified in the statefile.
ParaView can update absolute paths for data files used in the state which can be useful to portably load state file across different systems.
Alternatively, filenames can be used to specify a list of filenames explicitly. This must be list of the following form:
[ { # either 'name' or 'id' are required. if both are provided, 'id' # is checked first. "name" : "[reader name shown in pipeline browser]", "id" : "[reader id used in the pvsm state file]", # all modified filename-like properties on this reader "FileName" : ... .... }, ... ]
Calling this function with other positional or keyword arguments will invoke the legacy signature of this function _LoadStateLegacy.
- Parameters
statefile (str) – Path to the statefile to load
data_directory (str) – If not None, then ParaView searches for files matching those used in the state under the specified directory and if found, replaces the state to use the found files instead. Optional, defaults to None.
restrict_to_data_directory (bool) – If set to True, if a file is not found under the data_directory, it will raise an error, otherwise it is left unchanged. Optional, defaults to False.
filenames (str) – JSON-formatted string to specify a list of filenames.
location (vtkPVServer.ServerFlags enum value) – Where the statefile is located, e.g., pass vtkPVSession.CLIENT if the statefile is located on the client system (default value), pass in vtkPVSession.SERVERS if on the server. Optional, defaults to client.
- paraview.simple.LoadXML(xmlstring, ns=None)[source]¶
Given a server manager XML as a string, parse and process it. If you loaded the simple module with
from paraview.simple import *
, make sure to passglobals()
as the second arguments:LoadXML(xmlstring, globals())
Otherwise, the new functions will not appear in the global namespace.
- Parameters
xmlstring (str) – XML string containing server manager definitions.
ns (dict) – Namespace in which new functions will be defined. Optional, defaults to None.
- paraview.simple.LocateView(displayProperties=None)[source]¶
Returns the view associated with the given displayProperties/representation object if it exists.
- Parameters
displayProperties (representation proxy) – a representation proxy returned by
GetRepresentation()
,GetDisplayProperties()
, orShow()
functions. Optional, defaults to the active representation.- Returns
The view associated with the representation if it exists, otherwise None
- Return type
View proxy or None
- paraview.simple.MakeBlueToRedLT(min, max)[source]¶
Create a LookupTable that go from blue to red using the scalar range provided by the min and max arguments.
- Parameters
min (float) – Minimum range value.
max (float) – Maximum range value.
- Returns
the blue-to-red lookup table
- Return type
Lookup table proxy.
- paraview.simple.OpenDataFile(filename, **extraArgs)[source]¶
Creates a reader to read the give file, if possible. This uses extension matching to determine the best reader possible.
- Returns
Returns a suitable reader if found. If a reader cannot be identified, then this returns None.
- Return type
Reader proxy, or None
- paraview.simple.ReloadFiles(proxy=None)[source]¶
Forces a reader proxy to reload the data files.
- Parameters
proxy (Reader proxy) – Reader proxy whose files should be reloaded. Optional, defaults to reloading files in the active source.
- Returns
Returns True if files reloaded successfully, False otherwise
- Return type
bool
- paraview.simple.RemoveCameraLink(linkName)[source]¶
Remove a camera link with the given name.
- Parameters
linkName (str) – Name of the link to remove.
- paraview.simple.RemoveLayout(proxy=None)[source]¶
Remove the provided layout. If none is provided, remove the layout containing the active view. If it is the only layout it will create a new one with the same name as the removed one.
- Parameters
proxy (Layout proxy or None.) – The layout proxy to remove. Optional, defaults to the layout containing the active view.
- paraview.simple.RemoveLight(light)[source]¶
Removes an existing light from its view.
- Parameters
light (
paraview.servermanager.Light
) – The light to be removed.
- paraview.simple.RemoveLink(linkName)[source]¶
Remove a named link.
- Parameters
linkName (str) – Name of the link to remove.
- paraview.simple.RemoveSelectionLink(linkName)[source]¶
Remove a selection link with the given name.
- Parameters
linkName (str) – Name of the link to remove.
- paraview.simple.RenameLayout(newName, proxy=None)[source]¶
Renames the given layout. If the given proxy is not registered in the ‘layouts’ group this method will have no effect.
- Parameters
newName (str) – The new name of the layout proxy
layout – The layout proxy to rename. It must be a member of the ‘layouts’ groupd. Optional, defaults to renaming the active layout.
- paraview.simple.RenameProxy(proxy, group, newName)[source]¶
Renames the given proxy. This is the name used by
FindSource()
and is displayed in the Pipeline Browser.- Parameters
proxy (Proxy object) – The proxy to be renamed
group (str) – The group in which the proxy lives. Can be retrieved with proxy.GetXMLGroup()
newName (str) – The new name of the proxy.
- paraview.simple.RenameSource(newName, proxy=None)[source]¶
Renames the given source proxy. If the given proxy is not registered in the ‘sources’ group this function will have no effect.
- Parameters
newName (str) – The new name of the source proxy
proxy (Source proxy) – The source proxy to rename. It must be a member of the ‘sources’ group. Optional, defaults to renaming the active source.
- paraview.simple.RenameView(newName, proxy=None)[source]¶
Renames the given view. If the given proxy is not registered in the ‘views’ group this method will have no effect.
- Parameters
newName (str) – The new name of the view proxy
proxy (View proxy) – The view proxy to rename. It must be a member of the ‘views’ group. Optional, defaults to renaming the active view.
- paraview.simple.Render(view=None)[source]¶
Renders the given view if given, otherwise renders the active view. If this is the first render and the view is a RenderView, the camera is reset.
- Parameters
view (View proxy.) – The view to render. Optional, defaults to rendering the active view.
- paraview.simple.ReplaceReaderFileName(readerProxy, files, propName)[source]¶
Replaces the readerProxy by a new one given a list of files.
- Parameters
readerProxy (Reader proxy.) – Reader proxy whose filename should be updated.
files (list of str) – List of file names to be read by the reader.
propName (str) – should be “FileNames” or “FileName” depending on the property name in the reader.
- paraview.simple.ResetCamera(view=None)[source]¶
Resets camera settings to make the whole scene visible while preserving orientation.
- Parameters
view (View proxy.) – The camera for this view is reset. Optional, defaults to the active view.
- paraview.simple.ResetCameraToDirection(position, direction, up=None, view=None)[source]¶
Resets the settings of the camera to the given position and direction.
- Parameters
position (3-element tuple or list of floats.) – Position of the camera.
direction (3-element tuple or list of floats.) – Direction of the camera.
up (3-element tuple or list of floats.) – If provided, will be used as the camera’s up direction.
view (View proxy.) – If provided, modifies the camera in this view.
- paraview.simple.ResetProperty(propertyName, proxy=None, restoreFromSettings=True)[source]¶
Resets a proxy property to its default value.
- Parameters
propertyName (str) – Name of the property to reset.
proxy – The proxy whose property should be reset. Optional, defaults to the active source.
restoreFromSettings (bool) – If True, the property will be reset to the default value stored in the settings if available, otherwise it will be reset to ParaView’s application default value. Optional, defaults to True.
- paraview.simple.ResetSession()[source]¶
Reset the session to its initial state. All pipeline readers, sources, filters extractors, and representations are removed.
- paraview.simple.ReverseConnect(port=11111)[source]¶
Create a reverse connection to a server. First, disconnects from any servers, then listens on port and waits for an incoming connection from the server.
- Parameters
port (int) – The port to listen on for incoming connections.
- Returns
Connection object
- Return type
- paraview.simple.SaveAnimation(filename, viewOrLayout=None, scene=None, location=16, **params)[source]¶
Save animation as a movie file or series of images.
SaveAnimation is used to save an animation as a movie file (avi, mp4, or ogv) or a series of images.
- Parameters
filename (str) – Name of the output file. The extension is used to determine the type of the output. Supported extensions are png, jpg, tif, bmp, and ppm. Based on platform (and build) configuration, avi, mp4, and ogv may be supported as well.
viewOrLayout (View or layout proxy.) – The view or layout to save image from, defaults to None. If None, then the active view is used, if available. To save an image from a single view, this must be set to a view, to save an image from all views in a layout, pass the layout.
scene (Animation scene proxy) – Animation scene to save. If not provided, then the active scene returned by GetAnimationScene is used.
location (vtkPVSession.ServerFlags enum) – Location where the screenshot should be saved. This can be one of the following values: vtkPVSession.CLIENT, vtkPVSession.DATA_SERVER. The default is vtkPVSession.CLIENT.
Keyword Parameters (optional)
SaveAnimation supports all keyword parameters supported by SaveScreenshot. In addition, the following parameters are supported:
- FrameRate (int):
Frame rate in frames per second for the output. This only affects the output when generated movies (avi or ogv), and not when saving the animation out as a series of images.
- FrameWindow (tuple(int,int))
To save a part of the animation, provide the range in frames or timesteps index.
In addition, several format-specific keyword parameters can be specified. The format is chosen based on the file extension.
For Image-based file-formats that save series of images e.g. PNG, JPEG, following parameters are available.
- SuffixFormat (string):
Format string used to convert the frame number to file name suffix.
FFMPEG avi file format supports following parameters.
- Compression (int)
Set to 1 or True to enable compression.
- Quality:
When compression is 1 (or True), this specifies the compression quality. 0 is worst quality (smallest file size) and 2 is best quality (largest file size).
VideoForWindows (VFW) avi file format supports following parameters.
- Quality:
This specifies the compression quality. 0 is worst quality (smallest file size) and 2 is best quality (largest file size).
OGG/Theora file format supports following parameters.
- Quality:
This specifies the compression quality. 0 is worst quality (smallest file size) and 2 is best quality (largest file size).
- UseSubsampling:
When set to 1 (or True), the video will be encoded using 4:2:0 subsampling for the color channels.
- paraview.simple.SaveData(filename, proxy=None, **extraArgs)[source]¶
Save data produced by the proxy parameter into a file.
Properties to configure the writer can be passed in as keyword arguments. Example usage:
SaveData("sample.pvtp", source0) SaveData("sample.csv", FieldAssociation="Points")
- Parameters
filenam – Path where output file should be saved.
proxy (Source proxy.) – Proxy to save. Optional, defaults to saving the active source.
extraArgs – A variadic list of key=value pairs giving values of specific named properties in the writer.
- paraview.simple.SaveExtracts(**kwargs)[source]¶
Generate extracts. Parameters are forwarded for ‘SaveAnimationExtracts’ Currently, supported keyword parameters are:
- Parameters
ExtractsOutputDirectory (str) – root directory for extracts. If the directory does not exist, it will be created.
GenerateCinemaSpecification (bool) – If set to True, enables generation of a cinema specification.
FrameRate (int) – The frame rate in frames-per-second if the extractor supports it.
FrameStride (int) – The number of timesteps to skip after a timestep is saved.
FrameWindow (2-element tuple or list of ints) – The range of timesteps to extract.
- paraview.simple.SaveExtractsUsingCatalystOptions(options)[source]¶
Generate extracts using a
CatalystOptions
object. This is intended for use when a Catalyst analysis script is being run in batch mode.- Parameters
options (
CatalystOptions
) – Catalyst options proxy
- paraview.simple.SaveScreenshot(filename, viewOrLayout=None, saveInBackground=False, location=16, **params)[source]¶
Save screenshot for a view or layout (collection of views) to an image.
SaveScreenshot is used to save the rendering results to an image.
- Parameters
filename (str) – Name of the image file to save to. The filename extension is used to determine the type of image file generated. Supported extensions are png, jpg, tif, bmp, and ppm.
viewOrLayout (View or layout proxy. Optional.) – The view or layout to save image from, defaults to None. If None, then the active view is used, if available. To save image from a single view, this must be set to a view, to save an image from all views in a layout, pass the layout.
saveInBackground (bool) – If set to True, the screenshot will be saved by a different thread and run in the background. In such circumstances, one can wait until the file is written by calling
WaitForScreenshot(filename)()
.location (vtkPVSession.ServerFlags enum) – Location where the screenshot should be saved. This can be one of the following values: vtkPVSession.CLIENT, vtkPVSession.DATA_SERVER. Optional, defaults to vtkPVSession.CLIENT.
Keyword Parameters (optional)
- ImageResolution (tuple(int, int))
A 2-tuple to specify the output image resolution in pixels as (width, height). If not specified, the view (or layout) size is used.
- FontScaling (str)
Specify whether to scale fonts proportionally (“Scale fonts proportionally”) or not (“Do not scale fonts”). Defaults to “Scale fonts proportionally”.
- SeparatorWidth (int)
When saving multiple views in a layout, specify the width (in approximate pixels) for a separator between views in the generated image.
- SeparatorColor (tuple(float, float, float))
Specify the color for separator between views, if applicable.
- OverrideColorPalette (:obj:str, optional)
Name of the color palette to use, if any. If none specified, current color palette remains unchanged.
- StereoMode (str)
Stereo mode to use, if any. Available values are “No stereo”, “Red-Blue”, “Interlaced”, “Left Eye Only”, “Right Eye Only”, “Dresden”, “Anaglyph”, “Checkerboard”, “Side-by-Side Horizontal”, and the default “No change”.
- TransparentBackground (int)
Set to 1 (or True) to save an image with background set to alpha=0, if supported by the output image format.
In addition, several format-specific keyword parameters can be specified. The format is chosen based on the file extension.
For JPEG (*.jpg), the following parameters are available (optional)
- Quality (int) [0, 100]
Specify the JPEG compression quality. O is low quality (maximum compression) and 100 is high quality (least compression).
- Progressive (int):
Set to 1 (or True) to save progressive JPEG.
For PNG (*.png), the following parameters are available (optional)
- CompressionLevel (int) [0, 9]
Specify the zlib compression level. 0 is no compression, while 9 is maximum compression.
Legacy Parameters
Prior to ParaView version 5.4, the following parameters were available and are still supported. However, they cannot be used together with other keyword parameters documented earlier.
- view (proxy)
Single view to save image from.
- layout (proxy)
Layout to save image from.
- magnification (int)
Magnification factor to use to save the output image. The current view (or layout) size is scaled by the magnification factor provided.
- quality (int)
Output image quality, a number in the range [0, 100].
- paraview.simple.SaveState(filename, location=16)[source]¶
Save a ParaView statefile (.pvsm) to disk on a system provided by the location parameter.
- Parameters
filename (str) – Path where the state file should be saved.
location (vtkPVServer.ServerFlags enum value) – Where the statefile should be save, e.g., pass vtkPVSession.CLIENT if the statefile is located on the client system (default value), pass in vtkPVSession.SERVERS if on the server.
- paraview.simple.SelectCells(query=None, proxy=None)[source]¶
Select cells satisfying the query.
- Parameters
query (str) – The selection query. If None, then all cells are selected.
proxy (Source proxy) – The source proxy to select from. Optional, defaults to the active source.
- Returns
Selection source
- Return type
servermanager.sources.SelectionQuerySource
- paraview.simple.SelectPoints(query=None, proxy=None)[source]¶
Select points satisfying the query.
- Parameters
query (str) – The selection query. If None, then all points are selected.
proxy (Source proxy) – The source proxy to select from. Optional, defaults to the active source.
- Returns
Selection source
- Return type
servermanager.sources.SelectionQuerySource
- paraview.simple.SetActiveConnection(connection=None, ns=None)[source]¶
Set the active connection. If the process was run without multi-server enabled and this method is called with a non-None argument while an ActiveConnection is present, it will raise a RuntimeError.
- Parameters
connection (Connection object.) – If provided, changes the current connection.
ns – Namespace in which functions from the old Connection are removed and functions in the new Connection are added.
- Raises
RuntimeError – If called when ParaView is not running in multi-server mode, a RuntimeError will be raised.
- paraview.simple.SetActiveSource(source)[source]¶
Sets the active source.
- Parameters
source (Source proxy) – The source
- paraview.simple.SetActiveView(view)[source]¶
Sets the active view.
- Parameters
view (View proxy.) – The view to make active.
- paraview.simple.SetDisplayProperties(proxy=None, view=None, **params)[source]¶
Sets one or more display properties of the given pipeline source.
Pass a list of property_name=value pairs to this function to set property values. For example:
SetProperties(Color=[1, 0, 0], LineWidth=2)
- Parameters
proxy (Source proxy) – Pipeline source whose display properties should be set. Optional, defaults to the active source.
view (View proxy) – The view in which to make the display property changes. Optional, defaults to the active view.
- paraview.simple.SetNumberOfCallbackThreads(n)[source]¶
Sets the number of threads used by the threaded callback queue that can be used for saving screenshots.
- Parameters
n (int) – Number of callback threads.
- paraview.simple.SetNumberOfSMPThreads(n)[source]¶
Sets the number of threads used by vtkSMPTools. It is used in various filters.
- paraview.simple.SetProperties(proxy=None, **params)[source]¶
Sets one or more properties of the given pipeline source. If an argument is not provided, the active source is used. Pass in arguments of the form property_name=value to this function to set property values. For example:
SetProperties(Center=[1, 2, 3], Radius=3.5)
- Parameters
proxy (Source proxy) – The pipeline source whose properties should be set. Optional, defaultst to the active source.
params – A variadic list of key=value pairs giving values of specific named properties in the pipeline source. For a list of available properties, call help(proxy).
- paraview.simple.SetViewProperties(view=None, **params)[source]¶
Sets one or more properties of the given view. If an argument is not provided, the active view is used. Pass in arguments of the form property_name=value to this function to set property values. For example:
SetProperties(Background=[1, 0, 0], UseImmediateMode=0)
- Parameters
view (View proxy.) – The view whose properties are to be set. If not provided, the active view is used.
params – A variadic list of key=value pairs giving values of specific named properties in the view. For a list of available properties, call help(view).
- paraview.simple.Show(proxy=None, view=None, representationType=None, **params)[source]¶
Turns on the visibility of a given pipeline proxy in the given view. If pipeline proxy and/or view are not specified, active objects are used.
- Parameters
proxy (Source proxy.) – The pipeline proxy to show. If not provided, uses the active source.
view (View proxy.) – The view proxy to show the source proxy in. Optional, defaults to the active view.
representationType (str) – Name of the representation type to use. Optional, defaults to a suitable representation for the source proxy and view.
- Returns
The representation proxy for the source proxy in the view.
- Return type
Representation proxy.:
- paraview.simple.ShowAll(view=None)[source]¶
Show all pipeline sources in the given view.
- Parameters
view (View proxy. Optional, defaults to the active view.) – The view in which to show all pipeline sources.
- paraview.simple.ShowInteractiveWidgets(proxy=None)[source]¶
If possible in the current environment, this function will request the application to show the interactive widget(s) for the given proxy.
- Parameters
proxy (Source proxy.) – The proxy whose associated interactive widgets should be shown. Optional, if not provided the active source’s widgets are shown.
- paraview.simple.UpdatePipeline(time=None, proxy=None)[source]¶
Updates (executes) the given pipeline object for the given time as necessary (i.e., if it did not already execute).
- Parameters
time (float) – The time at which to update the pipeline. Optional, defaults to updating the currently loaded timestep.
proxy (Source proxy.) – Source proxy to update. Optional, defaults to updating the active source.
- paraview.simple.UpdateScalarBars(view=None)[source]¶
Hides all unused scalar bars and shows used scalar bars. A scalar bar is used if some data is shown in that view that is coloring using the transfer function shown by the scalar bar.
- Parameters
view (View proxy) – The view in which scalar bar visibility should be changed. Optional, defaults to using the active view.
- paraview.simple.UpdateScalarBarsComponentTitle(ctf, representation=None)[source]¶
Update the component portion of the title in all scalar bars using the provided lookup table. The representation is used to recover the array from which the component title was obtained.
- Parameters
ctf (Transfer function proxy.) – The lookup table that the scalar bar represents. Optional, defaults to the representation of the active source in the active view.
representation (Representation proxy) – If provided, it is the representation to use to recover the array that provides the component title portion. Optional, defaults to the active representation.
- Returns
True if operation succeeded, False otherwise.
- Return type
bool
- paraview.simple.UpdateSteerableParameters(steerable_proxy, steerable_source_name)[source]¶
Updates a steerable proxy of a provided source name.
- Parameters
steerable_proxy (Source proxy.) – The steerable proxy to update.
steerable_source_name (str) – The name of the steerable source proxy.
- paraview.simple.WaitForScreenshot(filename=None)[source]¶
Pause this thread until saving a screenshot has terminated.
- Parameters
filename (str) – Path where screenshot should be saved. If no filename is provided, then this thread pauses until all screenshots have been saved.
- paraview.simple.WriteAnimationGeometry(filename, view=None)[source]¶
Save the animation geometry from a specific view to a file specified. The animation geometry is written out as a PVD file.
- Parameters
filename (str) – The file path of the PVD file to write.
view (View proxy) – The view holding the geometry that should be saved. Optional, defaults to the active view if possible.