[vtkusers] Inconsistant Picking & possible Bug in vtkWorldPointPicker

Sarah Macumber S.Macumber at QuestReliability.com
Thu Aug 7 12:42:27 EDT 2008


Hello Hello,

 

I have a question about vtkWorldPointPicker acting rather buggy & inconsistant.  I am using a 

vtkInteractorStyleRubberBand2D along with a vtkWorldPointPicker to select the start and end point of the 

rubber band since the Start and End point of all of the rubber band classes is a protected attribute. 

 

The behavior is such that sometimes the code returns the correct end point but sometimes it fails for no 

reason and returns the center of the data set.  Often times it seems to be accesing bad memory when it 

fails.

 

Any thoughts & thanks in advance!

Sarah

 

private void GraphicsWindowPickingStyle_StartInteractionEvt(vtkObject sender, vtkObjectEventArgs e)

{

vtkInteractorStyleRubberBand2D style = vtkInteractorStyleRubberBand2D.SafeDownCast(sender);

int[] pos = style.GetInteractor().GetEventPosition();

style.GetInteractor().GetPicker().Pick(pos[0], pos[1], 0, style.GetCurrentRenderer());

_startPickPosition = style.GetInteractor().GetPicker().GetPickPosition();

}

private void GraphicsWindowPickingStyle_EndInteractionEvt(vtkObject sender, vtkObjectEventArgs e)

{

vtkInteractorStyleRubberBand2D style = vtkInteractorStyleRubberBand2D.SafeDownCast(sender);

int[] pos = style.GetInteractor().GetEventPosition();

int returnValue = style.GetInteractor().GetPicker().Pick(pos[0], pos[1], 0, style.GetCurrentRenderer()); 

_endPickPosition = style.GetInteractor().GetPicker().GetPickPosition();

OnGridSelection(new GridSelectionEventArgs(_startPickPosition, _endPickPosition));

}




More information about the vtkusers mailing list