29 vtkThreshold* threshold = vtkThreshold::New();
36 vtkDataSetAttributes* pointAttributes =
37 dataSet->GetAttributes(vtkDataObject::AttributeTypes::POINT);
38 vtkDataSetAttributes* cellAttributes =
39 dataSet->GetAttributes(vtkDataObject::AttributeTypes::CELL);
40 if (pointAttributes->GetNumberOfArrays() > 0)
42 threshold->SetInputArrayToProcess(
43 0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS,
44 pointAttributes->GetArray(0)->GetName());
46 else if (cellAttributes->GetNumberOfArrays() > 0)
48 threshold->SetInputArrayToProcess(
49 0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS,
50 cellAttributes->GetArray(0)->GetName());
54 WARN(
"Threshold filter could not find an array on its input object!");
59 threshold->SetSelectedComponent(0);
63 const double dMin = std::numeric_limits<double>::lowest();
64 const double dMax = std::numeric_limits<double>::max();
65 threshold->SetThresholdFunction(
66 vtkThreshold::ThresholdType::THRESHOLD_BETWEEN);
67 threshold->SetLowerThreshold(dMin);
68 threshold->SetUpperThreshold(dMax);
71 QList<QVariant> thresholdRangeList;
73 thresholdRangeList.push_back(dMin);
74 thresholdRangeList.push_back(dMax);
76 (*_algorithmUserVectorProperties)[
"Range"] = thresholdRangeList;
79 (*_algorithmUserProperties)[
"Selected Component"] = 0;
82 threshold->SetAllScalars(1);
83 (*_algorithmUserProperties)[
"Evaluate all points"] =
true;