[vtkusers] Inconsistant Picking & possible Bug invtkWorldPointPicker
David E DeMarle
dave.demarle at kitware.com
Thu Aug 7 17:40:33 EDT 2008
Howdy,
This is dimly ringing a very rusty bell in my head.
Before AreaPicker and InterarctorStyleRBPick were added, all picking was
done on a single pixel. Thus the comment in the AreaPicker doxygen about the
GetPickPoint being ill-defined. As I recall I made it so that when you ask
for that you get the center of the frustum.
You may try getting a Frustum out or, we can add and accessor to the
InteractorStyle to get screen start and end pick coordinates.
cheers,
Dave
On Thu, Aug 7, 2008 at 4:38 PM, Sarah Macumber <
S.Macumber at questreliability.com> wrote:
> 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
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080807/01ec064b/attachment.htm>
More information about the vtkusers
mailing list