You should be able to do:<br><br>int MyFilter::FillInputPortInformation(int port,<br>                                           vtkInformation* info)<br>{<br>  if (port == 0)<br>    {<br>    info-&gt;Remove(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE());<br>
    info-&gt;Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), &quot;vtkUnstructuredGrid&quot;);<br>    info-&gt;Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),<br>                 &quot;vtkStructuredGrid&quot;);<br>    return 1;<br>
    }<br>  return 0;<br>}<br><br>Andy<br><br><div class="gmail_quote">On Fri, Nov 11, 2011 at 5:25 AM, Fred Fred <span dir="ltr">&lt;<a href="mailto:stan1313@hotmail.fr">stan1313@hotmail.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div><div dir="ltr">
Hello,<div>I have a filter, inherited from vtkUnstructuredGridAlgorithm, which can process both structured and unstructured grids, but the only way I found to restrict the valid inputs is:</div><div><div><br></div><div>  int MyFilter::FillInputPortInformation(int vtkNotUsed(port), vtkInformation *info)</div>
<div>  {</div><div>    info-&gt;Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), &quot;vtkPointSet&quot;);</div><div>    return 1;</div><div>  }</div></div><div><br></div><div>so it means that I can connect a vtkPolyData set to my filter, which is a mistake actually.</div>
<div>How could I set vtkStructuredGrid and vtkUnstructuredGrid as the only valid input types?</div><div><br></div>                                               </div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>