[vtkusers] QVTKWidget with interactorStyleImage does not work

Jothy jothybasu at gmail.com
Thu Feb 17 06:42:23 EST 2011


Could oyu please send me this code

fant->mcb

Thank you

Jothy

On Wed, Feb 16, 2011 at 8:42 PM,  <lindeval at dmat.ufrr.br> wrote:
> Hi!!
>
> See in my code below how to use vtkInteractorStyleImage with QVTKWidget.
>
>
>    fant->sliceTransversalRen->AddActor(fant->sliceTransversalActor);
>    fant->sliceTransversalRen->SetBackground(1.0,1.0,1.0);
>
>    vtkInteractorStyleImage *style = vtkInteractorStyleImage::New();
>    ui->qvtkWidgetTrans->GetRenderWindow()->AddRenderer(fant->sliceTransversalRen);
>    ui->qvtkWidgetTrans->GetRenderWindow()->Render();
>    //ui->qvtkWidgetTrans->GetRenderWindow()->GetInteractor()->AddObserver(vtkCommand::LeftButtonPressEvent,fant->mcb,1.0);
>    ui->qvtkWidgetTrans->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
>
>
> ----- Mensagem original -----
> De: "Jothy" <jothybasu at gmail.com>
> Para: "VTK Mailing List" <vtkusers at vtk.org>
> Enviadas: Quarta-feira, 16 de Fevereiro de 2011 8:19:04 (GMT-0300) Auto-Detected
> Assunto: [vtkusers] QVTKWidget with interactorStyleImage does not work
>
> Hi all,
>
> I am trying to set the interactor style to image ina QVTKWidget.I am
> setting it by calling the interactor by
> QVTKWidget->GetInteractor()->SetInteractorStyle().
>
> But it doesn't work. The image doesn't rotate as expected for a 2D
> image interactor, but the W/L and W/W don't change on mouse move!
>
> Here is the bit of that code
>
> this->axialRenderer ->AddActor(slicer.axialSlice);
>  this->ui->AxialWidget->GetInteractor()->SetInteractorStyle(this->imageInteractorStyle);
>  this->ui->AxialWidget->GetRenderWindow()->AddRenderer(this->axialRenderer);
>  this->ui->AxialWidget->GetRenderWindow()->Render();
> //this->ui->AxialWidget->show();
>
>
> Thanks
>
> Jothy
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list