[vtkusers] Determining vtkActors from point in space

Robbie Banks robbie.banks at gmail.com
Tue Mar 30 17:54:49 EDT 2010


OK, have altered the code to use the vtkPicker, but am still getting a null
pointer back for the picked location, although there is definitely an actor
there. Thoughts?

vtkSmartPointer<vtkPicker> pPicker = vtkSmartPointer<vtkPicker>::New();
pPicker->pick(xloc,yloc,zloc,pRenderer);
vtkSmartPointer<vtkActor> pPickedActor = pPicker->GetActor();

Robbie

-----Original Message-----
From: David E DeMarle [mailto:dave.demarle at kitware.com] 
Sent: Tuesday, March 30, 2010 2:17 PM
To: Robbie Banks
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Determining vtkActors from point in space

Make a vtkPicker instead of the Abstract class, then call the
vtkPicker::GeActors() to get a list of all the actors that are
underneath the pixel.

David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109



On Tue, Mar 30, 2010 at 5:11 PM, Robbie Banks <robbie.banks at gmail.com>
wrote:
> Sorry for being a bit slow, but how do I get the actor?
>
> Is it.
>
> vtkSmartPointer<vtkAbstractPropPicker> pPicker =
> vtkSmartPointer<vtkAbstractPropPicker>::New();
> pPicker->pick(xloc,yloc,zloc,pRenderer);
> vtkSmartPointer<vtkActor> pPickedActor = pPicker->GetActor();
>
> Robbie
>
> -----Original Message-----
> From: David E DeMarle [mailto:dave.demarle at kitware.com]
> Sent: Tuesday, March 30, 2010 1:57 PM
> To: Robbie Banks
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] Determining vtkActors from point in space
>
> See the Picker classes.
>
> http://www.vtk.org/doc/nightly/html/classvtkAbstractPropPicker.html
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 28 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-371-3971 x109
>
>
>
> On Tue, Mar 30, 2010 at 4:38 PM, Robbie Banks <robbie.banks at gmail.com>
> wrote:
>> Hi all,
>>
>> Is there an easy way to determine the vtkActor that intersects with a
> given
>> point in space?
>>
>> i.e. I have the x,y,z location on the renderer that I am interested in
and
> I
>> want to find out which vtkActor this point is in.
>>
>> Regards
>> Robbie
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>




More information about the vtkusers mailing list