[vtkusers] Hello,

Matt Commodore Matt.Commodore at rwdi.com
Sat Jan 22 20:12:14 EST 2011


Hello,
 
I'm having difficulty with the command/observer part of VTK. I'll explain what I'm trying to do, but if it's not a good way of doing things in VTK please let me know.
 
What I want to do is make a pick on to a plane in the VTK window, and have the plane behave like google maps. I want the left mouse button to perform the pick and the other two buttons to retain their pan and zoom functionality.
The way I'm trying to achieve this is by sub-classing an interactor style and overriding its left mouse button event binding methods. So, when the left mouse button is pressed down, I perform the pick and invoke an event (pickevent).
 
Now, what I think I need to do is add an observer to the interactor style that I've sub-classed. Is this correct? Secondly, when I invoke the event I use callData to pass the picked point to the observer. Is this correct? Thirdly, I've sub-classed a vtkCommand object to deal with the event, but what I really want to do is pass the picked point to the class that creates and manages all of the VTK code. I use function calls to save a pointer to my "manager" class as a member variable inside the vtkCommand class. However, when I try to use the member variable inside the execute method it complains about execute being static, which I'm not aware it is.
 
I hope my explanation is reasonably clear. Let me know if you need a code example or a better explanation. As I said above feel free to pick apart my design if it stinks.
 
Thank you,
Matt


     RWDI - One of Canada's 50 Best Managed Companies
     www.rwdi.com/50_best/

This communication is intended for the sole use of the party to whom it was addressed and may contain information that is privileged and/or confidential. Any other distribution, copying or disclosure is strictly prohibited. If you received this email in error, please notify us immediately by replying to this email and delete the message without retaining any hard or electronic copies of same. 

Outgoing emails are scanned for viruses, but no warranty is made to their absence in this email or attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110122/b6431144/attachment.htm>


More information about the vtkusers mailing list