Commit 02f949cb authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Handle mismatch is chosen and available arrays.

vtkXMLDataReader had asserts that checked for extact match between
arrays enabled using the array selection API and then the arrays
actually read (present) in the file. This caused issues when reading
composite datasets with partial arrays following the change in
56f1f110 (see paraview/paraview#18189).

Updating the code in vtkXMLDataReader so that it can handle a mismatch
in fields. The limitation was unreasonable anyways.
parent 1fffa689
This diff is collapsed.
......@@ -30,6 +30,8 @@
#include "vtkIOXMLModule.h" // For export macro
#include "vtkXMLReader.h"
#include <memory> // for std::unique_ptr
class VTKIOXML_EXPORT vtkXMLDataReader : public vtkXMLReader
......@@ -108,25 +110,27 @@ protected:
// The observer to report progress from reading data from XMLParser.
vtkCallbackCommand* DataProgressObserver;
class MapStringToInt;
class MapStringToInt64;
// Specify the last time step read, useful to know if we need to rearead data
// //PointData
int *PointDataTimeStep;
vtkTypeInt64 *PointDataOffset;
std::unique_ptr<MapStringToInt> PointDataTimeStep;
std::unique_ptr<MapStringToInt64> PointDataOffset;
int PointDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
int *CellDataTimeStep;
vtkTypeInt64 *CellDataOffset;
std::unique_ptr<MapStringToInt> CellDataTimeStep;
std::unique_ptr<MapStringToInt64> CellDataOffset;
int CellDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
vtkXMLDataReader(const vtkXMLDataReader&) = delete;
void operator=(const vtkXMLDataReader&) = delete;
void ConvertGhostLevelsToGhostType(
FieldType type, vtkAbstractArray* data, vtkIdType startIndex,
vtkIdType numValues) override;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment