Adding a new MeshIO Reader

I am trying to implement a new MeshIO reader to use inside a CMB plugin. I have derived a class from MeshIO, implemented read() and importMesh(). Furthermore, I have written a second class that adds the reader to smtk::io::ImportMesh.SupportedIOTypes (via the STARTUP functionality in paraview_plugin_add_auto_start) . I can conform that this registration is actually performed while loading the plugin.
However, I am not able to access the reader through the Modelbuilder GUI - the file type which it should add support for is not listed. So, I must have missed something, but I cannot figure out from the documentation. While further investigating the code I found out that the built-in readers somehow are processed by the pqSMTKRegisterImportersBehavior, but it is not clear to me how I can register my own reader here. Can somebody give some advice on this?

You may want to follow the instance of MeshIOVTK; in it, there are AutoInit_Construct and AutoInit_Destruct methods that you may be missing. Also, make sure your MeshIO class adds file types and extensions to its Formats instance. These are used during dispatch. Finally, you can break/put print statements in smtk/io/ImportMesh.cxx's call operators to see which importer is considered and how the importer is making its selection.

the built-in readers somehow are processed by the pqSMTKRegisterImportersBehavior, but it is not clear to me how I can register my own reader here

This should happen automatically, so you don’t need to worry about it.

Privacy Notice