<div dir="ltr"><div><div>Hi Ronald,<br><br></div>The control for the datatype of the input is quite straightforward in VTK. Basically you have to implement FillInputPortInformation<br>And you only need to implement it if you want an input different to the type of the algorithm you are inheriting from.<br>Eg, the vtkTransformFilter is a vtkPointSetAlgorithm, but support multiple input data type :<br><br>int vtkTransformFilter::FillInputPortInformation(int vtkNotUsed(port),<br>                                                 vtkInformation *info)<br>{<br>  info->Remove(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE());<br>  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet");<br>  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData");<br>  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkRectilinearGrid");<br>  return 1;<br>}<br><br><br></div><div>Best,<br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mathieu Westphal<br></div></div></div>
<br><div class="gmail_quote">On Tue, Apr 24, 2018 at 11:02 AM, Ronald Römer <span dir="ltr"><<a href="mailto:rroemer@gmail.com" target="_blank">rroemer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>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?</span><div><span><br></span></div><div><span>Best regards </span></div><span class="HOEnZb"><font color="#888888"><div><span>Ronald </span></div>
</font></span><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div>