[vtkusers] Programmatically specify which actor(s) should be transformed.
Piotr Byzia
piotr.byzia at gmail.com
Mon Nov 30 09:09:10 EST 2009
Hello,
This is continuation on the topic which I presented in the previous thread, where Cory Quammen gave a great explanation:
http://www.vtk.org/pipermail/vtkusers/2009-November/103638.html
In short, my actors are biological molecules in 'lines' representation (http://media.piotr.byzia.pl/molecule_lines.PNG).
As I understand, there are 2 main interactor styles in the VTK: trackball and joystick, from which I prefer trackball one (for its precision when using mouse to rotate the molecule).
When I'm using the TrackballCamera I can click anywhere within my widget with the actors (BTW, I using QVTKRenderWindowInteractor in Python QT application) and rotate+zoom on *all* actors. In order to accomplish this for only *one* actor I need to switch to TrackballActor style and *pick* (by clicking with the mouse on it) the actor I want to act on. You can imagine that with those thin lines, this is not an easy task.
Ideally, I would *programmatically* specify which actors I want to transform in a style that resemble TrackballCamera (i.e. click anywhere on the scene to manipulate selected actors).
Programmatically, because then, I can select them easily via, for instance, checkboxes in my GUI.
In the vtkInteractorStyle class reference there is PropPicked attribute, but I can't see anything that might set this one to some particular actor(s).
I would appreciate any pointers, if not to whole problem, maybe to one of its parts: either how to programmatically select actors to act on OR how to act on the actor selected in TrackballActor like it was in the TrackballCamera (i.e. not have to click exactly on the molecule's line).
1. One of the solutions that I can think of, is to create some temporary actor on-the-fly with all the actors that I want to act on, but I guess this would be painfully slow...
2. The 2nd one: picking and transforming (by mouse) one actor in TrackballActor style *and* apply the same transformation to other actor(s) of my choice.
While I guess this is possible with some transformation matrix *after* the mouse button is released, it's crucial to be in real-time -- at the time of movement of the 1st picked actor.
Best wishes,
Piotr Byzia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091130/28656686/attachment.htm>
More information about the vtkusers
mailing list