vtkInteractorStyle*Actor produces warning from vtkTransform
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When using vtkInteractorStyle*Actor and a vtkActor with a UserTransform set the following warning appears:
Warning: In .\vtkTransform.cxx, line 200 vtkTransform (035E3260): InternalUpdate: doing hack to support legacy code. This is deprecated in VTK 4.2. May be removed in a future version.
Attached against is a patch vtkInteractorStyleTrackballActor which gets rid of the warning. Similar changes need to be made to vtkInteractorStyleJoystickActor
The problem arises because vtkTransform doesn't like anyone meddling with its vtkMatrix4x4... which vtkInteractorStyle*Actor does. The proposed changes, alters the actor's orientation through the UserTransform rather than a new instance of vtkTransform.
Some tcl code to illustrate the bug:
package require vtk package require vtkinteraction
create a sphere source, mapper, and actor
vtkSphereSource sphere
vtkPolyDataMapper sphereMapper sphereMapper SetInput [sphere GetOutput] sphereMapper GlobalImmediateModeRenderingOn vtkTransform t vtkLODActor sphereActor sphereActor SetMapper sphereMapper sphereActor SetUserTransform t
Create the Renderer, RenderWindow, and RenderWindowInteractor
vtkInteractorStyleTrackballActor style
vtkRenderer ren1 vtkRenderWindow renWin renWin AddRenderer ren1 vtkRenderWindowInteractor iren iren SetRenderWindow renWin iren SetInteractorStyle style
Add the actors to the renderer, set the background and size
ren1 AddActor sphereActor ren1 SetBackground 1 1 1 renWin SetSize 300 300
Set the user method (bound to key 'u')
iren AddObserver UserEvent {wm deiconify .vtkInteract} iren Initialize
Withdraw the default tk window
wm withdraw .