TestPythonView.xml 9.78 KB
Newer Older
1
2
3
4
<?xml version="1.0" ?>
<pqevents>
  <pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar" command="set_tab_with_text" arguments="+" />
  <pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar" command="set_tab_with_text" arguments="Layout #2" />
5
6
7
8
  <pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget2/Frame.0/CentralWidgetFrame/EmptyView/scrollArea/qt_scrollarea_viewport/widgetFoo/ConvertActionsFrame/PythonView" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget2/Frame.0/CentralWidgetFrame/Viewport" command="mousePress" arguments="(0.330739,0.347905,1,1,0)" />
  <pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget2/Frame.0/CentralWidgetFrame/Viewport" command="mouseMove" arguments="(0.330739,0.347905,1,0,0)" />
  <pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget2/Frame.0/CentralWidgetFrame/Viewport" command="mouseRelease" arguments="(0.330739,0.347905,1,0,0)" />
9
10
11


  <!-- Set the script -->
12
13
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/Script/1pqPopOutWidget0/Script/qt_scrollarea_viewport" command="mousePress" arguments="1,1,0,157,31" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/Script/1pqPopOutWidget0/Script/qt_scrollarea_viewport" command="mouseRelease" arguments="1,0,0,157,31" />
14
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="set_string" arguments="from paraview import vtk&#xA;from paraview.vtk import vtkDataObject&#xA;from paraview.vtk.util import numpy_support&#xA;import matplotlib.style&#xA;import matplotlib as mpl&#xA;mpl.style.use('classic')&#xA;&#xA;def setup_data(view):&#xA;  numVisibleObjects = view.GetNumberOfVisibleDataObjects()&#xA;  for i in range(numVisibleObjects):&#xA;    dataObject = view.GetVisibleDataObjectForSetup(i)&#xA;    if dataObject:&#xA;      pd = dataObject.GetPointData()&#xA;&#xA;      # Enable desired arrays&#xA;      desiredArrays = [&quot;X&quot;, &quot;Y&quot;, &quot;Z&quot;]&#xA;      for arrayName in desiredArrays:&#xA;        view.SetAttributeArrayStatus(i, vtkDataObject.POINT, arrayName, 1)&#xA;&#xA;def render(view, width, height):&#xA;  from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas&#xA;  from matplotlib.figure import Figure&#xA;&#xA;  figure = Figure()&#xA;  figureCanvas = FigureCanvas(figure)&#xA;  figure.set_dpi(72)&#xA;  figure.set_size_inches(float(width)/72.0, float(height)/72.0)&#xA;&#xA;  # Set the border color of the figure&#xA;&#xA;  ax = figure.add_subplot(1,1,1, facecolor=&quot;white&quot;)&#xA;  numVisibleObjects = view.GetNumberOfVisibleDataObjects()&#xA;  for i in range(numVisibleObjects):&#xA;    dataObject = view.GetVisibleDataObjectForRendering(i)&#xA;    if dataObject:&#xA;      pd = dataObject.GetPointData()&#xA;      xArray = pd.GetArray(&quot;X&quot;)&#xA;      yArray = pd.GetArray(&quot;Y&quot;)&#xA;      zArray = pd.GetArray(&quot;Z&quot;)&#xA;      if not xArray or not yArray or not zArray:&#xA;        continue&#xA;&#xA;      np_xArray = numpy_support.vtk_to_numpy(xArray)&#xA;      np_yArray = numpy_support.vtk_to_numpy(yArray)&#xA;      np_zArray = abs(300*numpy_support.vtk_to_numpy(zArray))&#xA;&#xA;      if xArray != None and yArray != None and zArray != None:&#xA;        ax.scatter(np_xArray, np_yArray, np_zArray, alpha=0.5)&#xA;&#xA;  from paraview import python_view&#xA;  image = python_view.figure_to_image(figure)&#xA;&#xA;  return image" />
15
16
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="key" arguments="16777220" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="key" arguments="16777217" />
17

18
19
  <pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
  <pqevent object="pqClientMainWindow/menubar/menuSources" command="activate" arguments="PointSource" />
20
21
22
23
24
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/NumberOfPoints/LineEdit0" command="set_string" arguments="10" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/NumberOfPoints/LineEdit0" command="set_string" arguments="100" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/NumberOfPoints/LineEdit0" command="set_string" arguments="1000" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Radius/LineEdit0" command="key" arguments="46" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Radius/LineEdit0" command="set_string" arguments="0.5" />
25
26
27
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
  <pqevent object="pqClientMainWindow/menubar/menuSources" command="activate" arguments="PointSource" />
28
29
30
31
32
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/NumberOfPoints/LineEdit0" command="set_string" arguments="10" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/NumberOfPoints/LineEdit0" command="set_string" arguments="100" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/NumberOfPoints/LineEdit0" command="set_string" arguments="1000" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Radius/LineEdit0" command="key" arguments="46" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Radius/LineEdit0" command="set_string" arguments="0.5" />
33
34
35
36
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/menubar/menuFilters/pqProxyGroupMenuManager0/Calculator" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="key" arguments="16777248" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="set_string" arguments="X" />
37
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Function/Function" command="set_string" arguments="coordsX" />
38
39
40
41
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/menubar/menuFilters/pqProxyGroupMenuManager0/Calculator" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="key" arguments="16777248" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="set_string" arguments="Y" />
42
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Function/Function" command="set_string" arguments="coordsY" />
43
44
45
46
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/menubar/menuFilters/pqProxyGroupMenuManager0/Calculator" command="activate" arguments="" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="key" arguments="16777248" />
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="set_string" arguments="Z" />
47
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Function/Function" command="set_string" arguments="coordsZ" />
48
49
  <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
</pqevents>