View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009459VTKBugpublic2009-08-31 00:422014-10-01 21:34
ReporterAyman W. Habib 
Assigned ToJoachim Pouderoux 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0009459: Bug in picking objects arranged as an assembly
DescriptionQuoting "Eran Guendelman" back in 2007, using VTK 5.0.3

I'm finding in my program that even when I call SetVisibility(0) and
SetPickable(0) on vtkActors in my scene, the vtkPropPicker is
incorrectly allowing them to be picked. I traced through the VTK code
and believe I found the bug. Here's basically what's happening. Say my
scene is:

A -> B -> C
        -> D

A: top level scene assembly
B: an assembly which is a part of A (e.g. a model in the scene)
C and D: vtkActors which are part of assembly B (e.g. bodies in my model)

So now suppose I hide body C (SetVisibility(0), and also SetPickable(0)
for good measure although I don't think that's necessary under usual
circumstances).

vtkPropPicker::Pick() calls vtkRenderer::PickRender() down the line,
which does the following:

(1) Goes through all the top-level vtkProps in the scene. Namely A. It
  then adds A to a pickFrom list.

(2) A cullPicker (of type vtkPicker) is created to execute a pick
against bounding boxes, to cull the bodies that will be rendered by the
underlying DevicePickRender(). vtkPicker::Pick goes through each
vtkProp in the pickFrom list (namely A), and goes through all paths of
that prop (namely A->B->C and A->B->D). It omits any paths whose leaf
node is not visible (so it omits A->B->C but intersects against
A->B->D). In the situation where we do intersect D's bounding box, the
top-level vtkProp is added to the vtkPicker's Prop3Ds list... ***i.e. A
is added th the Prop3Ds list... NOT the leaf node D***

(3) back in vtkRenderer::PickRender(), it fills PathArray with *ALL* of
the paths of all of the vtkProps in the Prop3Ds list. i.e. it fills
PathArray with all of the paths of A, which are A->B->C and A->B->D.
(THIS IS ALREADY BAD NEWS BECAUSE A->B->C IS BACK UNDER CONSIDERATION)

(4) vtkOpenGLRenderer::DevicePickRender() is called, which calls
vtkRenderer::PickGeometry(), which renders everything in the PathArray,
and makes this comment:
   // We can render everything because if it was
   // not visible it would not have been put in the
   // list in the first place, and if it was allocated
   // no time (culled) it would have been removed from
   // the list


So there's an obvious problem here. When an intersection with D was
found, the top-level vtkProp A was added to the Prop3Ds list... and then
*all* of the paths of A were intersected against by the device pick
render step. Ignoring the fact that A->B->C is supposed to be invisible
and not pickable!

So is this a bug? And suggestions for getting around it? (Yes, I could
make a flat scene graph and put C and D as top-level actors in the
scene, but that's not a satisfactory solution).

Thanks.
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0032595)
Joachim Pouderoux (developer)
2014-04-15 12:22

http://review.source.kitware.com/#/c/15150/ [^]
(0033410)
Sean McBride (developer)
2014-10-01 21:34

The gerrit change was merged.

- Issue History
Date Modified Username Field Change
2009-08-31 00:42 Ayman W. Habib New Issue
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2014-04-15 12:21 Joachim Pouderoux Project => TBD
2014-04-15 12:21 Joachim Pouderoux Type => incorrect functionality
2014-04-15 12:21 Joachim Pouderoux Assigned To => Joachim Pouderoux
2014-04-15 12:21 Joachim Pouderoux Status expired => backlog
2014-04-15 12:21 Joachim Pouderoux Resolution open => fixed
2014-04-15 12:21 Joachim Pouderoux Status backlog => gerrit review
2014-04-15 12:22 Joachim Pouderoux Note Added: 0032595
2014-04-15 12:22 Joachim Pouderoux Category (No Category) => Bug
2014-10-01 21:34 Sean McBride Note Added: 0033410
2014-10-01 21:34 Sean McBride Status gerrit review => closed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker