[vtkusers] vtkinteractor (point picker) in Qt
richard.j.brown at live.co.uk
Tue Dec 30 10:24:15 EST 2014
I am trying to change the interactor so that the left click returns the x,y
coordinates of a 2D DICOM slice. It seems simple enough, but copying and
pasting the relevant section of the PointPicker example code doesn't work
(the example itself works). I haven't even initialised the interactor or set
it to the QVTKWidget. Does it change anything because I'm doing it in Qt?
I'm a little at a loss as to what's gone wrong when it's almost a carbon
copy from the example. Commenting out the lines starting vtkTypeMacro and
vtkStandardNewMacro enable it to build without any problems, but obviously
the interactor then wouldn't work. Any help would be greatly appreciated.
Here's what I've been trying:
class MouseInteractorStylePP : public vtkInteractorStyleImage
static MouseInteractorStylePP* New();
virtual void OnLeftButtonDown()
std::cout << "Picking pixel: " <<
this->Interactor->GetEventPosition() << " " <<
this->Interactor->GetEventPosition() << std::endl;
0, // always zero.
std::cout << "Picked value: " << picked << " " << picked << " "
<< picked << std::endl;
// Forward events
View this message in context: http://vtk.1045678.n5.nabble.com/vtkinteractor-point-picker-in-Qt-tp5729959.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers