<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.StileMessaggioDiPostaElettronica18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=IT link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Probably you are using a
multi-thread .NET approach, in this case you can simply solve the problem
adding a<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='text-indent:35.4pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>wglMakeCurrent(NULL, NULL);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>after every occurrence of
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='text-indent:35.4pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>renWin->Render();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Using this “trick”
a thread release its rendering context (the render window contains a single
rendering context as an instance member) when it finishes rendering so that the
next thread can take it.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Let me know<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Valeria<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>Da:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
vtk-developers-bounces+g_luigi=fastwebnet.it@vtk.org
[mailto:vtk-developers-bounces+g_luigi=fastwebnet.it@vtk.org] <b><span
style='font-weight:bold'>Per conto di </span></b>A. Minutolo<br>
<b><span style='font-weight:bold'>Inviato:</span></b> marted́ 17 luglio 2007
17.09<br>
<b><span style='font-weight:bold'>A:</span></b> vtk-developers@vtk.org<br>
<b><span style='font-weight:bold'>Oggetto:</span></b> [vtk-developers]
vtkUserEvents from wxWidgetsCustomEvents</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div id="mb_0">

<p style='margin-bottom:12.0pt'><font size=3 color=black face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt;color:black'>Hi,<br>
till now I've successfully integrated wxWindows and VTK in my own application
by using the wxVTKRenderWindowInteractor class.</span><o:p></o:p></font></p>

<p style='margin-bottom:12.0pt'><font size=3 color=black face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt;color:black'>I have developed a driver for a
new interaction device and</span><span lang=EN-GB> </span></font><font
color=black><span lang=EN-GB style='color:black'>a wxWidgetsCustomEvent class
that handles the events it generates, now I want to invoke some vtkUserEvents
by using the Callback functions associated to my wxWidgetsCustomEvent. <br>
I' ve added the observers and the callback functions of my vtkUserEvents
in vtkInteractorStyle and I've developed a subclass of vtkinteractorStyle
with the necessary functionalities.</span><o:p></o:p></font></p>

<p style='margin-bottom:12.0pt'><font size=3 color=black face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt;color:black'>If i invoke my vtkEvents from a
function associated to a standard wxEvent it works fine. The problem is that if
I invoke the vtkEvents from a function associated to a custom wxEvent, VTK
seems to lose the focus and if I invoke a grabfocus or a dolly, the application
crashes by an error in "vtkWin32OpenGLRenderWindow::MakeCurrent()". </span><o:p></o:p></font></p>

<p style='margin-bottom:12.0pt'><font size=3 color=black face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt;color:black'>After my vtkEvent is invoked
the first time, is invoked a vtkCommand::LeaveEvent like the mouse pointer
leaves the vtkwindow, how could i avoid this invocation and such situation?</span><o:p></o:p></font></p>

<p style='margin-bottom:12.0pt'><font size=3 color=black face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt;color:black'>Can i invoke vtkEvent from a
wxCustomEvent without provoking render or focus problems? <br>
I hope someone can explain me the steps needed in order to create
vtkCustomEvents that can answer to my wxCustomEvents like to standard wxEvents?</span><o:p></o:p></font></p>

<p style='margin-bottom:12.0pt'><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'>Thanks to everybody.<o:p></o:p></span></font></p>

<p style='margin-bottom:12.0pt'><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'>Aniello<o:p></o:p></span></font></p>

</div>

</div>

</body>

</html>