[Insight-users] How to connect vtk mouse interaction class with QT UI
Xiaopeng Yang
yxp233 at postech.ac.kr
Fri Sep 23 08:16:20 EDT 2011
Dear Users,
I would like to render my qvtkWidget when I right click the mouse. But the
following code has error in the red line. Could you point out where I made a
mistake?
And also I would like to execute addpoint() when I right click the mouse. So
I tried the code in green line. But it also had error. Do you how to execute
addpoint by the mouse interaction?
SimpleView::SimpleView()
{
this->ui = new Ui_SimpleView;
this->ui->setupUi(this);
}
SimpleView:: addpoint()
{
}
class MouseInteractorStylePP : public vtkInteractorStyleTrackballCamera
{
public:
static MouseInteractorStylePP* New();
vtkTypeMacro(MouseInteractorStylePP, vtkInteractorStyleTrackballCamera);
virtual void OnRightButtonDown()
{
this->Interactor->GetPicker()->Pick(this->Interactor->GetEventPosition()[0],
this->Interactor->GetEventPosition()[1],
0,
this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer());
double picked[3];
this->Interactor->GetPicker()->GetPickPosition(picked);
std::cout << "Picked value: " << picked[0] << " " << picked[1] << "
" << picked[2] << std::endl;
this->ui->qvtkWidget->GetRenderWindow()->Render(); ?? Error here
SimpleView *workspace = (SimpleView*)ClientData; //ClientData:
undefined
workspace->addPoint();
}
Thanks a lot!
Best regards,
Xiaopeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110923/59c8225c/attachment.htm>
More information about the Insight-users
mailing list