[Paraview] Remove Input Connections

Jorge Peña jorge.pena.pastor at gmail.com
Fri Jul 8 10:58:56 EDT 2011


Hi all,

I have being trying to remove an input from a filter with multi-inputs without 
succes.

My filter.xml is as follows:

 <SourceProxy name="MyFilter" class="vtkMyFilter" label="MyFilter">
     <InputProperty
        name="Input"
		port_index="0"
		immediate_update="1"
		command="AddInputConnection"
		repeatable="1"
		>
           <ProxyGroupDomain name="groups">
             <Group name="sources"/>
             <Group name="filters"/>
           </ProxyGroupDomain>
           <DataTypeDomain name="input_type">
             <DataType value="vtkDataImage"/>
           </DataTypeDomain>
      </InputProperty>
</SourceProxy>

I add connections in my code using vtkSMInputProperty:

vtkSMProperty* p  = pipelineSource_myFilter->getProxy()->GetProperty("Input");
vtkSMInputProperty *inputProp = vtkSMInputProperty::SafeDownCast(p);
 
inputProp->AddInputConnection(pipelineSource_input->getProxy(),0);


What I had tried so far is:

1) to add a RemoveInputConnection in the xml file, but I get the following 
runtime error:
vtkProcessModule (0x8f4030): Object type: vtkMyFilter, could not find requested 
method: "RemoveInputConnection"

2) to add a fake port, and then redirect AddInputConnections calls to that 
port to RemoveInputConnection method withthe normal port
This method works in which concers to vtkMyFilter, but the pqPipeline is not 
updated properly...So I get the following error when I try to remove 
pipelineSource_input: Cannot remove source with consumers.

Please, can you help me to understand which is the proper way to deal with 
adding/removing multiple inputs of a filter in Paraview based applications?

Thanks in advance!





More information about the ParaView mailing list