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

Method WriteInlineMode

IO/XML/vtkXMLStructuredDataWriter.cxx:414–458  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

412
413//------------------------------------------------------------------------------
414int vtkXMLStructuredDataWriter::WriteInlineMode(vtkIndent indent)
415{
416 vtkDataSet* input = this->GetDataSetInput();
417 ostream& os = *(this->Stream);
418
419 int* extent = input->GetInformation()->Get(vtkDataObject::DATA_EXTENT());
420
421 // Split progress of the data write by the fraction contributed by
422 // each piece.
423 float progressRange[2] = { 0.f, 0.f };
424 this->GetProgressRange(progressRange);
425
426 // Write each piece's XML and data.
427 int result = 1;
428
429 // Set the progress range for this piece.
430 this->SetProgressRange(progressRange, this->CurrentPiece, this->ProgressFractions);
431
432 // Make sure input is valid.
433 if (input->CheckAttributes() == 0)
434 {
435 os << indent << "<Piece";
436 this->WriteVectorAttribute("Extent", 6, extent);
437 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
438 {
439 return 0;
440 }
441
442 os << ">\n";
443
444 this->WriteInlinePiece(indent.GetNextIndent());
445 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
446 {
447 return 0;
448 }
449 os << indent << "</Piece>\n";
450 }
451 else
452 {
453 vtkErrorMacro("Input is invalid for piece " << this->CurrentPiece << ". Aborting.");
454 result = 0;
455 }
456
457 return result;
458}
459
460//------------------------------------------------------------------------------
461template <class iterT>

Callers 1

WriteAPieceMethod · 0.95

Calls 9

WriteInlinePieceMethod · 0.95
CheckAttributesMethod · 0.80
WriteVectorAttributeMethod · 0.80
GetNextIndentMethod · 0.80
GetDataSetInputMethod · 0.45
GetMethod · 0.45
GetInformationMethod · 0.45
GetProgressRangeMethod · 0.45
SetProgressRangeMethod · 0.45

Tested by

no test coverage detected