cpstate Module

This module is used to by the CoProcessingScriptGenerator plugin to aid in capturing ParaView state as CoProcessing python script.

This can capture the ParaView state in a Pipeline object that can then be used in CoProcessing scripts. The entry point into this module is the function DumpPipeline() which returns the Python trace script. Most of the other functions can be considered internal.

Also refer to paraview.cpexport Module which is used to generate a complete Python CoProcessing script that can be used with in a vtkCPPythonScriptPipeline.

class paraview.cpstate.ArrayAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

Augments traces of filters by defining names of arrays to be explored.

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.ClipAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

augments traces of clip filters with information to explore the parameter space for cinema playback (if enabled)

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.ContourAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

augments traces of contour filters with information to explore the parameter space for cinema playback (if enabled)

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
paraview.cpstate.DumpPipeline(export_rendering, simulation_input_map, screenshot_info, cinema_tracks, cinema_arrays)[source]

Method that will dump the current pipeline and return it as a string trace - export_rendering : boolean telling if we want to export rendering - simulation_input_map: string->string map with key being the proxyname

while value being the simulation input name.
  • screenshot_info
    : map with information about screenshots

    key -> view proxy name value -> [filename, writefreq, fitToScreen,

    magnification, width, height, cinemacamera options]

  • cinema_tracks
    : map with information about cinema tracks to record

    key -> proxy name value -> argument ranges

  • cinema_arrays
    : map with information about value arrays to be exported

    key -> proxy name value -> list of array names

class paraview.cpstate.ProducerAccessor(varname, proxy, simname)[source]

Bases: paraview.smtrace.RealProxyAccessor

This accessor is created instead of the standard one for proxies that have been marked as simulation inputs. This accessor override the trace_ctor() method to trace the constructor as the CreateProducer() call, since the proxy is a dummy, in this case.

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.SliceAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

augments traces of slice filters with information to explore the parameter space for cinema playback (if enabled)

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.ViewAccessor(varname, proxy, proxyname)[source]

Bases: paraview.smtrace.RealProxyAccessor

Accessor for views. Overrides trace_ctor() to trace registering of the view with the coprocessor. (I wonder if this registering should be moved to the end of the state for better readability of the generated state files.

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.WriterAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

Accessor for writers. Overrides trace_ctor() to use the actual writer proxy name instead of the dummy-writer proxy’s name. Also updates the write_frequencies maintained in cpstate_globals with the write frequencies for the writer.

get_proxy_label(xmlgroup, xmlname)[source]
trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.WriterFilter[source]

Bases: paraview.smtrace.PipelineProxyFilter

should_never_trace(prop)[source]

overridden to never trace ‘WriteFrequency’ and ‘FileName’ properties on writers.

paraview.cpstate.cp_hook(varname, proxy)[source]

callback to create our special accessors instead of the standard ones.

class paraview.cpstate.cpstate_filter_proxies_to_serialize[source]

Bases: object

filter used to skip views and representations a when export_rendering is disabled.

class paraview.cpstate.cpstate_globals[source]
cinema_arrays = {}
cinema_tracks = {}
export_rendering = False
screenshot_info = {}
simulation_input_map = {}
view_proxies = []
write_frequencies = {}
paraview.cpstate.locate_simulation_inputs(proxy)[source]

Given any sink/filter proxy, returns a list of upstream proxies that have been flagged as ‘simulation input’ in the state exporting wizard.

paraview.cpstate.locate_simulation_inputs_for_view(view_proxy)[source]

Given a view proxy, retruns a list of source proxies that have been flagged as the ‘simulation input’ in the state exporting wizard.

paraview.cpstate.reset_cpstate_globals()[source]
paraview.cpstate.run(filename=None)[source]

Create a dummy pipeline and save the coprocessing state in the filename specified, if any, else dumps it out on stdout.