------------------------------------------------------------------------------
| 305 | |
| 306 | //------------------------------------------------------------------------------ |
| 307 | int vtkXMLHyperTreeGridWriter::WriteGrid(vtkIndent indent) |
| 308 | { |
| 309 | vtkHyperTreeGrid* input = this->GetInput(); |
| 310 | ostream& os = *(this->Stream); |
| 311 | os << indent << "<Grid>\n"; |
| 312 | |
| 313 | if (this->DataMode == Appended) |
| 314 | { |
| 315 | // Coordinates of the grid |
| 316 | this->CoordsOMG->Allocate(3, this->NumberOfTimeSteps); |
| 317 | this->WriteArrayAppended(input->GetXCoordinates(), indent.GetNextIndent(), |
| 318 | this->CoordsOMG->GetElement(0), "XCoordinates", |
| 319 | input->GetXCoordinates()->GetNumberOfTuples()); |
| 320 | this->WriteArrayAppended(input->GetYCoordinates(), indent.GetNextIndent(), |
| 321 | this->CoordsOMG->GetElement(1), "YCoordinates", |
| 322 | input->GetYCoordinates()->GetNumberOfTuples()); |
| 323 | this->WriteArrayAppended(input->GetZCoordinates(), indent.GetNextIndent(), |
| 324 | this->CoordsOMG->GetElement(2), "ZCoordinates", |
| 325 | input->GetZCoordinates()->GetNumberOfTuples()); |
| 326 | } |
| 327 | else |
| 328 | { |
| 329 | // Coordinates of the grid |
| 330 | this->WriteArrayInline(input->GetXCoordinates(), indent.GetNextIndent(), "XCoordinates", |
| 331 | input->GetXCoordinates()->GetNumberOfValues()); |
| 332 | this->WriteArrayInline(input->GetYCoordinates(), indent.GetNextIndent(), "YCoordinates", |
| 333 | input->GetYCoordinates()->GetNumberOfValues()); |
| 334 | this->WriteArrayInline(input->GetZCoordinates(), indent.GetNextIndent(), "ZCoordinates", |
| 335 | input->GetZCoordinates()->GetNumberOfValues()); |
| 336 | } |
| 337 | |
| 338 | os << indent << "</Grid>\n"; |
| 339 | os.flush(); |
| 340 | if (os.fail()) |
| 341 | { |
| 342 | this->SetErrorCode(vtkErrorCode::OutOfDiskSpaceError); |
| 343 | return 0; |
| 344 | } |
| 345 | return 1; |
| 346 | } |
| 347 | |
| 348 | //------------------------------------------------------------------------------ |
| 349 | vtkXMLHyperTreeGridWriter::vtkXMLHyperTreeGridWriter() |
no test coverage detected