render abnormal after my vtk upgrade from 8.2 to 9.4rc2

My code base is vtk 8.2.0, can normally render what program should do.
like the following:
image

But after I upgrade to vtk 9.4rc2, it displays as the following:
image

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.

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

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.