39 vtkInformationVector **inputVector,
40 vtkInformationVector *outputVector) {
42 auto input = vtkDataObject::GetData(inputVector[0]);
44 if(this->LastInput != input || this->IterationIdx >= this->IterationNumber) {
45 this->LastInput = input;
46 this->IterationIdx = 0;
52 if(input->IsA(
"vtkMultiBlockDataSet"))
54 else if(input->IsA(
"vtkTable"))
57 this->
printErr(
"Unable to automatically determine iteration mode.");
65 auto inputAsMB = vtkMultiBlockDataSet::SafeDownCast(input);
68 "Block iteration requires 'vtkMultiBlockDataSet' input.");
71 this->IterationNumber = inputAsMB->GetNumberOfBlocks();
76 auto inputAsMB = vtkMultiBlockDataSet::SafeDownCast(input);
78 if(!inputAsMB || inputAsMB->GetNumberOfBlocks() < 1) {
80 "Block Tuple iteration requires 'vtkMultiBlockDataSet' input that "
81 "contains at least one 'vtkMultiBlockDataSet'.");
85 = vtkMultiBlockDataSet::SafeDownCast(inputAsMB->GetBlock(0));
88 "Block Tuple iteration requires 'vtkMultiBlockDataSet' input that "
89 "contains at least one 'vtkMultiBlockDataSet'.");
92 this->IterationNumber = firstComponent->GetNumberOfBlocks();
97 auto inputAsT = vtkTable::SafeDownCast(input);
99 this->
printErr(
"Row iteration requires 'vtkTable' input.");
102 this->IterationNumber = inputAsT->GetNumberOfRows();
107 auto inputArray = this->GetInputArrayToProcess(0, inputVector);
109 this->
printErr(
"Unable to retrieve input array.");
112 this->IterationNumber = inputArray->GetNumberOfTuples();
120 this->IterationNumber = inputFD->GetNumberOfArrays();
122 this->
printErr(
"Unable to retrieve attribute type.");
136 iterationInformation->SetName(
"_ttk_IterationInfo");
137 iterationInformation->SetNumberOfComponents(2);
138 iterationInformation->SetNumberOfTuples(1);
139 iterationInformation->SetValue(0, this->IterationIdx);
140 iterationInformation->SetValue(1, this->IterationNumber);
142 std::string
const modeStrings[6] = {
"B",
"R",
"G",
"V",
"A",
"BT"};
143 this->
printMsg(
"[" + modeStrings[
static_cast<int>(mode)] +
"] Iteration: ( "
144 + std::to_string(this->IterationIdx) +
" / "
145 + std::to_string(this->IterationNumber - 1) +
" ) ",
156 auto output = vtkDataObject::GetData(outputVector);
157 addRecursivelyToFieldData(output, iterationInformation);
159 this->IterationIdx++;
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)