Creating a circle cursor and picking


We need to implement a custom cursor, a hollow circle, which radius can be modified by for example the scroll wheel.

End of the day, we want to do picking inside this circle, in order to connect nodes in polylines.

Is there any classes in VTK that are suitable for this? Or any suggestion on approach? I tried out the Cursor2D example, but it seems to not connect the 2D Cursor to the mouse.

Is perhaps a 2D circle together with a mouse move callback, that moves the circle around together with the mouse position, reasonable?


This sounds similar to Blender’s Circle Select and should be possible with VTK. There is no class in VTK which provides such a feature so you’ll want to do it yourself.

Is perhaps creating a 2D circle and have a mouse move callback that moves the circle around together with the mouse position reasonable?

Yep, you can use vtkActor2D, vtkPolyDataMapper2D and vtkPolyData for the circle. As for the radius modification, you’d want to observe the mouse wheel event and adapt the circle geometry. I highly recommend making this into a widget representation (ex: vtkCircleSelectCursorRepresentation) and contributing it to VTK.