[Paraview] Design of Multiple Input Filter

burlen burlen.loring at gmail.com
Fri Jan 15 13:00:21 EST 2010


It doesn't have to be be a composite data algorithm or operate on 
composite data. There are two options available without delving into 
composite data, 1) make multiple inputs, 2)  make a single input repeatable.


in option 1)

    class vtkMyFilter : public vtkImageDataAlgorithm
    {
    ...
    };

    vtkMyFilter::vtkMyFilter()
    {
    ...
    this->SetNumberOfInputPorts(3);
    }


or in option 2)

    class vtkMyFilter : public vtkImageDataAlgorithm
    {
    ...
    };

    vtkMyFilter::vtkMyFilter()
    {
    ...
    this->SetNumberOfInputPorts(1);
    }

    int vtkMyFilter::FillInputPortInformation(int port, vtkInformation
    *info)
    {
    ...
    info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData");
    info->Set(vtkAlgorithm::INPUT_IS_REPEATABLE(),1);
    }

during request data in option 1) you get a vector of information objects 
each with one dataset, in 2) you get a vector of datasets in one 
information object. The UI differs in the way the inputs are selected, 
option 1) will be more clear that 3 are required.

This is explained (much better) in the user guide along with composite 
data algorithm.


Michael Jackson wrote:
> I have an algorithm that needs to take 3 inputs. All three will be 
> vtkImageData objects using Floating point values. I was wondering, 
> before I even start anything, does the first data set in the pipeline 
> have to be a composite data set so if I apply the filter I can assign 
> specific "pieces" of the composite data set as inputs to the filter I 
> am designing? What would be an example of a filter that takes multiple 
> inputs that I could look at as an example?
>
> Thanks for any help.
> ___________________________________________________________
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson at bluequartz.net
> BlueQuartz Software               Dayton, Ohio
>
>
> _______________________________________________
> 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