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

Method WriteArrayAppended

IO/XML/vtkXMLWriter.cxx:1986–2025  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1984
1985//------------------------------------------------------------------------------
1986void vtkXMLWriter::WriteArrayAppended(vtkAbstractArray* a, vtkIndent indent, OffsetsManager& offs,
1987 const char* alternateName, int writeNumTuples, int timestep)
1988{
1989 ostream& os = *(this->Stream);
1990 // Write the header <DataArray or <Array:
1991 this->WriteArrayHeader(a, indent, alternateName, writeNumTuples, timestep);
1992 int shortFormatTag = 1; // close with: />
1993 //
1994 if (vtkArrayDownCast<vtkDataArray>(a))
1995 {
1996 // write the scalar range of this data array, we reserver space because we
1997 // don't actually have the data at this point
1998 offs.GetRangeMinPosition(timestep) = this->ReserveAttributeSpace("RangeMin");
1999 offs.GetRangeMaxPosition(timestep) = this->ReserveAttributeSpace("RangeMax");
2000 }
2001 else
2002 {
2003 // ranges are not written for non-data arrays.
2004 offs.GetRangeMinPosition(timestep) = -1;
2005 offs.GetRangeMaxPosition(timestep) = -1;
2006 }
2007
2008 //
2009 offs.GetPosition(timestep) = this->ReserveAttributeSpace("offset");
2010
2011 // Write information in the recognized keys associated with this array.
2012 vtkInformation* info = a->GetInformation();
2013 bool hasInfo = info && info->GetNumberOfKeys() > 0;
2014 if (hasInfo)
2015 {
2016 // close header with </DataArray> or </Array> before writing information:
2017 os << ">" << endl;
2018 shortFormatTag = 0; // Tells WriteArrayFooter that the header is closed.
2019
2020 this->WriteInformation(info, indent);
2021 }
2022
2023 // Close tag.
2024 this->WriteArrayFooter(os, indent, a, shortFormatTag);
2025}
2026
2027//------------------------------------------------------------------------------
2028void vtkXMLWriter::WriteArrayAppendedData(

Callers 11

WriteCellDataAppendedMethod · 0.95
WritePointsAppendedMethod · 0.95
WriteRowDataAppendedMethod · 0.80
WriteGridMethod · 0.80
WriteTrees_0Method · 0.80
WriteTrees_1Method · 0.80
WriteTrees_2Method · 0.80

Calls 7

WriteArrayHeaderMethod · 0.95
ReserveAttributeSpaceMethod · 0.95
WriteInformationMethod · 0.95
WriteArrayFooterMethod · 0.95
GetNumberOfKeysMethod · 0.80
GetPositionMethod · 0.45
GetInformationMethod · 0.45

Tested by

no test coverage detected