------------------------------------------------------------------------------
| 1984 | |
| 1985 | //------------------------------------------------------------------------------ |
| 1986 | void 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 | //------------------------------------------------------------------------------ |
| 2028 | void vtkXMLWriter::WriteArrayAppendedData( |
no test coverage detected