Search code examples
vtkqvtkwidget

How to rotate and place points on VTK object


I have seen how I can place points on a VTK object using seed widget from : http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/vtkSeedWidget

I have also seen how I can rotate an object from : http://www.cmake.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindows

I am wondering how I can combine this so I can rotate the object when I drag, and place points when I click


Solution

  • Usually to do something like this you will have to subclass an interactor style (like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEvents). Then you can store an instance of something like the seed widget in that class, and pass along events to it that you don't want to handle, and handle the ones that you do want to handle (or let the defaults of the style handle them).