<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Anja!<DIV><BR><DIV><DIV>On Sep 1, 2006, at 11:39 AM, Anja Ende wrote:</DIV><BLOCKQUOTE type="cite"><DIV style=""><SPAN class="gmail_quote">On 01/09/06, <B>Anja Ende</B> <<A href="mailto:anja.ende@googlemail.com">anja.ende@googlemail.com</A>> wrote:</SPAN><BLOCKQUOTE class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; "><DIV style="">It seems that was not it! It still crashes!! The strange thing is that calling the picker->GetMapper() also crashes. Here is the updated code!</DIV></BLOCKQUOTE></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>Yikes! I was quite confident that we'd figured it out.<BR><DIV><BR class="khtml-block-placeholder"></DIV><BLOCKQUOTE type="cite">Ok, it seems picking does not work with 2D actors!<BR><BR>The casting to vtkPointPicker was the one that was wrong...</BLOCKQUOTE><BLOCKQUOTE type="cite"><BR>// Problem line..<BR><SPAN class="q">vtkPointPicker *picker = (vtkPointPicker *)rwi->GetPicker(); <BR><BR>The picker is not an instance of vtkPointPicker... I found that out when I called it to print itself and see which member gets executed...<BR></SPAN></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>The recommended way to do this in VTK is to use the "SafeDownCast()" static method that is defined by each class:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>| vtkPointPicker *picker = vtkPointPicker::SafeDownCast(rwi->GetPicker());</DIV><DIV>| </DIV><DIV>| if ( picker == NULL )</DIV><DIV>| // didn't work, either rwi->Picker() returned `NULL', or it is not compatible to `vtkPointPicker'</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I should have mentioned that before, but I did not think it was relevant. Oh, well...</DIV><DIV><BR><BLOCKQUOTE type="cite"><SPAN class="q">Anyways, if someone knows a way to do picking on 2D actors, PLEASE let me know! <BR></SPAN></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>I do not know much about that, but a quick look into the vtkPicker code suggests that vtkPicker and subclasses are designed for vtkProp3D-derived actors only. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Maybe that means vtkWorldPointPicker and by-hand computation -- hopefully someone else on the list knows more about that.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Regards</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Obada</DIV></DIV></BODY></HTML>