[vtkusers] R: R: About decoupling events
Zampini Samuele
samuele.zampini at epfl.ch
Thu Oct 22 02:34:09 EDT 2009
I am writing in Python... I am attaching below the part of the code where I need to use the vtkInteractorStyleTrackballActor: could you help to fix this, please?
Thanks a lot,
Samuele.
self.vmtkRenderer = vmtkrenderer.vmtkRenderer()
# Comment or uncomment...
# self.vmtkRenderer.Initialize()
# setting RenderWindow to the already existing one in vtkda
if not self.vmtkRenderer.Renderer:
self.vmtkRenderer.Renderer = VmtkGui.ren
# self.vmtkRenderer.Renderer = self.ren_int
self.vmtkRenderer.RenderWindow = self.vtkda.GetRenderWindow()
self.vmtkRenderer.RenderWindow.AddRenderer(self.vmtkRenderer.Renderer)
self.vmtkRenderer.RenderWindow.SetSize(self.vmtkRenderer.WindowSize[0],self.vmtkRenderer.WindowSize[1])
self.vmtkRenderer.RenderWindow.SetPointSmoothing(self.vmtkRenderer.PointSmoothing)
self.vmtkRenderer.RenderWindow.SetLineSmoothing(self.vmtkRenderer.LineSmoothing)
self.vmtkRenderer.RenderWindow.SetPolygonSmoothing(self.vmtkRenderer.PolygonSmoothing)
# Note that if I use the vtkGenericRenderWindowInteractor() I get image i the right window but I can not interact with it, while if I use the vtkRenderWindowInteractor() I get an image I can "elaborate" as I like, but it does not appear in the right window.
self.vmtkRenderer.RenderWindowInteractor = vtk.vtkRenderWindowInteractor()
# self.vmtkRenderer.RenderWindowInteractor = vtk.vtkGenericRenderWindowInteractor()
self.vmtkRenderer.RenderWindowInteractor.SetRenderWindow(self.vtkda.GetRenderWindow())
self.vmtkRenderer.RenderWindowInteractor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())
self.vmtkRenderer.RenderWindow.SetInteractor(self.vmtkRenderer.RenderWindowInteractor)
# The following line should help to make the interactor shared properly between the ImagePlaneWidgets and the renderer. Actually, nothing happens.
self.vmtkRenderer.RenderWindowInteractor.Initialize()
________________________________________
Da: David Feng [dfeng at cs.unc.edu]
Inviato: mercoledì 21 ottobre 2009 19.04
A: Zampini Samuele
Cc: vtkusers at vtk.org
Oggetto: Re: R: [vtkusers] About decoupling events
vtkInteractorStyleTrackballActor is a vtkInteractorStyle, which is a
property of the vtkRenderWindowInteractor(). You would call:
rwi->SetInteractorStyle(style);
David
Zampini Samuele wrote:
> Actually, I forgot to ask you one more question: can I use the method you suggested ( vtkInteractorStyleTrackballActor ) instead of vtkRenderWindowInteractor()?
>
> Is that right? Or where should I use it???
>
> Thanks again,
>
> Samuele
> ________________________________________
> Da: David Feng [dfeng at cs.unc.edu]
> Inviato: mercoledì 21 ottobre 2009 17.09
> A: Zampini Samuele
> Cc: vtkusers at vtk.org
> Oggetto: Re: [vtkusers] About decoupling events
>
> I don't know much about the link you sent, but if you don't need any
> special interaction, the vtkInteractorStyleTrackballActor allows you to
> scale/translate/rotate whatever actor you clicked on.
>
> David
>
> Zampini Samuele wrote:
>
>> Dear all,
>>
>> I am writing since I would like to know if there's something new going on about decoupling events.
>>
>> I am referring to this page: http://www.itk.org/Wiki/VTKWidgets
>>
>> What I would like to know is if there is a function that allow me to interact simply with one object. I mean: I wanna create a window with 2 objects in it (let's say 2 cones or a cone and a DICOM image).
>>
>> What I wanna do now is to be able to interact either on one object or on the other one.
>>
>> Well, right now I am not able to do that.
>>
>> Could you help?
>>
>> Thanks a lot,
>>
>> Samuele
>> _______________________________________________
>> 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