------------------------------------------------------------------------------
| 354 | |
| 355 | //------------------------------------------------------------------------------ |
| 356 | void vtkHDFWriter::DispatchDataObject(hid_t group, vtkDataObject* input, unsigned int partId) |
| 357 | { |
| 358 | if (!input) |
| 359 | { |
| 360 | vtkErrorMacro(<< "A vtkDataObject input is required."); |
| 361 | return; |
| 362 | } |
| 363 | |
| 364 | if (this->FileName == nullptr) |
| 365 | { |
| 366 | vtkErrorMacro(<< "Please specify FileName to use."); |
| 367 | return; |
| 368 | } |
| 369 | |
| 370 | vtkPolyData* polydata = vtkPolyData::SafeDownCast(input); |
| 371 | if (polydata) |
| 372 | { |
| 373 | if (!this->WriteDatasetToFile(group, polydata, partId)) |
| 374 | { |
| 375 | vtkErrorMacro(<< "Can't write polydata to file:" << this->FileName); |
| 376 | return; |
| 377 | } |
| 378 | return; |
| 379 | } |
| 380 | vtkUnstructuredGrid* unstructuredGrid = vtkUnstructuredGrid::SafeDownCast(input); |
| 381 | if (unstructuredGrid) |
| 382 | { |
| 383 | if (!this->WriteDatasetToFile(group, unstructuredGrid, partId)) |
| 384 | { |
| 385 | vtkErrorMacro(<< "Can't write unstructuredGrid to file:" << this->FileName); |
| 386 | return; |
| 387 | } |
| 388 | return; |
| 389 | } |
| 390 | vtkPartitionedDataSet* partitioned = vtkPartitionedDataSet::SafeDownCast(input); |
| 391 | if (partitioned) |
| 392 | { |
| 393 | if (!this->WriteDatasetToFile(group, partitioned)) |
| 394 | { |
| 395 | vtkErrorMacro(<< "Can't write partitionedDataSet to file:" << this->FileName); |
| 396 | return; |
| 397 | } |
| 398 | return; |
| 399 | } |
| 400 | vtkDataObjectTree* tree = vtkDataObjectTree::SafeDownCast(input); |
| 401 | if (tree) |
| 402 | { |
| 403 | if (!this->WriteDatasetToFile(group, tree)) |
| 404 | { |
| 405 | vtkErrorMacro(<< "Can't write vtkDataObjectTree to file:" << this->FileName); |
| 406 | return; |
| 407 | } |
| 408 | return; |
| 409 | } |
| 410 | |
| 411 | vtkErrorMacro(<< "Dataset type not supported: " << input->GetClassName()); |
| 412 | } |
| 413 |
no test coverage detected