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

Method WriteGrid

IO/XML/vtkXMLHyperTreeGridWriter.cxx:307–346  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

305
306//------------------------------------------------------------------------------
307int 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//------------------------------------------------------------------------------
349vtkXMLHyperTreeGridWriter::vtkXMLHyperTreeGridWriter()

Callers 1

WriteDataMethod · 0.95

Calls 11

GetInputMethod · 0.95
WriteArrayAppendedMethod · 0.80
GetNextIndentMethod · 0.80
WriteArrayInlineMethod · 0.80
AllocateMethod · 0.45
GetXCoordinatesMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetYCoordinatesMethod · 0.45
GetZCoordinatesMethod · 0.45
GetNumberOfValuesMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected