[Paraview] INPUT_REQUIRED_DATA_TYPE()

Andy Bauer andy.bauer at kitware.com
Fri Nov 11 12:00:46 EST 2011


You should be able to do:

int MyFilter::FillInputPortInformation(int port,
                                           vtkInformation* info)
{
  if (port == 0)
    {
    info->Remove(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE());
    info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkUnstructuredGrid");
    info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
                 "vtkStructuredGrid");
    return 1;
    }
  return 0;
}

Andy

On Fri, Nov 11, 2011 at 5:25 AM, Fred Fred <stan1313 at hotmail.fr> wrote:

>  Hello,
> 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:
>
>   int MyFilter::FillInputPortInformation(int vtkNotUsed(port),
> vtkInformation *info)
>   {
>     info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet");
>     return 1;
>   }
>
> so it means that I can connect a vtkPolyData set to my filter, which is a
> mistake actually.
> How could I set vtkStructuredGrid and vtkUnstructuredGrid as the only
> valid input types?
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20111111/a15d25b4/attachment.htm>


More information about the ParaView mailing list