[vtkusers] Pick object inside another object

Max smapersmaper at gmail.com
Thu Jun 13 10:49:05 EDT 2013


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.



More information about the vtkusers mailing list