[Paraview-developers] How can I get a proper vtk reader class from a filename with extension

Jonathan Borduas jonathan.borduas at caboma.com
Tue Jan 17 11:30:12 EST 2017


Hi Paraviewers,

Got a bit of a challenge here.

I'm trying to create a plugin with a custom reader, that is subclass of a vtkMetaReader, so it can read any file via readers registered with ParaView.

All the implementations I saw use a If statement:

https://github.com/Kitware/ParaView/blob/b41d27999a4ac854f4a0e61d98d09c53e7583a60/ParaViewCore/ClientServerCore/Default/vtkNetworkImageSource.cxx

But I would like to have something in sync with the available readers.

For now I use something similar to:

const char *readerName = readerFactory->GetReaderName();
vtkObject *object = vtkObjectFactory::CreateInstance( readerName );[https://www.upwork.com/messages/rooms/room_38bea0513672a1d805f45ad03c83519e]

But for a .PNG file I receive as readerName "vtkImageFileSeriesReader" instead of "vtkPNGReader".

So basically my question is:

How can I get a proper vtk reader class from a filename with extension?

Thank you very much,

Jonathan Borduas
CTO, Caboma Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20170117/cf9aa8d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 174 bytes
Desc: image001.png
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20170117/cf9aa8d2/attachment.png>


More information about the Paraview-developers mailing list