# Customizing the default automatic View placement within a Layout

**URL:** https://discourse.paraview.org/t/customizing-the-default-automatic-view-placement-within-a-layout/5571
**Category:** Development
**Created:** [October 15, 2020, 5:30pm UTC](https://discourse.paraview.org/t/customizing-the-default-automatic-view-placement-within-a-layout/5571 "2020-10-15T17:30:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jacob](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jacob/32/3178_2.png) [@jacob](https://discourse.paraview.org/u/jacob)
#### Post date: [October 15, 2020, 5:30pm UTC](https://discourse.paraview.org/t/customizing-the-default-automatic-view-placement-within-a-layout/5571/1 "2020-10-15T17:30:27Z")

</div>

I am developing a filter with many output ports.

When _Apply_ing 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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 16, 2020, 8:46am UTC](https://discourse.paraview.org/t/customizing-the-default-automatic-view-placement-within-a-layout/5571/2 "2020-10-16T08:46:31Z")

</div>

You seem to know your way around ParaView code already.

Did you try to do it ? Did it work ?

---

<div class="post-metadata">

### Author: ![jacob](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jacob/32/3178_2.png) [@jacob](https://discourse.paraview.org/u/jacob)
#### Post date: [October 16, 2020, 2:02pm UTC](https://discourse.paraview.org/t/customizing-the-default-automatic-view-placement-within-a-layout/5571/3 "2020-10-16T14:02:58Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [October 16, 2020, 2:05pm UTC](https://discourse.paraview.org/t/customizing-the-default-automatic-view-placement-within-a-layout/5571/4 "2020-10-16T14:05:31Z")

</div>

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.
