<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><P >You can create a global variable of type <FONT class="">CSdiogl2View</FONT>*, 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.</P>
<P > </P>
<P >If you think doing it this way is ugly, then it's time to change your design.</P>
<P > </P>
<P ><FONT class="">xz</FONT></P>
<P ><A href="http://www.xzing.org">http://www.xzing.org</A><BR ><BR ></P>
<P>
<HR id=stopSpelling>
</P>
<P>> From: suspended@gmail.com<BR>> To: vtkusers@vtk.org<BR>> Date: Wed, 22 Mar 2006 10:45:05 -0600<BR>> Subject: [vtkusers] Question for C++ Gurus!<BR>> <BR>> I am capturing left mouse click events in my vtk scene. Whenever the left<BR>> mouse button is released I want to change the vtk scene somehow. My event<BR>> handler method (myKeyPressCallback) is a static method and therefor it does<BR>> not have access to the variables of the class it belongs to. I would like to<BR>> have a pointer to the parent class (CSdiogl2View) inside the event handler<BR>> which has all the actors. How can this be done? I have written my code like<BR>> this:<BR>> <BR>> <BR>> vtkCallbackCommand * keypressCB = vtkCallbackCommand::New();<BR>> keypressCB->SetCallback(&CSdiogl2View::myKeyPressCallback);<BR>> <BR>> style = vtkInteractorStyleTrackballActor::New();<BR>> style->AddObserver(vtkCommand::LeftButtonReleaseEvent,keypressCB);<BR>> iren->SetInteractorStyle(style);<BR>> <BR>> Thanks.<BR>> Jess<BR>> <BR>> _______________________________________________<BR>> This is the private VTK discussion list. <BR>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>> Follow this link to subscribe/unsubscribe:<BR>> http://www.vtk.org/mailman/listinfo/vtkusers<BR></P><br /><hr /> <a href='' target='_new'></a></body>
</html>