[Paraview] PythonProgrammableFilters Multiple Input Ports

Gaël Grail gael.grail at gmail.com
Fri Jun 1 03:33:01 EDT 2018


Hi Bane,

I'm using the binary version of Paraview available in Kitware's website, so
I don't know much about what should be written in the C code.
But in the xml, I'm using this and it works perfectly:

<ServerManagerConfiguration>
  <ProxyGroup name="filters">
    <SourceProxy class="vtkPythonProgrammableFilter"
                 label="toto"
                 name="To To">
  <InputProperty clean_command="RemoveAllInputs"
                     command="AddInputConnection"
                     multiple_input="2"
                     name="Inputs">
<ProxyGroupDomain name="groups">
<Group name="sources" />
<Group name="filters" />
  </ProxyGroupDomain>
  </InputProperty>
...

Hope this helps,

Gaël

2018-06-01 2:40 GMT+02:00 Bane Sullivan <banesulli at gmail.com>:

> Hi there,
>
> I see an old thread here: https://paraview.markmail.org/thread/
> z7cy73444s7fjadk about setting multiple input ports for python
> programmable filters but I cannot get this to work.
>
> I want to declare multiple input ports in a ServerManagerConfiguration XML
> plugin but I have been unable to successfully add more than one input port
> to the vtkPythonProgrammableFilter.
>
> I see that in `paraview/ParaViewCore/ClientServerCore/Core/vtkPythonProgrammableFilter.h`
> the following is declared:
>
>   /**
>    * Set the number of input ports
>    * This function is explicitly exposed to enable a
> vtkClientServerInterpreter to call it
>    */
>   void SetNumberOfInputPorts(int numberOfInputPorts) VTK_OVERRIDE
>   {
>     this->Superclass::SetNumberOfInputPorts(numberOfInputPorts);
>   }
>
>
> This leads me to believe that the functionality is there, but how exactly
> would I set the number of input ports from an XML plugin for a Programmable
> Filter? I have tried the following with no luck:
>
> <ServerManagerConfiguration>
>  <ProxyGroup name="filters">
>    <SourceProxy
> name="TestMuliPort”
> class="vtkPythonProgrammableFilter”
> label=“TestMuliPort”
> post_creation=“SetNumberOfInputPorts"
> arguments="2”>
> ……..
>
>
> I get the following ERROR:
>
> ERROR: In /Users/kitware/dashboards/buildbot-slave/8275bd07/build/
> superbuild/paraview/src/ParaViewCore/ServerImplementation/Core/vtkPVSessionCore.cxx,
> line 371
> vtkPVSessionCore (0x60c0000d4510): Object type:
> vtkPythonProgrammableFilter, could not find requested method:
> "SetNumberOfInputPorts"
> or the method was called with incorrect arguments.
>
> while processing
> Message 0 = Invoke
>   Argument 0 = vtk_object_pointer {vtkPythonProgrammableFilter
> (0x60c0003abde0)}
>   Argument 1 = string_value {SetNumberOfInputPorts}
>
>
>
> Any help would be greatly appreciated,
>
> Bane
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> ParaView discussion is moving! Please visit https://discourse.paraview.
> org/ for future posts.
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180601/532a595a/attachment.html>


More information about the ParaView mailing list