I’m using vtkCellPicker (vtk-8.2.0, ubuntu-18.04.5) to select points in vtkPolyData, by incorporating vtkCellPicker in my class that extends vtkInteractorStyleTrackballCamera. When I create the vtk pipeline in main() following the CellPicking.cxx example, I can successfully pick cells in my vtkPolyData. Now I want to incorporate vtk graphics into a Qt application using this approach; I’ve put the same vtk pipeline creation sequence into my class that extends QQuickFramebufferObject::Renderer. But no matter where I click in the same vtkPolyData, vtkCellPicker::GetCellId() returns -1, as does vtkCellPicker::GetClippingPlaneId(). Documentation says that -1 is returned when nothing has been selected. Otherwise the qt-vtk application seems to behave as expected. What could cause vtkCellPicker::GetCellId() to return -1?
My code that bridges QT and VTK mouse button events called vtkRenderWindowInteractor::SetEventInformationFlipy(x, y, …) - hence the downstream VTK mouse handler was seeing a “flipped” y-coordinate. Thus clicks positioned over the polydata were not recognized as selected.