[vtkusers] Inconsistant Picking & possible BuginvtkWorldPointPicker
David E DeMarle
dave.demarle at kitware.com
Mon Aug 11 11:55:50 EDT 2008
Yes that seams very likely. I applied Julian Ibarz's patch after 5.2 was
released and it looks like that change will make it so that you get a
reliable z value after the rubber band interactor style does its drawing.
We'll get that patch merged into the next 5.2 release.
cheers,
Dave DeMarle
On Thu, Aug 7, 2008 at 6:16 PM, Sarah Macumber <
S.Macumber at questreliability.com> wrote:
> http://www.vtk.org/Bug/view.php?id=7236
>
> Any chance this is the same bug? I am on 5.2 wrapped Dot Net VTK.
>
> Sarah
>
> ________________________________
>
> From: vtkusers-bounces at vtk.org on behalf of Sarah Macumber
> Sent: Thu 8/7/2008 4:58 PM
> To: David E DeMarle
> Cc: vtkusers at vtk.org; Jim Rowe
> Subject: Re: [vtkusers] Inconsistant Picking & possible
> BuginvtkWorldPointPicker
>
>
>
> Hi Dave,
>
> What seems to be going on is that the Z buffer value is 0.0 which causes
> the point to be returned as the center of the frustum.
> double z1 = GraphicsWindowRenderer.GetPickedZ(); // value is
> 0
> double z2 = GraphicsWindowRenderer.GetZ(pos[0], pos[1]); // value is 0
> if I forcibly set the value to something like 0.9999 then picking is
> correct.
>
> Since you have the start and end position of the rubber band interactor I
> think it would be best to expose them.
>
> Thanks in advance,
> Sarah
>
> ________________________________
>
> From: David E DeMarle [mailto:dave.demarle at kitware.com]
> Sent: Thu 8/7/2008 4:40 PM
> To: Sarah Macumber
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] Inconsistant Picking & possible Bug
> invtkWorldPointPicker
>
>
> 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
>
>
>
> _______________________________________________
> 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/20080811/7f7ee0ed/attachment.htm>
More information about the vtkusers
mailing list