55 vtkInformationVector **inputVector,
56 vtkInformationVector *outputVector) {
57 const auto input = vtkPointSet::GetData(inputVector[0]);
58 auto output = vtkUnstructuredGrid::GetData(outputVector);
60 if(input ==
nullptr || output ==
nullptr) {
61 this->
printErr(
"Null input data, aborting");
66 const auto oa = this->GetInputArrayToProcess(0, inputVector);
69 this->
printErr(
"Cannot find the required data array");
73 const auto nvalues = oa->GetNumberOfTuples();
76 std::vector<std::pair<vtkIdType, double>> orderedValues{};
78 switch(oa->GetDataType()) {
86 = [](
const std::pair<vtkIdType, double> &a,
87 const std::pair<vtkIdType, double> &b) {
return a.second < b.second; };
91 this->
threadNumber_, orderedValues.begin(), orderedValues.end(), cmp);
94 output->ShallowCopy(input);
97 vtkNew<vtkCellArray> cells{};
99 for(
size_t i = 1; i < orderedValues.size(); ++i) {
100 std::array<vtkIdType, 2> linePoints{
101 orderedValues[i - 1].first, orderedValues[i].first};
102 cells->InsertNextCell(2, linePoints.data());
106 std::array<vtkIdType, 2> linePoints{
107 orderedValues.back().first, orderedValues.front().first};
108 cells->InsertNextCell(2, linePoints.data());
111 output->SetCells(VTK_LINE, cells);