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

Method WritePiece

IO/ParallelXML/vtkXMLPTableWriter.cxx:90–125  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

88
89//------------------------------------------------------------------------------
90int vtkXMLPTableWriter::WritePiece(int index)
91{
92 // Create the writer for the piece. Its configuration should match
93 // our own writer.
94 vtkXMLWriter* pWriter = this->CreatePieceWriter(index);
95 pWriter->AddObserver(vtkCommand::ProgressEvent, this->InternalProgressObserver);
96
97 char* fileName = this->CreatePieceFileName(index, this->PathName);
98 std::string path = vtksys::SystemTools::GetParentDirectory(fileName);
99 if (!path.empty() && !vtksys::SystemTools::PathExists(path))
100 {
101 vtksys::SystemTools::MakeDirectory(path);
102 }
103 pWriter->SetFileName(fileName);
104 delete[] fileName;
105
106 // Copy the writer settings.
107 pWriter->SetDebug(this->Debug);
108 pWriter->SetCompressor(this->Compressor);
109 pWriter->SetDataMode(this->DataMode);
110 pWriter->SetByteOrder(this->ByteOrder);
111 pWriter->SetEncodeAppendedData(this->EncodeAppendedData);
112 pWriter->SetHeaderType(this->HeaderType);
113 pWriter->SetBlockSize(this->BlockSize);
114 pWriter->SetWriteTimeValue(this->GetWriteTimeValue());
115
116 // Write the piece.
117 int result = pWriter->Write();
118 this->SetErrorCode(pWriter->GetErrorCode());
119
120 // Cleanup.
121 pWriter->RemoveObserver(this->InternalProgressObserver);
122 pWriter->Delete();
123
124 return result;
125}
126
127//------------------------------------------------------------------------------
128void vtkXMLPTableWriter::WritePRowData(vtkDataSetAttributes* ds, vtkIndent indent)

Callers 1

WritePieceInternalMethod · 0.95

Calls 12

CreatePieceWriterMethod · 0.95
SetByteOrderMethod · 0.80
SetHeaderTypeMethod · 0.80
DeleteMethod · 0.65
AddObserverMethod · 0.45
CreatePieceFileNameMethod · 0.45
emptyMethod · 0.45
SetFileNameMethod · 0.45
SetDebugMethod · 0.45
SetBlockSizeMethod · 0.45
WriteMethod · 0.45
RemoveObserverMethod · 0.45

Tested by

no test coverage detected