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

Method WriteData

IO/ParallelXML/vtkXMLPDataObjectWriter.cxx:221–270  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

219
220//------------------------------------------------------------------------------
221int vtkXMLPDataObjectWriter::WriteData()
222{
223 // Write the summary file.
224 ostream& os = *(this->Stream);
225 vtkIndent indent = vtkIndent().GetNextIndent();
226 vtkIndent nextIndent = indent.GetNextIndent();
227
228 this->StartFile();
229 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
230 {
231 return 0;
232 }
233
234 os << indent << "<" << this->GetDataSetName();
235 this->WritePrimaryElementAttributes(os, indent);
236 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
237 {
238 return 0;
239 }
240 os << ">\n";
241
242 // Write the information needed for a reader to produce the output's
243 // information during UpdateInformation without reading a piece.
244 this->WritePData(indent.GetNextIndent());
245 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
246 {
247 return 0;
248 }
249
250 // Write the elements referencing each piece and its file.
251 for (int i = 0; i < this->NumberOfPieces; ++i)
252 {
253 if (this->PieceWrittenFlags[i] == 0)
254 {
255 continue;
256 }
257 os << nextIndent << "<Piece";
258 this->WritePPieceAttributes(i);
259 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
260 {
261 return 0;
262 }
263 os << "/>\n";
264 }
265
266 os << indent << "</" << this->GetDataSetName() << ">\n";
267
268 this->EndFile();
269 return (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError) ? 0 : 1;
270}
271
272//------------------------------------------------------------------------------
273void vtkXMLPDataObjectWriter::WritePPieceAttributes(int index)

Callers

nothing calls this directly

Calls 8

WritePPieceAttributesMethod · 0.95
GetNextIndentMethod · 0.80
vtkIndentClass · 0.50
StartFileMethod · 0.45
GetDataSetNameMethod · 0.45
WritePDataMethod · 0.45
EndFileMethod · 0.45

Tested by

no test coverage detected