<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear vtkusers,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I hope someone can help me with this problem... I'm
using wxpython to create a GUI for two vtk windows. Firstly is this a good
choice or would a different GUI choice or another language other than
python be more straight forward?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I'd like to display xyz orientation
widgets</FONT> <FONT face=Arial size=2>within the display windows. I have
coded a simple example of how to display the vtkAxesActor within a
vtkRenderWindow.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>However, since I'm currently using wxpython, I've
been using wxVTKRenderWindow(). I'm not sure how to set the interactor of this
or even if you can? I read somewhere that you should not use both
wxVTKRenderWindow() and wxVTKRenderWindowInteractor() together, plus my efforts
have resulted in no progress by doing so... It is my understanding that to use
the vtkAxesActor with the vtkOrientationMarkerWidget one should set the
interactor of the vtkOrientationMarkerWidget to the window
interactor.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is this possible with wxVTKRenderWindow()? A simple
program is below illustrating the problem. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I will be very thankful if someone can help me out
here.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Kind Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Richard A Rowe. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>import wx<BR>from math import *<BR>import
vtk<BR>from vtk.wx.wxVTKRenderWindowInteractor import
wxVTKRenderWindowInteractor</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>class MainWindow(wx.Frame):<BR>
def
__init__(self,parent,id,title):<BR>
wx.Frame.__init__(self,parent,wx.ID_ANY,title,size =
(600,600),<BR> style =
wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> panel =
wx.Panel(self)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> widget =
wxVTKRenderWindowInteractor(panel, -1)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> ren =
vtk.vtkRenderer()</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> renWin =
widget.GetRenderWindow()<BR>
renWin.AddRenderer(ren)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> sphere =
vtk.vtkSphereSource()</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
sphereMapper =
vtk.vtkPolyDataMapper()<BR>
sphereMapper.SetInputConnection(sphere.GetOutputPort())</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
sphereActor = vtk.vtkActor()<BR>
sphereActor.SetMapper(sphereMapper)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #
AxesActor<BR> axes =
vtk.vtkAxesActor()<BR>
axes.SetShaftTypeToCylinder()</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #
Orientation marker to be used with
vtkAxesActor.<BR> marker =
vtk.vtkOrientationMarkerWidget()<BR>
marker.SetOrientationMarker(axes)<BR>
marker.SetViewport(0,0,0.2,0.2)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
marker.SetInteractor(widget)<BR>
marker.EnabledOn()<BR>
marker.InteractiveOff()<BR>
<BR>
ren.AddActor(sphereActor)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> sizer =
wx.BoxSizer(wx.VERTICAL)<BR>
sizer.Add(widget, 1, wx.EXPAND | wx.ALL,
5)<BR>
self.SetSizer(sizer)<BR>
self.Layout()</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
self.Show(True)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><BR>app = wx.PySimpleApp()<BR>frame =
MainWindow(None, -1, "wxPython with
vtk")<BR>app.MainLoop()</FONT></DIV></BODY></HTML>