[vtkusers] Overriding QVTKWidget interactor style

Mwoua david.levy at leddartech.com
Tue Feb 21 10:13:03 EST 2017


Hello,
im new to VTK and I can't find a way to override the interactor style to
remap keyboard event. I'm using the point cloud library viewer, but I think
my issue is related to the QVTKWidget.

Here is my code :

    boost::shared_ptr<pcl::visualization::PCLVisualizer> mViewer;
    QVTKWidget *mVTKWidget;

    // Set up the QVTK window
    mViewer =
boost::make_shared<pcl::visualization::PCLVisualizer>("viewer", false);
    mVTKWidget->SetRenderWindow (mViewer->getRenderWindow ());
    auto lInteractor = mVTKWidget->GetInteractor ();
    auto lInteractorStyle = CustomInteractor::New();
    lInteractor->SetInteractorStyle(lInteractorStyle);
    mViewer->setupInteractor (lInteractor, mVTKWidget->GetRenderWindow ());

    mVTKWidget->update ();

And my custom interactor just to try things :
class CustomInteractor : public
pcl::visualization::PCLVisualizerInteractorStyle
{
    void OnChar() override {}
    void OnKeyDown ()override {}
    void OnKeyUp ()override {}
};


PCLVisualizerInteractorStyle inherits from vtkInteractorStyleRubberBandPick.

I might be missing something easy, but im out of idea.

Thanks



--
View this message in context: http://vtk.1045678.n5.nabble.com/Overriding-QVTKWidget-interactor-style-tp5742264.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list