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

Method WriteHeader

IO/XML/vtkXMLTableWriter.cxx:240–328  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

238
239//------------------------------------------------------------------------------
240int vtkXMLTableWriter::WriteHeader()
241{
242 vtkIndent indent = vtkIndent().GetNextIndent();
243
244 ostream& os = *(this->Stream);
245
246 if (!this->WritePrimaryElement(os, indent))
247 {
248 return 0;
249 }
250
251 this->WriteFieldData(indent.GetNextIndent());
252
253 if (this->DataMode == vtkXMLWriter::Appended)
254 {
255 vtkIndent nextIndent = indent.GetNextIndent();
256
257 this->AllocatePositionArrays();
258
259 if ((this->WritePiece < 0) || (this->WritePiece >= this->NumberOfPieces))
260 {
261 // Loop over each piece and write its structure.
262 for (int currentPieceIndex = 0; currentPieceIndex < this->NumberOfPieces; ++currentPieceIndex)
263 {
264 // Open the piece's element.
265 os << nextIndent << "<Piece";
266 this->WriteAppendedPieceAttributes(currentPieceIndex);
267 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
268 {
269 this->DeletePositionArrays();
270 return 0;
271 }
272 os << ">\n";
273
274 this->WriteAppendedPiece(currentPieceIndex, nextIndent.GetNextIndent());
275 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
276 {
277 this->DeletePositionArrays();
278 return 0;
279 }
280
281 // Close the piece's element.
282 os << nextIndent << "</Piece>\n";
283 }
284 }
285 else
286 {
287 // Write just the requested piece.
288 // Open the piece's element.
289 os << nextIndent << "<Piece";
290 this->WriteAppendedPieceAttributes(this->WritePiece);
291 if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
292 {
293 this->DeletePositionArrays();
294 return 0;
295 }
296 os << ">\n";
297

Callers 1

ProcessRequestMethod · 0.95

Calls 11

DeletePositionArraysMethod · 0.95
WriteAppendedPieceMethod · 0.95
GetDataSetNameMethod · 0.95
GetNextIndentMethod · 0.80
WritePrimaryElementMethod · 0.80
StartAppendedDataMethod · 0.80
vtkIndentClass · 0.50
WriteFieldDataMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected