[vtkusers] Question for C++ Gurus!
Chase Yarbrough
vergil at gmail.com
Wed Mar 22 12:57:48 EST 2006
"I would like to have a pointer to the parent class (CSdiogl2View)." You
can not have pointers to classes, but rather instances of classes. If it is
a static method it is not associated with any instance of the class. If you
want it to have access to an instance of CSdiogl2View, you could keep a
static CSdiogl2View* around in the class.
chase
On 3/22/06, Jessica Weiner <suspended at gmail.com> wrote:
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060322/c252c19b/attachment.htm>
More information about the vtkusers
mailing list