40 vtkThreshold* threshold = vtkThreshold::New();
47 vtkDataSetAttributes* pointAttributes =
48 dataSet->GetAttributes(vtkDataObject::AttributeTypes::POINT);
49 vtkDataSetAttributes* cellAttributes =
50 dataSet->GetAttributes(vtkDataObject::AttributeTypes::CELL);
51 if (pointAttributes->GetNumberOfArrays() > 0)
53 threshold->SetInputArrayToProcess(
54 0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS,
55 pointAttributes->GetArray(0)->GetName());
57 else if (cellAttributes->GetNumberOfArrays() > 0)
59 threshold->SetInputArrayToProcess(
60 0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS,
61 cellAttributes->GetArray(0)->GetName());
65 WARN(
"Threshold filter could not find an array on its input object!");
70 threshold->SetSelectedComponent(0);
74 const double dMin = std::numeric_limits<double>::lowest();
75 const double dMax = std::numeric_limits<double>::max();
76 threshold->SetThresholdFunction(
77 vtkThreshold::ThresholdType::THRESHOLD_BETWEEN);
78 threshold->SetLowerThreshold(dMin);
79 threshold->SetUpperThreshold(dMax);
82 QList<QVariant> thresholdRangeList;
84 thresholdRangeList.push_back(dMin);
85 thresholdRangeList.push_back(dMax);
87 (*_algorithmUserVectorProperties)[
"Range"] = thresholdRangeList;
90 (*_algorithmUserProperties)[
"Selected Component"] = 0;
93 threshold->SetAllScalars(1);
94 (*_algorithmUserProperties)[
"Evaluate all points"] =
true;