[vtkusers] strange behaviour when using vtkInteractorStyleTrackballActor and vtkBalloonWidget

diego0020 da.angulo39 at uniandes.edu.co
Thu Nov 14 11:22:56 EST 2013


Hello

I have some new information:

- The problem also occurs with vtkInteractorStyleTrackballCamera
- It gets really extreme when inside a tkinter widget.

I attach a new example code. I would appreciate any ideas as it is starting
to get annoying. We have several applications which use tkinter for
interface and vtk for visualization, and we would really like to use the
balloon widget.

Best regards
Diego

import vtk
import Tkinter as tk

from vtk.tk.vtkTkRenderWindowInteractor import \
     vtkTkRenderWindowInteractor

root=tk.Tk()

renWin=vtk.vtkRenderWindow()
renderer=vtk.vtkRenderer()
renWin.AddRenderer(renderer)
render_widget = vtkTkRenderWindowInteractor(root,
                                            rw=renWin, width=600,
                                            height=600)
render_widget.pack(fill='both',expand=True)
iact=render_widget.GetRenderWindow().GetInteractor()
iact.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())
iact.SetRenderWindow(renWin)

balloon_w=vtk.vtkBalloonWidget()
balloon_w.SetInteractor(iact)
balloon_r=vtk.vtkBalloonRepresentation()
balloon_w.SetRepresentation(balloon_r)
balloon_w.On()

cone=vtk.vtkConeSource()
cone_map=vtk.vtkPolyDataMapper()
cone_map.SetInputConnection(cone.GetOutputPort())
cone_act=vtk.vtkActor()
cone_act.SetMapper(cone_map)

renderer.AddViewProp(cone_act)
balloon_w.AddBalloon(cone_act,"Cone" )
renderer.ResetCamera()
renWin.Initialize()
iact.Initialize()
root.mainloop()



--
View this message in context: http://vtk.1045678.n5.nabble.com/strange-behaviour-when-using-vtkInteractorStyleTrackballActor-and-vtkBalloonWidget-tp5724046p5724434.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list