[vtkusers] Inconsistant Picking & possible Bug invtkWorldPointPicker

Sarah Macumber S.Macumber at QuestReliability.com
Thu Aug 7 16:38:45 EDT 2008


I have tried a few alternative methods for getting the world coordinate point but they are also failing and returning the center point ...

Sarah

vtkInteractorStyleRubberBand2D style = vtkInteractorStyleRubberBand2D.SafeDownCast(sender);

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

GraphicsWindowRenderer.SetDisplayPoint(pos[0], pos[1], 0);

GraphicsWindowRenderer.DisplayToWorld();

_startPickPosition = GraphicsWindowRenderer.GetWorldPoint();


________________________________

From: vtkusers-bounces at vtk.org on behalf of Sarah Macumber
Sent: Thu 8/7/2008 11:42 AM
To: vtkusers at vtk.org
Subject: [vtkusers] Inconsistant Picking & possible Bug invtkWorldPointPicker



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));

}

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the 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