<div dir="ltr">In all honestly, this is not easy to pull off. Readers in VTK don't have consistent API, as a result it's going to be very tricky to expose properties on this new meta-reader that can work across all readers. <div><br></div><div>The problem you're specifically facing is that readers like PNGReader (and several others) use meta-readers themselves to support things that the original reader doesn't support e.g. reader file series. Also, `vtkSMReaderFactory::GetReaderName` returns the name for the reader proxy, not the class name for the reader.</div><div><br></div><div>Utkarsh</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 17, 2017 at 11:30 AM, Jonathan Borduas <span dir="ltr"><<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="FR-CA" link="#0563C1" vlink="#954F72">
<div class="m_-8264770358272862346WordSection1">
<p class="MsoNormal"><span lang="EN-CA">Hi Paraviewers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">Got a bit of a challenge here.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">I</span><span lang="EN-CA" style="font-family:"Times New Roman",serif">’</span><span lang="EN-CA">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.  <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">All the implementations I saw use a If statement:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><a href="https://github.com/Kitware/ParaView/blob/b41d27999a4ac854f4a0e61d98d09c53e7583a60/ParaViewCore/ClientServerCore/Default/vtkNetworkImageSource.cxx" target="_blank">https://github.com/Kitware/<wbr>ParaView/blob/<wbr>b41d27999a4ac854f4a0e61d98d09c<wbr>53e7583a60/ParaViewCore/<wbr>ClientServerCore/Default/<wbr>vtkNetworkImageSource.cxx</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">But I would like to have something in sync with the available readers.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">For now I use something similar to: <u></u>
<u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-CA">const char *readerName = readerFactory->GetReaderName()<wbr>;<br>
vtkObject *object = vtkObjectFactory::<wbr>CreateInstance( readerName );</span><img border="0" width="32" height="32" style="width:.3333in;height:.3333in" id="m_-8264770358272862346Rectangle_x0020_2" src="cid:image001.png@01D270B5.107C9FC0" alt="https://www.upwork.com/messages/rooms/room_38bea0513672a1d805f45ad03c83519e"><span lang="EN-CA"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">But for a .PNG file I receive as readerName
</span><span lang="EN-CA" style="font-family:"Times New Roman",serif">“</span><span lang="EN-CA">vtkImageFileSeriesReader</span><span lang="EN-CA" style="font-family:"Times New Roman",serif">”</span><span lang="EN-CA"> instead of "vtkPNGReader".
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">So basically my question is: <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">How can I get a proper vtk reader class from a filename with extension?<br>
<br>
Thank you very much,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">Jonathan Borduas<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA">CTO, Caboma Inc. <u></u><u></u></span></p>
</div>
</div>

<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=Paraview-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/paraview-<wbr>developers</a><br>
<br></blockquote></div><br></div>