<DIV>Hi John,</DIV>
<DIV> </DIV>
<DIV>Thanks for answering so quickly. </DIV>
<DIV><BR><B><I>John Platt <jcplatt@lineone.net></I></B> a écrit :</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="Microsoft Word 10 (filtered)" name=Generator>
<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:blue;
        text-decoration:underline;}
p
        {margin-right:0cm;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.emailstyle19
        {font-family:Arial;
        color:navy;}
span.EmailStyle20
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</STYLE>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi Isabelle,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I am not sure where you are calling Pipeline(). Perhaps you could try all your interactor stuff in your CView’s OnInitialUpdate() – assuming it needs to be done only once.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> interactor->SetRenderWindow(m_RenderWindow);</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> interactor->SetInteractorStyle(NULL);</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> interactor->SetInstallMessageProc(false);</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> interactor->Initialize();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">--> <FONT face="Times New Roman" color=#000000 size=3>In fact, my Pipeline function is called only after having loaded my image.</FONT></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> // Change the size of the VTK window to match the client area of the View.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> CRect rect;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> GetClientRect( &rect );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> interactor->UpdateSize( rect.right-rect.left, rect.bottom-rect.top ); </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">--> <FONT color=#000000>I can't extend my vtk window's size to fit the client area because I have buttons too in my CView window.</FONT></P></SPAN></FONT>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Also, can you check if you are getting LBDown in your WindowProc(). </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#000000>--> </FONT><FONT color=#000000>I ckeched out if left button down was really caught and this is the case actually.</FONT></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#000000></FONT></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT face="Times New Roman" color=#000000 size=3>Now, my things work but only once out of 2!!! it seems that my CView is having the control when I clicked left, I don't know why, but after a while only, my render window is having the control and everything works fine except that I can't retrieve control and give it to the main wondow. Really so strange!</FONT></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" color=#000000 size=3><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT face="Times New Roman" color=#000000 size=3></FONT></SPAN></FONT></DIV>
<DIV class=Section1><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT face="Times New Roman" color=#000000 size=3>Isabelle</FONT>
<P class=MsoNormal><BR></P></SPAN></FONT>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">HTH</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">John.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Renaud Isabelle [mailto:renauisa@yahoo.fr] <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> </SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">22 August 2005</SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> </SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">21:34</SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> John Platt<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> vtkusers@vtk.org<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [vtkusers] need desperately any help with interactor and MFC</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Hi John,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Thanks for having replied. </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- First of all, sure that I am very interested in your <STRONG><B><FONT face="Times New Roman" color=black><SPAN style="COLOR: black">vtkGlyph2DMapper</SPAN></FONT></B></STRONG><FONT color=black><SPAN style="COLOR: black">; I think this is very convenient to use and is exactly what I am looking for. </SPAN></FONT></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Then, my actual work is inspiring from the example <STRONG><B><FONT face="Times New Roman">LiverTumorSegmentation</FONT></B></STRONG> application and I think that maybe <STRONG><B><FONT face="Times New Roman">I don't really need to use vtkPointPicker</FONT></B></STRONG> but just handling LeftButtonPressEvent event instead. Indeed, I took a look on the Pick() method of this class and it calls <STRONG><B><FONT face="Times New Roman">SetDisplayPoint(), DisplayToWorld() and GetWorldPoint() </FONT></B></STRONG>methods as I was already doing in my own class. </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- So, this is what is done for now: as in <STRONG><B><FONT face="Times New Roman">LiverTumorSegmentation</FONT></B></STRONG>, I have 2 classes: one for MFC handling <STRONG><B><FONT face="Times New Roman">CView</FONT></B></STRONG> and the other for viewing slices <STRONG><B><FONT face="Times New Roman">vtkSliceViewer</FONT></B></STRONG>:</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">void CView::Pipeline()</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">{</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> viewer.SetInput(image);</FONT></B></STRONG></SPAN></B> //vtkSliceViewer viewer</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> viewer.SetInteractor( interactor ); </SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> interactor->SetInstallMessageProc(false);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> interactor->Initialize();</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">}</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">LRESULT CView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">{</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">if(message == WM_LBUTTONDOWN)</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">{</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> if ( this->interactor->GetInitialized() )</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> {</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> return vtkHandleMessage2(this->m_hWnd, message, wParam, lParam, this->interactor);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> }</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> }</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">else </SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> return CFormView::WindowProc(message, wParam, lParam);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">}</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">the other class vtkSliceviewer:</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">void vtkSliceViewer::SetInteractor( vtkRenderWindowInteractor * interactor )</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">{</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> interactor->SetRenderWindow(m_RenderWindow);</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> interactor->SetInteractorStyle(NULL);</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT></B></STRONG> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> //create a callback for the left mouseclick</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> MyInteractorCallback* m_pInteractorCallback = MyInteractorCallback::New();</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> m_pInteractorCallback->SetImageSliceViewer(this); </FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> interactor->AddObserver( vtkCommand::LeftButtonPressEvent, m_pInteractorCallback);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">}</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">class MyInteractorCallback : public vtkCommand</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">{</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">public:</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> static MyInteractorCallback *New() { return new MyInteractorCallback;}</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> </FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> virtual void Execute(vtkObject *caller, unsigned long eventId, void *callData)</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> {</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> vtkWin32RenderWindowInteractor *interactor = reinterpret_cast<vtkWin32RenderWindowInteractor
*>(caller);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> int x = interactor->GetEventPosition()[0];</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> int y = interactor->GetEventPosition()[1];</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> m_viewer->SelectPoint(x,y);</FONT></B></STRONG></SPAN></B><BR> <STRONG><B><FONT face="Times New Roman"> }</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> </FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> void SetImageSliceViewer(vtkSliceViewer* viewer){m_viewer = viewer;}</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">private:</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> MyInteractorCallback(){m_viewer = NULL;}</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> vtkSliceViewer* m_viewer; </FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">};</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">void vtkSliceViewer::SelectPoint( int x, int y )</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">{</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> TRACE("ds SelectPoint\n"); //check if my observer is called</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></B></STRONG><SPAN style="BACKGROUND: yellow">--> displayed only when point clicked is outside the render window!!!!!!!!</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></B></STRONG>// Convert display point to world point</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> double world_point[4];</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> m_Renderer->SetDisplayPoint( x, y, 0 );</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> m_Renderer->DisplayToWorld();</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> m_Renderer->GetWorldPoint( world_point );</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> double realz = m_SliceNum * spacing[2] + origin[2];</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> world_point[2] = realz;</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> //mark point clicked on viewer</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> this->SelectPoint(world_point[0], world_point[1], world_point[2]);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">}</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><BR>- But I am really confused with something strange: <STRONG><B><FONT face="Times New Roman">my renderwindow is just a part of the MFC window (CView</FONT></B></STRONG>). Yet, when I pressed left button mouse in the window class, SelectPoint() is called only when my clicked point is not in the render window. I checked out if my interactor size was set to correct dimensions and it is actually the case. <STRONG><B><FONT face="Times New Roman">But I can't figure out why my function is called only when I clicked outside the render window.</FONT></B></STRONG> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Any idea???</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Isabelle</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><BR><B><I><SPAN style="FONT-WEIGHT: bold; FONT-STYLE: italic">John Platt <jcplatt@lineone.net></SPAN></I></B> a écrit :</SPAN></FONT></P></DIV>
<BLOCKQUOTE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; MARGIN-TOP: 5pt; PADDING-LEFT: 4pt; MARGIN-BOTTOM: 5pt; PADDING-BOTTOM: 0cm; MARGIN-LEFT: 3.75pt; BORDER-LEFT: #1010ff 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi Isabelle,</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">As far as I can see, the pick events are fired by the Pick() method of the interactor’s picker. If you want to observe these events, you must add the observers to the picker, not the interactor. You must also arrange for the Pick() method to be called.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">As a start, in the check for LeftButtonPressEvent, call Pick() with the current mouse event position and then get the point id -</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> int x = interactor->GetEventPosition()[0];</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> int y = interactor->GetEventPosition()[1];</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> vtkPointPicker* picker = interactor->GetPicker(); </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> picker->Pick( (double)x, (double)y, 0, renderer );</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> int pointId = picker->GetPointId();</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">and print the point Id using the TRACE macro. If you cannot get the LeftButtonPressEvent, see the recent thread on “handle right mouse click”.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I have drawn various 2D shapes, by first creating a polydata object, and then, as each point is clicked, add the point as a vertex to the polydata. The polydata is set as input to vtkGlyph2DMapper (very similar to vtkTextMapper). This mapper takes vtkGlyphSource2D as a source and copies the specified shape (diamond, circle, square etc.) to each of the points in the polydata. The mapper then feeds a single vtkActor2D. Something like …</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> vtkGlyphSource2D* vtkGlyphSource = vtkGlyphSource2D::New();</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> vtkGlyphSource->SetGlyphTypeToCircle();</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> m_vtkGlyphMapper = vtkGlyph2DMapper::New();</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> m_vtkGlyphMapper->SetInput( m_vtkInputPolyData );</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> m_vtkGlyphMapper->SetSource( vtkGlyphSource->GetOutput() );</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> vtkGlyphSource->Delete();</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> m_vtkGlyphActor = vtkActor2D::New();</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> m_vtkGlyphActor->SetMapper( m_vtkGlyphMapper );</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I can let you have the mapper if you think it would be helpful.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">John.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> vtkusers-bounces+jcplatt=lineone.net@vtk.org [mailto:vtkusers-bounces+jcplatt=lineone.net@vtk.org] <B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Renaud Isabelle<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> </SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">18 August 2005</SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> </SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">16:32</SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> vtkusers@public.kitware.com<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [vtkusers] help with interactor and
MFC</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Hi guys, </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">I have to implement user interaction with my renderwindow in MFC: </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">user picks points on the displayed medical image and notices them with spheres. I saw that I have to use <STRONG><B><FONT face="Times New Roman">vtkHandleMessage2</FONT></B></STRONG> with <STRONG><B><FONT face="Times New Roman">vtkWin32RenderWindowInteractor</FONT></B></STRONG> to handle a left button mouse click and <STRONG><B><FONT face="Times New Roman">interactor->AddObserver()</FONT></B></STRONG> to call a function to handle it. </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">But now, I see that <STRONG><B><FONT face="Times New Roman">vtkPointPicker</FONT></B></STRONG> exists and that is doing the same thing. I am really a bit confused with all the options. Here is what I did:</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> <STRONG><B><FONT face="Times New Roman">interactor->SetRenderWindow(m_RenderWindow);</FONT></B></STRONG></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> interactor->SetInteractorStyle(NULL);</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> vtkPointPicker *picker = vtkPointPicker::New();</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> interactor->SetPicker(picker);</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> <STRONG><B><FONT face="Times New Roman">vtkMyCallback* how_execute = vtkMyCallback::New();</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> interactor->AddObserver( vtkCommand::LeftButtonPressEvent, how_execute );</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> interactor->AddObserver( vtkCommand::EndPickEvent, how_execute);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> </FONT></B></STRONG></SPAN></B></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> interactor->SetInstallMessageProc(false);</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> interactor->Initialize();</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">LRESULT CMyView::<STRONG><B><FONT face="Times New Roman">WindowProc(UINT message, WPARAM wParam, LPARAM lParam)</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR></SPAN></B>{<BR> // TODO: Add your specialized code here and/or call the base class<BR> <STRONG><B><FONT face="Times New Roman">switch ( message )</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> {</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> case WM_LBUTTONDOWN:</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> if ( this->interactor->GetInitialized() )</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> {</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> return vtkHandleMessage2(this->m_hWnd, message, wParam, lParam,
this->interactor);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> }</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> break;</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> }</FONT></B></STRONG><BR></SPAN></B> <STRONG><B><FONT face="Times New Roman">return CFormView::WindowProc(message, wParam, lParam);</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">}</FONT></B></STRONG></SPAN></B></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">class vtkMyCallback : public vtkCommand</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">{</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">public:</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> static vtkMyCallback *New() { return new vtkMyCallback; }</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> </FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> virtual void Execute(vtkObject *caller, unsigned long eventId, void*)</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> {</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> vtkRenderWindowInteractor* interactor = reinterpret_cast<vtkRenderWindowInteractor*>(caller);</FONT></B></STRONG></SPAN></B></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> <STRONG><B><FONT face="Times New Roman">if(eventId == vtkCommand::LeftButtonPressEvent)</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> { </FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> int point[2];</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> interactor->GetEventPosition(point);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> m_viewer->SelectPoint(point[0],point[1]);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> }</FONT></B></STRONG></SPAN></B></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> <STRONG><B><FONT face="Times New Roman">if(eventId == vtkCommand::EndPickEvent)</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> { </FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> vtkPointPicker* picker = (vtkPointPicker*) interactor->GetPicker();</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> if(picker->GetPointId() != -1)</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> {</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman"> float* position =
picker->GetPickPosition();</FONT></B></STRONG></SPAN></B></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> m_sphereActor->SetPosition(position);</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman"> }</FONT></B></STRONG></SPAN></B><BR> }<BR>}</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- This seems not to work. I think that I have to choose between handling one of the event: LeftButtonPressEvent or EndPickEvent. But I don't know what is the best option. Could someone tell me what is best? </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Btw, my purpose is to add a circle on each point that user picked. Do I have to handle a <STRONG><B><FONT face="Times New Roman">array of vtkSphereSource</FONT></B></STRONG> to display so many spheres?</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Thanks for replyiong, guys,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Isabelle</SPAN></FONT></P></DIV>
<DIV style="MARGIN-LEFT: 36pt">
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR align=center width="100%" SIZE=1>
</SPAN></FONT></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><B><FONT face="Times New Roman" color=red size=3><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: red">Appel audio GRATUIT</SPAN></FONT> partout dans le monde</B> avec le nouveau Yahoo! Messenger<BR><A href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http:/fr.messenger.yahoo.com">Téléchargez le ici !</A> </P></BLOCKQUOTE>
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR align=center width="100%" SIZE=1>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><B><FONT face="Times New Roman" color=red size=3><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: red">Appel audio GRATUIT</SPAN></FONT> partout dans le monde</B> avec le nouveau Yahoo! Messenger<BR><A href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http:/fr.messenger.yahoo.com">Téléchargez le ici !</A> </P></DIV></BLOCKQUOTE><p>
                <hr size=1>
<b><font color=#FF0000>Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br>
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>