[vtkusers] problem with vtkPicker

Will Schroeder will.schroeder at kitware.com
Fri Dec 15 13:14:50 EST 2000


The default picker is now vtkPropPicker, not vtkCellPicker (this was a 
change from earlier versions,
the change was made several months ago). vtkPropPicker uses hardware 
acceleration, can pick
x-y-z coordinates, also picks a prop. vtkCellPicker and vtkPointPicker are 
software/geometric ray
cast versions and are slower. Sometimes (especially on some PC boards) the 
hardware picking
does not work because the OpenGL driver implementation is broken. If this 
is the case, vtkWorldPointPicker
can be used to get x-y-z coordinates (uses the z-buffer and is fast), or if 
more information is desired, the
vtkPointPicker or vtkCellPicker.

(Note: vtkPropPicker is not a subclass of vtkPicker, casting as is being 
done causes the problems you are
seeing.)

Will

At 12:57 PM 12/15/00 -0500, Audrius Stundzia wrote:
>Hi Steve,
>
>I just went through exactly the same problem last night after downloading 
>the latest nightly release. Great minds think alike :)
>
>I used the example in vtk/graphics/examplesCxx/pickCells.cxx
>as my guide.
>
>In this new release one has to switch to an explicit vtkPointPicker
>(or vtkCellPicker, presumably, but I haven't used this).
>
>vtkPointPicker *pointPicker = (vtkPointPicker *) iren->GetPicker();
>
>This did the trick for me. Hope this helps.
>
>Regards,
>
>Audrius
>
>
>
>>From: Steve Woolsey <woolsr at inel.gov>
>>To: VTK Users <vtkusers at public.kitware.com>
>>Subject: [vtkusers] problem with vtkPicker
>>Date: Fri, 15 Dec 2000 10:12:08 -0700
>>
>>I am having a problem with setting up my vtkPicker.
>>
>>in my code I do the following:
>>
>>         // Globals
>>         vtkRenderWindowInteractor *iren;
>>         vtkPicker   *main_picker;
>>
>>         // Init function
>>         void InitInteractors()
>>         {
>>                 iren = 
>> (vtkRenderWindowInteractor*)vtkRenderWindowInteractor::New();
>>                 iren->SetRenderWindow(renWin);
>>                 iren->Initialize();
>>
>>                 main_picker = iren->GetPicker();
>>         }
>>
>>Later in the program I use the GetActor method.
>>
>>When I compile I get the following error:
>>
>>         type 'vtkPicker' is not a base type for type 'vtkAbstractPicker'
>>
>>This is for the line with the GetPicker call.  If I change the
>>declaration of main_picker to type vtkAbstractPicker, then I get an
>>error saying:
>>
>>no matching function call to 'vtkAbstractPicker::GetActor()'
>>
>>This used to compile just fine with vtk 3.1.
>>I just went to the nightly build, because of speed issues.  What can I
>>do to fix this?
>>
>>-- Steve
>>-------------------------------------------------------------------
>>Steven Woolsey                         Engineer/Scientist
>>Bechtel BWXT Idaho, LLC                Visualization Engineer
>>Idaho National Engineering Lab.        EMAIL: woolsr at inel.gov
>>P.O. Box 1625, M.S. 3605
>>Idaho Falls, ID  83415-3605
>>-------------------------------------------------------------------
>>
>>_______________________________________________
>>This is the private VTK discussion list.
>>Please keep messages on-topic. Check the FAQ at: 
>><http://public.kitware.com/cgi-bin/vtkfaq>
>>Follow this link to subscribe/unsubscribe:
>>http://public.kitware.com/mailman/listinfo/vtkusers
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic. 
>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list