------------------------------------------------------------------------------
| 140 | |
| 141 | //------------------------------------------------------------------------------ |
| 142 | void vtkHyperTreeGridEvaluateCoarse::ProcessNode(vtkHyperTreeGridNonOrientedCursor* outCursor) |
| 143 | { |
| 144 | if (this->CheckAbort()) |
| 145 | { |
| 146 | return; |
| 147 | } |
| 148 | |
| 149 | vtkIdType currentId = outCursor->GetGlobalNodeIndex(); |
| 150 | |
| 151 | // Leaf/Masked cell: data does not change |
| 152 | if (outCursor->IsLeaf() || outCursor->IsMasked()) |
| 153 | { |
| 154 | this->OutData->CopyData(this->InData, currentId, currentId); |
| 155 | return; |
| 156 | } |
| 157 | |
| 158 | // Coarse cell: recurse and retrieve values |
| 159 | int nbArray = this->InData->GetNumberOfArrays(); |
| 160 | std::vector<std::vector<std::vector<double>>> childrenValues(outCursor->GetNumberOfChildren()); |
| 161 | |
| 162 | for (int ichild = 0; ichild < outCursor->GetNumberOfChildren(); ++ichild) |
| 163 | { |
| 164 | this->ProcessChild(outCursor, ichild, childrenValues[ichild]); |
| 165 | } |
| 166 | |
| 167 | // Reduction operation over the resulting array |
| 168 | for (int arrayId = 0; arrayId < nbArray; ++arrayId) |
| 169 | { |
| 170 | if (this->CheckAbort()) |
| 171 | { |
| 172 | break; |
| 173 | } |
| 174 | vtkDataArray* arr = this->OutData->GetArray(arrayId); |
| 175 | int nbComponents = arr->GetNumberOfComponents(); |
| 176 | for (int componentID = 0; componentID < nbComponents; ++componentID) |
| 177 | { |
| 178 | // Copy child values from every child array |
| 179 | std::vector<double> childVals(outCursor->GetNumberOfChildren(), 0.0); |
| 180 | for (unsigned char ichild = 0; ichild < outCursor->GetNumberOfChildren(); ichild++) |
| 181 | { |
| 182 | childVals[ichild] = childrenValues[ichild][arrayId][componentID]; |
| 183 | } |
| 184 | arr->SetComponent(currentId, componentID, EvalCoarse(childVals)); |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | //------------------------------------------------------------------------------ |
| 190 | void vtkHyperTreeGridEvaluateCoarse::ProcessChild(vtkHyperTreeGridNonOrientedCursor* outCursor, |
no test coverage detected