[vtk-developers] naming/accessing pipeline inputs

David Doria daviddoria+vtk at gmail.com
Sun Nov 1 11:35:10 EST 2009


1) At the beginning of a RequestData function for a filter, this is
typically the first thing:

  // get the info object
  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);

  // get the input
  vtkPolyData *input = vtkPolyData::SafeDownCast(

inInfo->Get(vtkDataObject::DATA_OBJECT()));

If there are multiple inputs, do I need to do:
  vtkInformation *inInfo = inputVector[0]->GetInformationObject(1); //1
instead of 0 here? Or should it be inputVector[1]?

  // get the second input input
  vtkPolyData *input1 = vtkPolyData::SafeDownCast(

inInfo->Get(vtkDataObject::DATA_OBJECT()));

to get the second input? Is there a way to access the inputs by a name
instead of depending on the order? That is, instead of saying first input,
second input, etc, can you say MyBigInput, MyOtherInput so the order does
not matter?

2) In my FillInputPortInformation function, I have been doing: (for a filter
with 4 inputs)

  if (!this->Superclass::FillInputPortInformation(port, info))
    {
    return 0;
    }
  if ( port >= 0 && port <=3 )
    {
    info->Set( vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData" );
    return 1;
    }

It seems that 'port' is never used anywhere - is this the correct way to
tell the pipeline the type of the 4 inputs? Is the correct 'info' object
automatically passed when the FillInputPortInformation function is called
with the corresponding port number?

3) When making a Paraview plugin for a vtk filter, in the XML I will do
something like
      <InputProperty
         name="Source"

to tell Paraivew to make an input connection. Since these inputs are not
named in the vtk filter, is paraview associating the first InputProperty
that appears in the xml with input 0 of the filter, etc?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091101/b615fb9f/attachment.html>


More information about the vtk-developers mailing list