Customizing the default automatic View placement within a Layout

I am developing a filter with many output ports.

When Applying for the first time, a View is created for each of the output ports. The association of output ports with specific Views and their arrangement within a Layout is controlled by vtkSMParaViewPipelineControllerWithRendering. For the purposes of my filter I would like to reimplement methods ShowInPreferredView, GetPreferredViewType and AssignViewToLayout of that class to enforce a custom layout algorithm (e.g., to distribute the output port Views among multiple Layouts).

Is there any simple way how to accomplish this other than creating a wholly new custom client application and replacing pqApplyBehavior::showData by a custom routine?

You seem to know your way around ParaView code already.

Did you try to do it ? Did it work ?

Thank you for your comment, Mathieu! My concern is that I know of two solutions, but none of them seems really appropriate.

  1. I could change the code of ParaView to do what I want. But all I wanted was to write a plugin.
  2. I could write a new client application, but this would result in needless duplication of a lot of code.

I wondered if I was overlooking some obvious straightforward alternative.

It would be nice if ParaView accepted a subclassed vtkSMParaViewPipelineControllerWithRendering from a plugin, somehow. Would this be a welcomed contribution if I implemented it into upstream ParaView?

Another option would be come up with an interface that can be used to create displays and then add a plugin infrastructure to provide implementations for that interface. A clean interface that controls how displays are created on first request may be generally useful.

1 Like