[vtkusers] vtkBoxWidget::EnableOn

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Fri Aug 8 09:06:34 EDT 2003


Hi all,

	I wrote a small python script, where I would like to display a 
vtkBoxWidget. But I can't get EnabledOn to work properly.

	Anyone any idea ?	

#######################################
from vtk.wx.wxVTKRenderWindowInteractor import *

class wxMarWheel(wxVTKRenderWindowInteractor):
     def __init__(self, parent, ID, *args, **kw):
         wxVTKRenderWindowInteractor.__init__(self,parent, ID)
         self.CreateBoxWidget()

     def CreateBoxWidget(self):
         self._boxWidget = vtk.vtkBoxWidget()
         self._boxWidget.SetInteractor(self._Iren)
         self._boxWidget.EnabledOn() #doesn't do anything ...

if __name__ == "__main__":
     # every wx app needs an app
     app = wxPySimpleApp()

     # create the widget
     frame = wxFrame(None, -1, "wxRenderWindow", size=wxSize(400,400))
     widget = wxMarWheel(frame, -1)
     widget.Initialize()
     widget.Start()

     ren = vtk.vtkRenderer()
     widget.GetRenderWindow().AddRenderer(ren)

     cone = vtk.vtkConeSource()
     cone.SetResolution(8)

     coneMapper = vtk.vtkPolyDataMapper()
     coneMapper.SetInput(cone.GetOutput())

     coneActor = vtk.vtkActor()
     coneActor.SetMapper(coneMapper)

     ren.AddActor(coneActor)

     frame.Show(1)

     app.MainLoop()
#######################################


Thanks,
mathieu




More information about the vtkusers mailing list