# Code from the pipeline of MDI appllication which worked with 5.8. Need help upgrading it to 9.1

**URL:** https://discourse.vtk.org/t/code-from-the-pipeline-of-mdi-appllication-which-worked-with-5-8-need-help-upgrading-it-to-9-1/7487
**Category:** Support
**Created:** [December 23, 2021, 11:48am UTC](https://discourse.vtk.org/t/code-from-the-pipeline-of-mdi-appllication-which-worked-with-5-8-need-help-upgrading-it-to-9-1/7487 "2021-12-23T11:48:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Taimour](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@Taimour](https://discourse.vtk.org/u/Taimour)
#### Post date: [December 23, 2021, 11:48am UTC](https://discourse.vtk.org/t/code-from-the-pipeline-of-mdi-appllication-which-worked-with-5-8-need-help-upgrading-it-to-9-1/7487/1 "2021-12-23T11:48:18Z")

</div>

Hi Everyone,  
I am working on a project which includes following code. This code was developed in vtk5.8 and now I am trying to make it work in vtk9.1. The code is compiling but it is not rendering anything. Can Anyone look at the code and let me know any specific reason.

this-\>ren = vtkRenderer::New();  
this-\>renWin = vtkWin32OpenGLRenderWindow::New();  
this-\>iren = vtkWin32RenderWindowInteractor::New();  
this-\>Actor = vtkActor::New();  
this-\>ren-\>AddActor(this-\>Actor);  
this-\>renWin-\>AddRenderer(this-\>ren);  
this-\>iren-\>SetRenderWindow(this-\>renWin);

vtkPolyData\* data = vtkPolyData::New();  
vtkCellArray \*polys = vtkCellArray::New();  
vtkPoints \*newPts = vtkPoints::New();

**Internal code to fill newpts and polys with data is working fine** \*

data-\>SetPoints(newPts);  
data-\>SetPolys(polys);  
pMapper-\>SetInputData(data);  
this-\>Actor-\>SetMapper(mapper);  
this-\>ren-\>SetBackground(0.0, 0.0, 0.0);  
this-\>ren-\>SetAmbient(1.0, 1.0, 1.0);  
this-\>ren-\>RemoveAllViewProps();  
this-\>renWin-\>Render();

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [December 23, 2021, 12:30pm UTC](https://discourse.vtk.org/t/code-from-the-pipeline-of-mdi-appllication-which-worked-with-5-8-need-help-upgrading-it-to-9-1/7487/2 "2021-12-23T12:30:09Z")

</div>

Why are you explicitly instantiating the derived classes vtkWin32OpenGLRenderWindow and vtkWin32RenderWindowInteractor? Why are you not using vtkRenderWindow and vtkRenderWindowInteractor? Also, “RemoveAllViewProps()” sure looks suspicious to me…

---

<div class="post-metadata">

### Author: ![Taimour](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@Taimour](https://discourse.vtk.org/u/Taimour)
#### Post date: [December 23, 2021, 12:50pm UTC](https://discourse.vtk.org/t/code-from-the-pipeline-of-mdi-appllication-which-worked-with-5-8-need-help-upgrading-it-to-9-1/7487/3 "2021-12-23T12:50:33Z")

</div>

I am working on a MFC application that’s why I am using these.

---

<div class="post-metadata">

### Author: ![Aron\_Helser](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aron_helser/32/14_2.png) [@Aron\_Helser](https://discourse.vtk.org/u/Aron_Helser)
#### Post date: [December 23, 2021, 6:31pm UTC](https://discourse.vtk.org/t/code-from-the-pipeline-of-mdi-appllication-which-worked-with-5-8-need-help-upgrading-it-to-9-1/7487/4 "2021-12-23T18:31:28Z")

</div>

```auto

void vtkViewport::RemoveAllViewProps ( void 
 ) 
 
 

> > <br><br>Remove all actors from the list of actors.<br><br> |
> - | - |

```

[https://vtk.org/doc/release/5.0/html/a02171.html#z1488\_0](https://vtk.org/doc/release/5.0/html/a02171.html#z1488_0)

I don’t think you want to do that! Also check to make sure you are using the correct type of mapper - `pMapper` in your code.

---

<div class="post-metadata">

### Author: ![Taimour](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@Taimour](https://discourse.vtk.org/u/Taimour)
#### Post date: [December 24, 2021, 6:59am UTC](https://discourse.vtk.org/t/code-from-the-pipeline-of-mdi-appllication-which-worked-with-5-8-need-help-upgrading-it-to-9-1/7487/5 "2021-12-24T06:59:36Z")

</div>

pMapper is a DataSetMapper.
