MCPcopy Create free account
hub / github.com/Kitware/VTK / DispatchDataObject

Method DispatchDataObject

IO/HDF/vtkHDFWriter.cxx:356–412  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

354
355//------------------------------------------------------------------------------
356void 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

Callers 6

WriteDataMethod · 0.95
WriteDatasetToFileMethod · 0.95
AppendBlocksMethod · 0.95
AppendIterDataObjectMethod · 0.95

Calls 2

WriteDatasetToFileMethod · 0.95
GetClassNameMethod · 0.45

Tested by

no test coverage detected