[vtkusers] [vtkUsers] Multiple Input ports in a ParaView Plugin

Nicolas Silva nicolas.silva at insa-lyon.fr
Wed Jul 7 10:31:30 EDT 2010


Hi,
I'm trying to make ParaView plugins with several input ports.
When I try to use the Filter in paraview, a dialog window proposes me
to set each input's connection, so i select a source for eahc input
and then i get the following error :

ERROR: In /home/nico/Dev/Stage
Liris/ParaView-3.8.0/VTK/Filtering/vtkDemandDrivenPipeline.cxx, line
727
vtkCompositeDataPipeline (0xa4973e0): Input port 1 of algorithm
vtkMultiPortFilter(0xa411aa8) has 0 connections but is not optional.


My class derives from vtkImageAlgorithm, in the constructor i have this :

vtkMultiPortFilter::vtkMultiPortFilter()
{
this->SetNumberOfInputPorts(NB_INPUTS);
this->SetNumberOfOutputPorts(NB_OUTPUTS);
}


I also overloaded these two methods :

int vtkMultiPortFilter::FillOutputPortInformation(int port,
vtkInformation* info)
{
  if(!this->Superclass::FillOutputPortInformation(port, info))
    {
    return 0;
    }
  info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkImageData");
  return 1;
}

int vtkMultiPortFilter::FillInputPortInformation( int port,
vtkInformation* info )
{
 if(port < NB_INPUTS){
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData" );
return 1;
}

  return 0;
}


and here is my server manager xml file:

<ServerManagerConfiguration>
  <ProxyGroup  name="filters">

    <SourceProxy
      name="MultiPortFilter"
      class="vtkMultiPortFilter"
      label="MultiPortFilter">
      <InputProperty name="Input0" command="SetInputConnection">
        <ProxyGroupDomain name="groups">
          <Group name="sources" />
          <Group name="filters" />
        </ProxyGroupDomain>
        <DataTypeDomain name="input_type">
          <DataType value="vtkImageData" />
        </DataTypeDomain>
      </InputProperty>
      <InputProperty name="Input1" command="SetInputConnection">
        <ProxyGroupDomain name="groups">
          <Group name="sources" />
          <Group name="filters" />
        </ProxyGroupDomain>
        <DataTypeDomain name="input_type">
          <DataType value="vtkImageData" />
        </DataTypeDomain>
      </InputProperty>
<!--gui params here-->

    </SourceProxy>
  </ProxyGroup>
</ServerManagerConfiguration>

Do someone have an idea about what's wrong in my source code ?

Thanks in advance,


Nicolas Silva



More information about the vtkusers mailing list