[Paraview] Remove Input Connections

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Jul 11 16:27:32 EDT 2011


Try this:
Add an attribute clean_command="RemoveAllInputs" to the Input property. (look at the XML for Append filter in filters.xml ). 

Utkarsh

Sent from my iPad

On Jul 8, 2011, at 8:58 AM, Jorge Peña <jorge.pena.pastor at gmail.com> wrote:

> 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!
> 
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> 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
> 
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list