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

Method MarshallDataSet

IO/Parallel/vtkPChacoReader.cxx:466–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464 return tmp;
465}
466char* vtkPChacoReader::MarshallDataSet(vtkUnstructuredGrid* extractedGrid, vtkIdType& len)
467{
468 // taken from vtkCommunicator::WriteDataSet
469
470 vtkUnstructuredGrid* copy;
471 vtkDataSetWriter* writer = vtkDataSetWriter::New();
472
473 copy = extractedGrid->NewInstance();
474 copy->ShallowCopy(extractedGrid);
475
476 // There is a problem with binary files with no data.
477 if (copy->GetNumberOfCells() > 0)
478 {
479 writer->SetFileTypeToBinary();
480 }
481 writer->WriteToOutputStringOn();
482 writer->SetInputData(copy);
483
484 writer->Write();
485
486 len = writer->GetOutputStringLength();
487
488 char* packedFormat = writer->RegisterAndGetOutputString();
489
490 writer->Delete();
491
492 copy->Delete();
493
494 return packedFormat;
495}
496vtkUnstructuredGrid* vtkPChacoReader::UnMarshallDataSet(char* buf, vtkIdType size)
497{
498 // taken from vtkCommunicator::ReadDataSet

Callers 1

SendGridMethod · 0.95

Calls 8

DeleteMethod · 0.65
NewFunction · 0.50
NewInstanceMethod · 0.45
ShallowCopyMethod · 0.45
GetNumberOfCellsMethod · 0.45
SetInputDataMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected