problems with QVTKWidget and vtkCellPicker
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I am sending an EndPickEvent to a slot in a widget containing a QVTKWidget:
void aWidget::pick(vtkObject* caller){ vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::SafeDownCast(caller);
vtkCellPicker *cellPicker = (vtkCellPicker *)iren->GetPicker(); cellPicker->PrintSelf(cerr,vtkIndent()); long id = cellPicker->GetCellId(); cerr << "cellPicker->GetCellId() = " << id << endl; }
I connect to it as follows during the widget's initialization:
vtkEventQtSlotConnect* connections = vtkEventQtSlotConnect::New(); connections->Connect(widget.GetRenderWindow()->GetInteractor(), vtkCommand::EndPickEvent,&widget,SLOT(pick(vtkObject*))); connections->PrintSelf(cerr, vtkIndent());
The slot routine is invoked properly with the 'p' hey and all infos from PrintSelf make sense (e.g. event position, window size, etc.), but GetCellId() doesnt (big negative constant). What am I doing wrong, with "plain" vtkCommands (without Qt) it works fine?
regards, Dominik