# paraview.simple vs vtk when writing web backend

**URL:** https://discourse.paraview.org/t/paraview-simple-vs-vtk-when-writing-web-backend/4082
**Category:** Web Support
**Created:** [April 15, 2020, 11:33pm UTC](https://discourse.paraview.org/t/paraview-simple-vs-vtk-when-writing-web-backend/4082 "2020-04-15T23:33:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Yasushi\_Saito](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yasushi_saito/32/3469_2.png) [@Yasushi\_Saito](https://discourse.paraview.org/u/Yasushi_Saito)
#### Post date: [April 15, 2020, 11:33pm UTC](https://discourse.paraview.org/t/paraview-simple-vs-vtk-when-writing-web-backend/4082/1 "2020-04-15T23:33:33Z")

</div>

Hi,

I’m trying to teach myself combining paraview server + browser frontend. I’m following the example in

> **[ParaViewWeb](https://kitware.github.io/paraviewweb/examples/RemoteRenderer.html)**
>
> RemoteRendererLive example RemoteRendererThe RemoteRenderer can be used with either the VTK-Web or ParaView-Web servers.The current example will not work until you start one of the servers below onyou

and I don’t understand what paraview.simple provides over raw vtk methods. I see that simple functions are indeed simple, but it’s largely undocumented, and I’m especially having trouble how to map vtk concepts to simple.\* functions. For example:

As I understand, simple.Cone() creates a vtkConeSource internally and wraps it in a python object, what kind of wrapping is happening? E.g., what’s the equivalent of GetOutputPort()? If you can point me to either python or c++ source code that does wrapping, I’d really appreciate it.

How can we chain filters, like we do in vtk SetInputConnection. I see that simple exposes many filters (clip, slice, …) but I can’t find examples of using them.

Is it possible to mix vtk.\* functions and simple\* methods in a server? For example, can I use vtk.vtkConeSource() and show it with simple.Show() (it didn’t work, but I wonder if I’m missing some wrapping).

---

<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: [April 16, 2020, 2:06am UTC](https://discourse.paraview.org/t/paraview-simple-vs-vtk-when-writing-web-backend/4082/2 "2020-04-16T02:06:26Z")

</div>

```
Cone()
Clip()
Show()
Render()

```

This is all you need to do to show a clipped cone with paraview.simple.

The documentation is here : [https://kitware.github.io/paraview-docs/latest/python/paraview.simple.html](https://kitware.github.io/paraview-docs/latest/python/paraview.simple.html)

---

<div class="post-metadata">

### Author: ![Yasushi\_Saito](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yasushi_saito/32/3469_2.png) [@Yasushi\_Saito](https://discourse.paraview.org/u/Yasushi_Saito)
#### Post date: [April 16, 2020, 5:06am UTC](https://discourse.paraview.org/t/paraview-simple-vs-vtk-when-writing-web-backend/4082/3 "2020-04-16T05:06:45Z")

</div>

Thanks. I’m aware of the documentation page. But it’s missing the dynamically generated classes, including Cone and Clip. help(simple.Clip()) gives me good information, but I still have difficulty telling which C++ code simple.Clip wraps, and which python method invokes which C++ method. For Clip, I’m guessing VTKExtensions/FiltersGeneral/Resources/general\_filters.xml defines that mapping, but I’m stuck trying to parse the file. Is there any documentation for the format & the meaning of the XML definitions?

---

<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: [April 16, 2020, 5:12am UTC](https://discourse.paraview.org/t/paraview-simple-vs-vtk-when-writing-web-backend/4082/4 "2020-04-16T05:12:50Z")

</div>

[https://kitware.github.io/paraview-docs/latest/python/paraview.simple.Cone.html#paraview.simple.Cone](https://kitware.github.io/paraview-docs/latest/python/paraview.simple.Cone.html#paraview.simple.Cone)  
[https://kitware.github.io/paraview-docs/latest/python/paraview.simple.Clip.html](https://kitware.github.io/paraview-docs/latest/python/paraview.simple.Clip.html)  
[https://kitware.github.io/paraview-docs/latest/python/paraview.servermanager\_proxies.html](https://kitware.github.io/paraview-docs/latest/python/paraview.servermanager_proxies.html)

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [April 16, 2020, 8:54am UTC](https://discourse.paraview.org/t/paraview-simple-vs-vtk-when-writing-web-backend/4082/5 "2020-04-16T08:54:52Z")

</div>

The big picture is that ParaView can be used in distributed which means that the actual vtkConeSource may not be local to the machine where you execute that code (simple.Cone()). Hence the proxy abstraction that hides that part to the user.

If you know that you are only working locally, you can indeed perform some VTK task on top of some Proxy object but that require a good knowledge of how things work internally.

To be more explicit on how the Pipeline get constructed you can do the following. This also allow you to rewire the pipeline dynamically.

```auto
view = Render()
cone = Cone()
clip = Clip(Input=cone)
clipRepresentation = Show(clip, view)
Render()
sphere = Sphere()
clip.Input = sphere
Render()
coneRep = Show(cone, view)
cone.Resolution = 12
Render()

conePolydata = cone.GetClientSideObject().GetOutput()
print(conePolydata)

```
