[vtkusers] Bug in vtkPicker

Patrick de Koning patrick at lkeb.azl.nl
Thu Jun 15 08:29:19 EDT 2000


Hello,

I discovered 2 bugs in the vtkPicker. The first bug causes the list of
picked props to continously grow (the prop3Dcollection is never cleaned)
and the second bug causes strange behaviour when one or more props
aren't visible or pickable.

Fixes:
The function vtkPicker::Initliaze misses the following statement:
    this->Prop3Ds->RemoveAllItems();

The fix for the second bug requires either the variable 'pickable' in
the fucntion vtkPicker::Pick(..) to be initialized to 0, or an else
statement

for ( props->InitTraversal(); (prop=props->GetNextProp()); )
{
     for ( prop->InitPathTraversal(); (path=prop->GetNextPath()); )
    {
         propCandidate = path->GetLastNode()->GetProp();
          if ( propCandidate->GetPickable() &&
propCandidate->GetVisibility() )
          {
                .....
          }
          else // Added
            pickable = 0;

        ...
    }
}

I hope this fixes are correct.

Patrick de Koning.





More information about the vtkusers mailing list