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

Method MarshallDataSet

Filters/ParallelGeometry/vtkPDistributedDataFilter.cxx:2372–2404  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2370
2371//------------------------------------------------------------------------------
2372char* vtkPDistributedDataFilter::MarshallDataSet(vtkUnstructuredGrid* extractedGrid, vtkIdType& len)
2373{
2374 TimeLog timer("MarshallDataSet", this->Timing);
2375 (void)timer;
2376
2377 // taken from vtkCommunicator::WriteDataSet
2378
2379 vtkUnstructuredGrid* copy;
2380 vtkDataSetWriter* writer = vtkDataSetWriter::New();
2381
2382 copy = extractedGrid->NewInstance();
2383 copy->ShallowCopy(extractedGrid);
2384
2385 // There is a problem with binary files with no data.
2386 if (copy->GetNumberOfCells() > 0)
2387 {
2388 writer->SetFileTypeToBinary();
2389 }
2390 writer->WriteToOutputStringOn();
2391 writer->SetInputData(copy);
2392
2393 writer->Write();
2394
2395 len = writer->GetOutputStringLength();
2396
2397 char* packedFormat = writer->RegisterAndGetOutputString();
2398
2399 writer->Delete();
2400
2401 copy->Delete();
2402
2403 return packedFormat;
2404}
2405
2406//------------------------------------------------------------------------------
2407vtkUnstructuredGrid* vtkPDistributedDataFilter::UnMarshallDataSet(char* buf, vtkIdType size)

Callers 2

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