[vtkusers] FindPoint -> Seg Fault
    Oliver Fleig 
    Oliver.Fleig at chu-rennes.fr
       
    Wed Mar 20 07:42:03 EST 2002
    
    
  
Hello!
What's wrong with the following code:
void ofActorListDlg::selectActor(vtkActor* actor, vtkPicker* picker){
  vtkPoints *picked_points = picker->GetPickedPositions();
  float tmp_pt[3];
  float TRE;
  int id;
  
  if(picked_points->GetNumberOfPoints() > 0){
    picked_points->GetPoint(0, tmp_pt);
    if(actor)
      if(actor->GetMapper())
	if(actor->GetMapper()->GetInput()){
		actor->GetMapper()->GetInput()->Print(cerr);
		id = actor->GetMapper()->GetInput()->FindPoint(tmp_pt);
		cerr << "point id " << id <<  endl;
        }
}
####
I get until the 
actor->GetMapper()->GetInput()->Print(cerr);
which prints out what I would expect.
But
id = actor->GetMapper()->GetInput()->FindPoint(tmp_pt);
produces a segmentation fault. However, only if the DataSet contains
Scalars!!!!!!. 
Is there somthing basically wrong the way I access the data by "climbing" 
back up from vtkActor??
I am using vtk4.0.0.
Cheers
Oliver
    
    
More information about the vtkusers
mailing list