// Create a mapper and actor vtkNew<vtkPolyDataMapper> mapper; mapper->SetInputConnection(cylinderSource->GetOutputPort()); vtkNew<vtkActor> actor; actor->GetProperty()->SetColor(colors->GetColor3d("Cornsilk").GetData()); actor->SetMapper(mapper);
// Create a renderer, render window, and interactor vtkNew<vtkRenderer> renderer; vtkNew<vtkRenderWindow> renderWindow; renderWindow->SetWindowName("Cylinder"); renderWindow->AddRenderer(renderer); vtkNew<vtkRenderWindowInteractor> renderWindowInteractor; renderWindowInteractor->SetRenderWindow(renderWindow);
// Add the actor to the scene renderer->AddActor(actor); renderer->SetBackground(colors->GetColor3d("DarkGreen").GetData());
// Render and interact renderWindow->Render(); renderWindowInteractor->Start();