[vtk-developers] Type determination of an input port

Mathieu Westphal mathieu.westphal at kitware.com
Tue Apr 24 05:10:23 EDT 2018


Hi Ronald,

The control for the datatype of the input is quite straightforward in VTK.
Basically you have to implement FillInputPortInformation
And you only need to implement it if you want an input different to the
type of the algorithm you are inheriting from.
Eg, the vtkTransformFilter is a vtkPointSetAlgorithm, but support multiple
input data type :

int vtkTransformFilter::FillInputPortInformation(int vtkNotUsed(port),
                                                 vtkInformation *info)
{
  info->Remove(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE());
  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet");
  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData");
  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkRectilinearGrid");
  return 1;
}


Best,


Mathieu Westphal

On Tue, Apr 24, 2018 at 11:02 AM, Ronald Römer <rroemer at gmail.com> wrote:

> I want to write a new filter and I wonder if it is possible to get the
> type of a connected filter. I want to check it in ProcessRequest. I think
> it can be detected by a method of an vtkInformation instance, but I can't
> find the right key. Unfortunately there is no documentation about
> vtkInformation and the large amount of keys. Is there another way to
> restrict the type of a filter that is connected to an input port?
>
> Best regards
> Ronald
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtk-developers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtk-developers/attachments/20180424/03d27e86/attachment.html>


More information about the vtk-developers mailing list