Commit 204b6647 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'Loic.Berthe/paraview-Set_NumberOfInputPorts_in_XML'

b688e966

 Set the number of input ports of a vtkProgrammableFilter in a XML plugin.

Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !961
parents cce6d82b b688e966
......@@ -99,6 +99,12 @@ public:
vtkSetStringMacro(PythonPath);
vtkGetStringMacro(PythonPath);
// Description:
// Set the number of input ports
// This function is explicitly exposed to enable a vtkClientServerInterpreter to call it
void SetNumberOfInputPorts(int numberOfInputPorts)
{ this->Superclass::SetNumberOfInputPorts(numberOfInputPorts); }
protected:
vtkPythonProgrammableFilter();
~vtkPythonProgrammableFilter();
......
......@@ -370,6 +370,21 @@ bool vtkSIProxy::CreateVTKObjects(vtkSMMessage* message)
// before properties are created.
this->OnCreateVTKObjects();
// Set the number of input ports
// This will only work for vtkAlgorithm subclasses that explicitly expose the
// otherwise protected method SetNumberOfInputPorts
int numberOfInputPorts=0;
if (element->GetScalarAttribute("input_ports", &numberOfInputPorts))
{
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< this->GetVTKObject()
<< "SetNumberOfInputPorts"
<< numberOfInputPorts
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
}
// Execute post-creation if any
if(this->PostCreation != NULL)
{
......
......@@ -4,7 +4,6 @@ Major API Changes {#MajorAPIChanges}
This page documents major API/design changes between different versions since we
started tracking these (starting after version 4.2).
Changes in 5.2
--------------
......@@ -31,6 +30,21 @@ each of the versions. e.g.
...
target_link_libraries(${target} LINK_PRIVATE ${qt_targets})
###Multiple input ports with vtkPythonProgrammableFilter###
vtkPythonProgrammableFilter can now accept multiple input ports if the number
of input ports is defined in the XML plugin file with the *input_ports* attribute.
The different input ports are then defined with InputProperty having each a
different *port_index*:
<SourceProxy name="Name" class="vtkPythonProgrammableFilter" label="label" input_ports="2">
<InputProperty name="Source" command="SetInputConnection" port_index="0">
[...]
</InputProperty>
<InputProperty name="Target" command="SetInputConnection" port_index="1">
[...]
</InputProperty>
</SourceProxy>
Changes in 5.1
--------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment