# render abnormal after my vtk upgrade from 8.2 to 9.4rc2

**URL:** https://discourse.vtk.org/t/render-abnormal-after-my-vtk-upgrade-from-8-2-to-9-4rc2/14862
**Category:** Development
**Created:** [November 13, 2024, 2:39am UTC](https://discourse.vtk.org/t/render-abnormal-after-my-vtk-upgrade-from-8-2-to-9-4rc2/14862 "2024-11-13T02:39:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)
#### Post date: [November 13, 2024, 2:39am UTC](https://discourse.vtk.org/t/render-abnormal-after-my-vtk-upgrade-from-8-2-to-9-4rc2/14862/1 "2024-11-13T02:39:08Z")

</div>

My code base is vtk 8.2.0, can normally render what program should do.  
like the following:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/e/ec2644c798eb995d7a7de0c8de5f18145251f735.jpeg)

But after I upgrade to vtk 9.4rc2, it displays as the following:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/6/6f873deb1c2b3b8e967973d380a2520a958e4b55.png)

I only changed some methods that are obsolete or renamed, like GetPointer(),

QVTKOpenGLNativeWidget =\> GetInteractor() to interactor(),  
SetRenderWindow → setRenderWindow.

I also changed the call to vtkCellArray, which used InitTraversal and GetNextCell(), now I changed them to the thread-safe usage, using Iterator to traverse the cells. I tested both usages, but failed in getting correct render result in either way.  
Can anyone help me on this issue? Thanks.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [November 14, 2024, 1:21pm UTC](https://discourse.vtk.org/t/render-abnormal-after-my-vtk-upgrade-from-8-2-to-9-4rc2/14862/2 "2024-11-14T13:21:34Z")

</div>

The vtkCellArray does seem like the most likely issue, a summary of its changes for VTK 9 are described in the following thread:  
[https://discourse.vtk.org/t/upcoming-changes-to-vtkcellarray](https://discourse.vtk.org/t/upcoming-changes-to-vtkcellarray)

---

<div class="post-metadata">

### Author: ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)
#### Post date: [November 22, 2024, 9:46am UTC](https://discourse.vtk.org/t/render-abnormal-after-my-vtk-upgrade-from-8-2-to-9-4rc2/14862/3 "2024-11-22T09:46:33Z")

</div>

Yes. I have looked up in the changing document, and worked it out.  
Really it’s caused by the CellArray changes.

I record 2 points:

1. the memory model has been changed for the offset and connectivity.
2. the GetSize() method change gives me wrong result for condition check.

David, Thanks for your tips.
