Loading .so plugin to C++


I am new to VTK and hope asking question to correct place.

I am trying to implement c++ code and I want to use a custom paraview plugin an old collegue prepared. It is a .so file. I want to do is as it is done in plug in:

paraview.servermanager.LoadPlugin(‘libPythonTest.so’) [in my case its all c++ classes and more.]
import helloworld

Is there an elegant and nice way to do so ?

Best regards,

Not just any old library is a ParaView plugin. There’s some infrastructure around the code that needs to be there to tell ParaView about it.

Is your plugin code public? If it is just C++ code, the AdiosPixieReader plugin should serve as a decent example for what is necessary.

1 Like

No, no. This is a plugin library. On python I am able to use it with the code such as loadplugin in paraview.simple.

but I want to use full function of the same library, in c++. Loading it getting data and more.

I am not trying to turn some random c++ code into paraview library :slight_smile:

Ah, I see now. Let me restate to see if I understand:

  • there’s an old ParaView plugin you have the binary for
  • you can load it into ParaView
  • you want to use the code in the plugin from new C++ code you want to write

Is that correct?

If so, you’ll need the headers for the classes in the library to be able to use them in new C++ code. Though I suppose you could reuse the ParaView plugin loading to get access to the QPluigin instances. Some raw Qt code would probably work as well. However, VTK classes tend not to be QObjects, so any of Qt’s metaprogramming facilities will likely be unavailable on them and you’ll still need headers to actually use them.