[vtkusers] Is this a bug in vtkPicker?

derong derong at lycos.co.uk
Tue Jun 22 20:15:38 EDT 2004


Hi, 
 
The pick function in VTK is some unstable. I tried to do some programming to
pick a vtkProp in a vtkAssembly.
it turned out to crash after i picked several times. I tried to track the
code in VTK, and found vtkPicker has some suspicious codes.
in version(4.2.1) line 300 of vtkPicker.cxx:
      this->Prop3Ds->AddItem((vtkProp3D *)prop);
I guess something is wrong there. it will collect the assembly many times.
now I found it was updated with 
the codes in CVS  :
                                  if ( ! this->Prop3Ds->IsItemPresent(prop)
)
368                             {
369                             this->Prop3Ds->AddItem((vtkProp3D *)prop);
370                             }
 
I think it is better to change as:
                                   if ( !
this->Prop3Ds->IsItemPresent(propCandidate) )
368                             {
369                             this->Prop3Ds->AddItem((vtkProp3D
*)propCandidate);
370                             }
 
As i read the code, I think prop is a vtkAssembly and propCandidate is a
vtkProp composited in the assembly.
before we add this item to Props3Ds, propCandidate's bounding box is checked
for the intersection test. So i think it 
is rational to add propCandidate to Props3Ds.
 
Do we have some serious picking test with vtkAssembly involved?
 
I'm not sure my opinion is correct or wrong. anyway, i hope vtk has a robust
picking function.
any hints will be helpful.
 
Thanks
 
Dennis   
           
 
 


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040622/0be3d45a/attachment.htm>


More information about the vtkusers mailing list