[vtkusers] vtkOrientationMarkerWidget does not rotate in QVTKWidget

Eric E. Monson emonson at cs.duke.edu
Wed Jun 23 09:18:50 EDT 2010


Hey Jothy,

If I add iren.Start() at the end of this code it works for me. The blue cube in the corner spins with the big white cube.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Jun 23, 2010, at 7:29 AM, Jothy wrote:

> 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
> 
> 
> 
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list