vtkSelectVisiblePoints Not working
I am writing some code to do the depth test for some vtkPolyData object, and I want to use vtkSelectVisiblePoints class in a qvtkwidget. However, I always got 0 points.
Following is the minimum code:
// in the qvtkwidget class: visible_filter = vtkSmartPointer<vtkSelectVisiblePoints>::New(); visible_filter->SetInputData(poly_data); visible_filter->SetRenderer(renderer); visible_filter->Update(); // in the overriding vtkInteractorStyleTrackballCamera class: this->visible_filter->Update(); qDebug() << "There are currently: " << this->visible_filter->GetOutput()->GetNumberOfPoints() << " visible.";
I am not sure whether this is related to QT or vtkPolyData, since in the official example, they used SetInputConnection(), but here I used SetInputData(). Any suggestions would be appreciated.