0

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();
  • This is a far cry from a [mre]. There could be all kinds of reasons for not rendering something. – Botje Dec 23 '21 at 12:33

1 Answers1

0

Add this->iren->Start(); after this->renWin->Render();

Without this->iren->Start(); Event loop won't be started.

adsarode
  • 46
  • 1
  • 7