[Paraview] Filter Plugin w/ multiple connections

David Fuentes fuentesdt at gmail.com
Tue May 5 19:08:03 EDT 2009


What is the proper way to write a filter plugin for paraview w/ multiple
connections and access the data from each connection?

I have been trying to use the vtkProgrammableFilter,
vtkPythonProgrammableFilter, vtkMultiBlockDataGroupFilter, and
vtkTemporalStaticsFilter as examples.

int vtkMyFilterPlugin::RequestData(
   vtkInformation *vtkNotUsed(request),
   vtkInformationVector **inputVector,
   vtkInformationVector *outputVector)

   int numInputs = inputVector[0]->GetNumberOfInformationObjects();
   for (int idx = 0; idx < numInputs; ++idx)
      vtkInformation *inInfo = inputVector[0]->GetInformationObject(idx);

      vtkDataObject *input = vtkDataObject::GetData(inInfo);

      vtkDataSet *inputDataSet  = vtkDataSet::SafeDownCast( input) ;


where numInputs = the number of connections to my Filter.
vtkDataSet::SafeDownCast(input) returns a NULL pointer when I have
multiple connections to the filter but works for ONE connection.
How do I get the pointer(s) that will let me access the vtkDataArray
for each connection to my filter? ie

      vtkPointData *pd=inputDataSet->GetPointData();
      int numArrays = pd->GetNumberOfArrays();
      for (int i = 0; i < numArrays; i++)
          vtkDataArray *array = pd->GetArray(i);


More information about the ParaView mailing list