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

Method WriteCellsInlineWorker

IO/XML/vtkXMLUnstructuredDataWriter.cxx:653–746  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

651
652//------------------------------------------------------------------------------
653void vtkXMLUnstructuredDataWriter::WriteCellsInlineWorker(
654 const char* name, vtkDataArray* types, vtkIndent indent)
655{
656 ostream& os = *(this->Stream);
657 os << indent << "<" << name << ">\n";
658
659 // Split progress by cell connectivity, offset, and type arrays.
660 float progressRange[2] = { 0, 0 };
661 this->GetProgressRange(progressRange);
662 float fractions[8];
663 this->CalculateCellFractions(fractions, types ? types->GetNumberOfTuples() : 0);
664
665 // Set the range of progress for the connectivity array.
666 this->SetProgressRange(progressRange, 0, fractions);
667
668 // Write the connectivity array.
669 this->WriteArrayInline(this->CellPoints, indent.GetNextIndent());
670 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
671 {
672 return;
673 }
674
675 // Set the range of progress for the offsets array.
676 this->SetProgressRange(progressRange, 1, fractions);
677
678 // Write the offsets array.
679 this->WriteArrayInline(this->CellOffsets, indent.GetNextIndent());
680 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
681 {
682 return;
683 }
684
685 if (types)
686 {
687 // Set the range of progress for the types array.
688 this->SetProgressRange(progressRange, 2, fractions);
689
690 // Write the types array.
691 this->WriteArrayInline(types, indent.GetNextIndent(), "types");
692 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
693 {
694 return;
695 }
696 }
697
698 if (this->FaceConnectivity && this->FaceConnectivity->GetNumberOfTuples())
699 {
700 // Set the range of progress for the faces array.
701 this->SetProgressRange(progressRange, 3, fractions);
702
703 // Write the face connectivity array.
704 this->WriteArrayInline(this->FaceConnectivity, indent.GetNextIndent(), "face_connectivity");
705 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
706 {
707 return;
708 }
709
710 this->SetProgressRange(progressRange, 4, fractions);

Callers 2

WriteCellsInlineMethod · 0.95
WritePolyCellsInlineMethod · 0.95

Calls 7

WriteArrayInlineMethod · 0.80
GetNextIndentMethod · 0.80
GetProgressRangeMethod · 0.45
GetNumberOfTuplesMethod · 0.45
SetProgressRangeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected