Hello,

I started using VTK and Mayavi a few weeks ago. And I must say that the
ivtk module is more that useful! However, I didn't succeed into getting
the 3d Widget to work!

The best I got is, by doing this:
#########################################
# Import modules
from vtk import *
from mayavi import ivtk
from vtk.tk.vtkTkRenderWindowInteractor import
vtkTkRenderWindowInteractor


# Create some dummy visualization pipeline

source = vtkConeSource()
mapper = vtkPolyDataMapper()
mapper.SetInputConnection(source.GetOutputPort())
actor = vtkActor()
actor.SetMapper(mapper)

# Create an ivtk viewer

v = ivtk.viewer()

# Create a RenderWindowInteractor

renwin = v.GetRenderWindow()
iren = vtkTkRenderWindowInteractor( v.renwin.tkwidget )
iren.SetRenderWindow( v.GetRenderWindow() )

# Create a 3d Widget

boxWidget = vtkBoxWidget()
boxWidget.SetInteractor(iren)
boxWidget.SetPlaceFactor(1.25)
boxWidget.SetInput( source.GetOutput() )
boxWidget.PlaceWidget()

# Initialise the RenderWindowInteractor
iren.Initialize()
# Add the actor to the viewer
v.AddActors(actor)
# Activate the widget
boxWidget.On()
#########################################

That gets me to the point where the widget is actually shown but I
cannot interact with it.

Thanks for your help,

Pierre


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to