[Paraview] Controlling Render Views without Mouse

David Zemon david.zemon at mst.edu
Tue May 29 01:23:48 EDT 2012


Hello,

*Overview*
I am attempting to control ParaView v3.14.1 with something other than a
mouse and keyboard. I don't know how to do this - I've taken some wild
guesses and bits 'n' pieces have started to work. I could really use some
help from someone that knows the inner-workings though.

*What I'd Like to Happen*
I have an class, foo, with some events and callbacks of its own. Foo is not
related to ParaView in any way other than foo needs to make ParaView do
stuff as it sees fit. In the callbacks, I'd like to do things like zoom,
pan and rotate. Eventually I'd like foo to be able add filters and such
too, but that's a long way down the road.

*What I've Tried*
foo has 3 events similar to OnButtonDown, OnMouseMove, and OnButtonUp. I
figure, why not just call these methods (within vtkPVInteractorStyle) from
foo? This is what I've been trying.
I have made foo a friend of vtkPVInteractorStyle. I've created a global
pointer variable, g_pInteractorStyle, which points to vtkPVInteractorStyle.
I've created a mutator and two integer variables - m_x and m_y - within foo
to hold mouse coordinates. Any time that GetEventPosition()[0/1] is called,
I save those values to local variables - x and y - and pass them into foo's
mutator. This way, any time a real mouse is used, foo gets updated
coordinates. This also now gives me starting points to pass into
OnMouseMove.


More information about the ParaView mailing list