62 vtkInformationVector **inputVector,
63 vtkInformationVector *outputVector) {
64 vtkDataSet *input = vtkDataSet::GetData(inputVector[0]);
65 vtkDataSet *output = vtkDataSet::GetData(outputVector);
67 inputScalars_ = this->GetInputArrayToProcess(0, inputVector);
71 int const inputArrayAssociation
72 = this->GetInputArrayAssociation(0, inputVector);
74 if(inputArrayAssociation > 1 || inputArrayAssociation < 0) {
75 printErr(
"input array has to be cell data or point data.");
83 const SimplexId numberOfValues = inputArrayAssociation == 0
84 ? input->GetNumberOfPoints()
85 : input->GetNumberOfCells();
87 vector<SimplexId> inputIds(numberOfValues);
88 std::iota(inputIds.begin(), inputIds.end(), 0);
89 switch(inputScalars_->GetDataType()) {
90 vtkTemplateMacro(dispatch<VTK_TT>(inputIds));
97 ids->SetNumberOfComponents(1);
98 ids->SetNumberOfTuples(numberOfValues);
99 ids->SetName(inputArrayAssociation == 0 ?
"PointScalarFieldName"
100 :
"CellScalarFieldName");
105 for(
int i = 0; i < numberOfValues; ++i)
106 outputIds[inputIds[i]] = i;
108 for(
int i = 0; i < numberOfValues; ++i)
112 output->ShallowCopy(input);
114 if(inputArrayAssociation == 0) {
115 output->GetPointData()->AddArray(ids);
117 output->GetCellData()->AddArray(ids);
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)