[Paraview] problems with repeatable input to filter
Burlen Loring
burlen.loring at kitware.com
Fri Feb 20 10:07:26 EST 2009
Hi,
I wrote one a while back and I did it another way.
in the constructor:
this->SetNumberOfInputPorts(2);
add a couple of methods like this:
void vtkBlahFilter::SetDataSet1Connection(vtkAlgorithmOutput* algOutput)
{
this->SetInputConnection(0, algOutput);
}
void vtkBlahFilter::SetDataSet2Connection(vtkAlgorithmOutput* algOutput)
{
this->SetInputConnection(0, algOutput);
}
in request data, the two data set are in the first two information
vector entries:
vtkInformation *inInfo;
inInfo = inputVector[0]->GetInformationObject(0);
dataSet1=vtkBlahDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
inInfo = inputVector[1]->GetInformationObject(0);
dataSet2=vtkBlahDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
in the filters.xml:
<InputProperty
name="Input"
command="SetDataSet1Connection">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type">
<DataType value="vtkBlahDataSet"/>
</DataTypeDomain>
</InputProperty>
<InputProperty
name="Source"
command="SetDataSet2Connection">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type">
<DataType value="vtkBlahDataSet"/>
</DataTypeDomain>
</InputProperty>
I think that is all. Not sure it's the best way, but it worked.
Natalie Happenhofer wrote:
> Hi!
> I´m trying to write a filter with multiple inputs, in my case I need
> two datasets as input to this filter. In order to achieve that, I have
> the following routine in my code:
>
> int vtkTauFilter::FillInputInformation(int port, vtkInformation* info)
> {
> info -> Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),"vtkDataSet");
> info -> Set(vtkAlgorithm::INPUT_IS_REPEATABLE(), 1);
> return 1;
> }
>
> and I put in the /Servers/ServerManager/Resources/filters.xml file the
> following:
>
> <SourceProxy name="TauFilter" class="vtkTauFilter" label="TauFilter">
> ....
> <InputProperty name="Input" command="AddInputConnection"
> clean_command="RemoveAllInputs" multiple_input="1">
> <ProxyGroupDomain name="groups">
> <Group name="sources"/>
> <Group name="filters"/>
> </ProxyGroupDomain>
>
> ...
> </SourceProxy>
>
>
> Compiling Paraview works fine, but I get the error:
> ERROR: In /ParaView-3.4.0/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 732
> vtkCompositeDataPipeline (0x357dd50): Input port 0 of algorithm
> vtkTauFilter(0x357bff0) has 2 connections but is not repeatable.
>
> Does anyone know what´s could be the problem here?
>
> thx a lot,
> Natalie
>
>
> ------------------------------------------------------------------------
> ¡Tienes 25 GB gratis para usar en Fotos de Windows Live! Estas
> vacaciones diviértete sacando fotos. <http://photos.live.com/>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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