------------------------------------------------------------------------------
| 261 | |
| 262 | //------------------------------------------------------------------------------ |
| 263 | void vtkDataObjectTree::SetDataSetFrom( |
| 264 | vtkDataObjectTreeIterator* dObjTreeIter, vtkDataObject* dataObj) |
| 265 | { |
| 266 | if (!dObjTreeIter || dObjTreeIter->IsDoneWithTraversal()) |
| 267 | { |
| 268 | vtkErrorMacro("Invalid iterator location."); |
| 269 | return; |
| 270 | } |
| 271 | |
| 272 | vtkDataObjectTreeIndex index = dObjTreeIter->GetCurrentIndex(); |
| 273 | |
| 274 | if (index.empty()) |
| 275 | { |
| 276 | // Sanity check. |
| 277 | vtkErrorMacro("Invalid index returned by iterator."); |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | vtkDataObjectTree* parent = this; |
| 282 | int numIndices = static_cast<int>(index.size()); |
| 283 | for (int cc = 0; cc < numIndices - 1; cc++) |
| 284 | { |
| 285 | if (!parent || parent->GetNumberOfChildren() <= index[cc]) |
| 286 | { |
| 287 | vtkErrorMacro("Structure is not expected. Did you forget to use copy structure?"); |
| 288 | return; |
| 289 | } |
| 290 | parent = vtkDataObjectTree::SafeDownCast(parent->GetChild(index[cc])); |
| 291 | } |
| 292 | |
| 293 | if (!parent || parent->GetNumberOfChildren() <= index.back()) |
| 294 | { |
| 295 | vtkErrorMacro("Structure is not expected. Did you forget to use copy structure?"); |
| 296 | return; |
| 297 | } |
| 298 | |
| 299 | parent->SetChild(index.back(), dataObj); |
| 300 | } |
| 301 | |
| 302 | //------------------------------------------------------------------------------ |
| 303 | vtkDataObject* vtkDataObjectTree::GetDataSet(vtkCompositeDataIterator* compositeIter) |
no test coverage detected