Adding a custom 3D Widget to a ParaView plugin

Hello,

I am working on a project where I need an interactive widget in a custom plugin within ParaView. My plugin is C++ based (built with CMake) and will be loaded into ParaView (built from source). The end goal here is to use two input datasets where one is used to generate the 3D widget, and then through user interaction of the widget, modify the other dataset. However, I’m not sure where to begin! Are there examples or resources for how to

  1. build custom 3D widgets for interacting with the ParaView viewport
  2. adding 3D interactive widgets to C++ based plugins
  3. initializing widgets with data from an input port within the plugin

Thanks in advance!

So widget in the VTK sense, not the Qt sense ?

Definitely not an easy unless you already know about VTK widgets.
Starting point would be to take a look into the design of existing widgets in VTK.

Modern widgets uses a widget/representation duality. You can take a look at
VTK/Interaction/Widgets/vtkLightWidget\Representation

Once you are implemented your widget, you need to expose it into ParaView: Remoting/Views/Resources/3dwidgets_remotingviews.xml
and
Qt/ApplicationComponents/pqLightPropertyWidget.cxx

All this can be done in a plugin with a design similar to Examples/Plugins/PropertyWidget

hth.

Thank you so much for the quick response! This helps a lot.

In the file Qt/ApplicationComponents/pqLightPropertyWidget.cxx \ line 33, where does the file ui_pqLightPropertyWidget.h get included from?

Edit: forgot the critical qt5_wrap_ui(ui_srcs pqLightPropertyWidget.ui) line in the CMakeLists.txt

1 Like