Finding critical point in vtkPolyData. Found the GetScalarFieldCriticalIndex method, but the method always returns ERR_INCORRECT_FIELD (-3), what am I doing wrong?
vtkDoubleArray* da = dynamic_cast<vtkDoubleArray*>(pd->GetPointData()->GetArray(0));
if (da != NULL) {
for (int i = 0; i < pd->GetNumberOfPoints(); i++) {
auto p = points->GetPoint(i);
pointsNew->InsertNextPoint(p[0], p[1], p[2] + da->GetValue(i));
int type = pd->GetScalarFieldCriticalIndex(pd->FindPoint(p[0], p[1], p[2]), 0);
if (type != -3) {