[vtkusers] Question for C++ Gurus!
X Z
xf10036 at hotmail.com
Wed Mar 22 12:45:28 EST 2006
You can create a global variable of type CSdiogl2View*, and whenever you create a dialog object of the type, change the global variable to point to the object. Of course, you can only use one dialog at a time.
If you think doing it this way is ugly, then it's time to change your design.
xz
http://www.xzing.org
> From: suspended at gmail.com> To: vtkusers at vtk.org> Date: Wed, 22 Mar 2006 10:45:05 -0600> Subject: [vtkusers] Question for C++ Gurus!> > I am capturing left mouse click events in my vtk scene. Whenever the left> mouse button is released I want to change the vtk scene somehow. My event> handler method (myKeyPressCallback) is a static method and therefor it does> not have access to the variables of the class it belongs to. I would like to> have a pointer to the parent class (CSdiogl2View) inside the event handler> which has all the actors. How can this be done? I have written my code like> this:> > > vtkCallbackCommand * keypressCB = vtkCallbackCommand::New();> keypressCB->SetCallback(&CSdiogl2View::myKeyPressCallback);> > style = vtkInteractorStyleTrackballActor::New();> style->AddObserver(vtkCommand::LeftButtonReleaseEvent,keypressCB);> iren->SetInteractorStyle(style);> > Thanks.> Jess> > _______________________________________________> This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ> Follow this link to subscribe/unsubscribe:> http://www.vtk.org/mailman/listinfo/vtkusers
_________________________________________________________________
Search on the go: Try Windows Live(tm) Search for Mobile beta
http://www1.imagine-msn.com/minisites/mobile/Default.aspx?locale=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060322/2b2d36f0/attachment.htm>
More information about the vtkusers
mailing list