What is the correct workflow to develop custom interactive widget in ParaView

Dear ParaView community,

I am still learning ParaView and I recently start to implement a custom 3D interactive widget. This is the workflow that I summarized (please correct me if I am wrong)

  1. Implement vtkMyCustomWidgetRepresentation.h/.cxx and vtkMyCustomWidgetWidget.h/.cxx
  2. Add the representation XML to Remoting/Views/Resources/3dwidgets_remotingviews.xml so the server can register it.
  3. Implement pqMyCustomWidgetProperty.h/.cxx
  4. Add
else if (type == "InteractiveMyCustomWidget")
{
  return new pqMyCustomWidgetProperty(proxy, group, parentWidget);
}

in Qt/ApplicationComponents/pqStandardPropertyWidgetInterface.cxx
5. Now my question is where should I put PropertyGroup panel_widget=“InteractiveMyCustomWidget”?

Yes but no. This is the process to add a interactive widget to ParaView.

I suppose that in your case you want to add that in your paraview based application, then you want to add that in a paraview plugin, not in ParaView directly.

Then what is the correct way to add an interactive widget in plugin?
Is the plugin structured in the following way?

-- CMakeLists.txt
-- paraview.plugin
-- MyWidget
    -- CMakeLists.txt
    -- vtk.module
    -- MyCustomWidget.xml
    -- vtkMyCustomWidgetRepresentation.h
    -- vtkMyCustomWidgetRepresentation.cxx
    -- vtkMyCustomWidget.h
    -- vtkMyCustomWidget.cxx
    -- vtkMyCustomWidgetProperty.h
    -- vtkMyCustomWidgetProperty.cxx

But if I don’t change the source code pqStandardPropertyWidgetInterface.cxx, how does it know what property to return?

It is a bit more complex than that. You should take a look at Examples/Plugins/PropertyWidgets in paraview sources.

But if I don’t change the source code pqStandardPropertyWidgetInterface.cxx, how does it know what property to return?

This is supported for plugin to declare their own widgets and uses them.

Examples/Plugins/PropertyWidgets only replaces an existing property with a new property in a vtkShrinkFilter.
When a vtkShrinkFilter is created in ParaView, a pipelinesource will be created. Based on the panel_widget, it knows what property to display in UI. But how does it know what widget to display in the 3D scene? Where am I supposed to implement this logic?

How do I understand relationship between filter - widget - representation - property?

If I create a filter inherited from vtkPlaneCutter, I will automatically have a widget (a slice plane with its normal) when this filter is created. where is it in the source code and how it is associated with vtkPlaneCutter?

The same as in ParaView, with XML files.

where is it in the source code and how it is associated with vtkPlaneCutter?

XMLs

Examples/Plugins/PropertyWidgets only replaces an existing property with a new property in a vtkShrinkFilter.

Indeed, but better than nothing. We should add a plugin showing how to create an interactive vtk widget.

Yes, please! I really need to learn how to create an interactive vtk widget in ParaView.

I’ve opened an issue for it but one would need to contribute in order to move it forward.
https://gitlab.kitware.com/paraview/paraview/-/issues/21324