------------------------------------------------------------------------------
| 205 | |
| 206 | //------------------------------------------------------------------------------ |
| 207 | void vtkHyperTreeGridCellCenters::RecursivelyProcessTree( |
| 208 | vtkHyperTreeGridNonOrientedGeometryCursor* cursor) |
| 209 | { |
| 210 | // Skip masked cells |
| 211 | if (cursor->IsMasked()) |
| 212 | { |
| 213 | return; |
| 214 | } |
| 215 | |
| 216 | // Create cell center if cursor is at leaf |
| 217 | if (cursor->IsLeaf()) |
| 218 | { |
| 219 | // Cursor is at leaf, retrieve its global index |
| 220 | vtkIdType id = cursor->GetGlobalNodeIndex(); |
| 221 | |
| 222 | // If leaf is masked, skip it |
| 223 | if (this->InMask && this->InMask->GetValue(id)) |
| 224 | { |
| 225 | return; |
| 226 | } |
| 227 | |
| 228 | // Retrieve cell center coordinates |
| 229 | double pt[3]; |
| 230 | cursor->GetPoint(pt); |
| 231 | |
| 232 | // Insert next point |
| 233 | vtkIdType outId = this->Points->InsertNextPoint(pt); |
| 234 | |
| 235 | // Copy cell center data from leaf data, when needed |
| 236 | this->OutData->CopyData(this->InData, id, outId); |
| 237 | } |
| 238 | else |
| 239 | { |
| 240 | // Cursor is not at leaf, recurse to all children |
| 241 | int numChildren = this->Input->GetNumberOfChildren(); |
| 242 | for (int child = 0; child < numChildren; ++child) |
| 243 | { |
| 244 | if (this->CheckAbort()) |
| 245 | { |
| 246 | break; |
| 247 | } |
| 248 | cursor->ToChild(child); |
| 249 | // Recurse |
| 250 | this->RecursivelyProcessTree(cursor); |
| 251 | cursor->ToParent(); |
| 252 | } // child |
| 253 | } // else |
| 254 | } |
| 255 | VTK_ABI_NAMESPACE_END |
no test coverage detected