[vtkusers] vtkOrientationMarkerWidget does not rotate in QVTKWidget

Jothy jothybasu at gmail.com
Wed Jun 23 07:29:10 EDT 2010


Hi all,

I am trying to add a vtkOrientationMarkerWidget to a QVTKWidget. The
annotatedCube is displayed in the corner but it doesn't rotate along with
the other actors.

I checkd the code with vtkRenderWindow, it works well. What is the problem??

Below is the code



from vtk import*
cube=vtkCubeSource()
cube.SetXLength(200)
cube.SetYLength(200)
cube.SetZLength(200)
cube.Update()
cm=vtkPolyDataMapper()
cm.SetInputConnection(cube.GetOutputPort())
ca=vtkActor()
ca.SetMapper(cm)

renWin = vtkRenderWindow()
ren=vtkRenderer()
ren.AddActor(ca)
renWin.AddRenderer(ren)
iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren.SetBackground(0,0,0)
renWin.Render()

axesActor = vtkAnnotatedCubeActor();
axesActor.SetXPlusFaceText('R')
axesActor.SetXMinusFaceText('L')
axesActor.SetYMinusFaceText('H')
axesActor.SetYPlusFaceText('F')
axesActor.SetZMinusFaceText('P')
axesActor.SetZPlusFaceText('A')
axesActor.GetTextEdgesProperty().SetColor(1,1,0)
axesActor.GetTextEdgesProperty().SetLineWidth(2)
axesActor.GetCubeProperty().SetColor(0,0,1)
axes = vtkOrientationMarkerWidget();
axes.SetOrientationMarker(axesActor);
axes.SetInteractor(iren);
axes.EnabledOn();
axes.InteractiveOn();


Thanks,

Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100623/77e2585d/attachment.htm>


More information about the vtkusers mailing list