Selecting Surface Cells

Hello!
While implementing the code using VTK, I encountered a problem with selecting a cell on the grid surface. I am only concerned with marking the visible cells from the user’s perspective(camera position). Selecting cells through the whole model is relatively easy, I use frustrum plane and renderareapicker to select the area I am interested in and then cut it out using vtkExtractPolyDataGeometry. One thing gets complicated when I use the rectangle and rubberbandpicker to mark only the cells on the surface of the visible part. I have tried to do this using normal and also raytracing, in both cases uncontactably. I.e., in the case of normal it marked normal across the entire depth of the model, and in the case of raytracing random data came out.

Any ideas? I also searched for how it is instantiated in paraview but no luck.

I tried using vtkHardwareSelector and RubberBand2D, but to no avail. Selector does not select anything

Ok, vtkHardwareSelector working.