Hi!<br><br>Ahhhhhh...that must be it... I am so stupid! Thanks for pointing that out to me! I have to wait till tomorrow to try it out...<br><br>Wondering why <br>picker->GetSelectionPoint(ptActual); <br>worked though...must have been an accident!
<br><br>Thanks,<br><br>Anja<br> <br><br><br><div><span class="gmail_quote">On 31/08/06, <b class="gmail_sendername">Obada Mahdi</b> <<a href="mailto:omahdi@gmx.de">omahdi@gmx.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Anja!<br><br>On Aug 31, 2006, at 7:08 PM, Anja Ende wrote:<br>> Ok, I figured out that the GetMapperPosition() was the answer to my<br>> question. However, I have another problem now...<br>><br>> I included the following code in my left mouse button handler and
<br>> it causes a segmentation fault!!!<br>><br>> vtkRenderWindowInteractor *rwi = this->Interactor;<br>> if (rwi)<br>> {<br>> vtkPointPicker *picker = (vtkPointPicker *)rwi->GetPicker
<br>> ();<br>> picker->Pick(x, y, m_viewer->GetCurrentSlice(), this-<br>> >CurrentRenderer);<br>><br>> std::cout << "PointId: " << picker->GetPointId() << "\n";
<br>> std::cout.flush();<br>> if (picker->GetPointId() != -1)<br>> {<br>> double * ptActual, *ptMapped;<br>> picker->GetSelectionPoint(ptActual); // OK
<br>> picker->GetMapperPosition(ptMapped); //<br>> CRASHES!!!!!<br>[...]<br><br>In case this is not pseudo-code with the "double *ptActual,<br>*ptMapped;" added for clarification:
<br><br>It seems that you mixed up the semantics of those "Get...(double*)"<br>calls a bit -- you can either do<br><br>| double *ptActual, *ptMapped;<br>|<br>| ptActual = picker->GetSelectionPoint();<br>| std::cout << ptActual[0] ...
<br><br>accessing some internal storage of the picker, or have it copy the<br>return value to the location you specify as parameter, like<br><br>| double ptActual[3], ptMapped[3];<br>|<br>| picker->GetSelectionPoint(ptActual);
<br>| std::cout << ptActual[0] ...<br><br>In the code above, results are written to the address pointed to by<br>`ptActual' and `ptMapped', which are undefined and might hold about<br>any value at run time.<br><br><br>
HTH,<br><br>Obada<br><br><br></blockquote></div><br>