[vtkusers] Pick object inside another object

Alex Malyushytskyy alexmalvtk at gmail.com
Thu Jun 13 19:14:48 EDT 2013


Do you know that you may specify actor not pickable?
PickableOff<http://www.vtk.org/doc/nightly/html/classvtkProp.html#ad32346f0598b93698d9bcf501a1526ef>()
And it will be ignored during picking operation.

Alex



On Thu, Jun 13, 2013 at 7:49 AM, Max <smapersmaper at gmail.com> wrote:

> Dear VTKers,
> I need to pick an object that is located inside another object.
> How can i do it?
> The code for picking now is:
>
> private void LineActor_LeftButtonPressEvt(vtkObject sender,
> vtkObjectEventArgs e)
>         {
>             vtkInteractorStyle style = (vtkInteractorStyle)e.Caller;
>             int[] clickPos = style.GetInteractor().GetEventPosition();
>
>             vtkPropPicker picker = new vtkPropPicker();
>             picker.Pick(clickPos[0], clickPos[1], 0, firstLayerRenderer);
>             if (picker.GetActor() != null)
>             {
>                 vtkAlgorithm algorithm =
> picker.GetActor().GetMapper().GetInputConnection(0,0).GetProducer();
>                 vtkTubeFilter lineSource = algorithm as vtkTubeFilter;
>                 if (lineSource != null)
>                 {
>                     string label = lineSource.GetProgressText();
>                     foreach (VTKBiopsy biopsy in biopsies)
>                     {
>                         if
> (label.Equals(biopsy.BiopsyLabel.TextLabel.Label))
>                         {
>                             biopsy.Selected = biopsy.Selected == true ?
> false : true;
>                         }
>                     }
>                 }
>
> But when an object is inside another one, it returns vtkAlgorithm of the
> outside object...
>
> Thank you,
> Max
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Pick-object-inside-another-object-tp5721376.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130613/00c4857b/attachment.htm>


More information about the vtkusers mailing list