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

Method WriteStructuredGridMetaData

IO/Parallel/vtkPDataSetWriter.cxx:461–494  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

459
460//------------------------------------------------------------------------------
461int vtkPDataSetWriter::WriteStructuredGridMetaData(
462 vtkStructuredGrid* input, char* root, char* str, size_t strSize, ostream* fptr)
463{
464 int i;
465 int* pi;
466
467 // We should indicate the type of data that is being saved.
468 *fptr << " dataType=\"" << input->GetClassName() << "\"" << endl;
469
470 pi = vtkStreamingDemandDrivenPipeline::GetWholeExtent(this->GetInputInformation());
471 *fptr << " wholeExtent=\"" << pi[0] << " " << pi[1] << " " << pi[2] << " " << pi[3] << " "
472 << pi[4] << " " << pi[5] << "\"" << endl;
473
474 // This is making the assumption that all the files will be written out by
475 // some processes.
476 *fptr << " numberOfPieces=\"" << this->NumberOfPieces << "\" >" << endl;
477 for (i = 0; i < this->NumberOfPieces; ++i)
478 {
479 pi = this->Extents[i].data();
480 auto result = vtk::format_to_n(str, strSize, this->FilePatternStdFormat, root, i);
481 *result.out = '\0';
482 *fptr << " <Piece fileName=\"" << str << "\"" << endl
483 << " extent=\"" << pi[0] << " " << pi[1] << " " << pi[2] << " " << pi[3] << " "
484 << pi[4] << " " << pi[5] << "\" />" << endl;
485 }
486 *fptr << "</File>" << endl;
487
488 fptr->flush();
489 if (fptr->fail())
490 {
491 return 0;
492 }
493 return 1;
494}
495
496//------------------------------------------------------------------------------
497// Open a vtk data file. Returns nullptr if error.

Callers 1

WriteMethod · 0.95

Calls 6

GetWholeExtentFunction · 0.85
format_to_nFunction · 0.50
GetClassNameMethod · 0.45
GetInputInformationMethod · 0.45
dataMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected