------------------------------------------------------------------------------
| 219 | |
| 220 | //------------------------------------------------------------------------------ |
| 221 | int 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 | //------------------------------------------------------------------------------ |
| 273 | void vtkXMLPDataObjectWriter::WritePPieceAttributes(int index) |
nothing calls this directly
no test coverage detected