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 @@ ...@@ -30,6 +30,8 @@
#include "vtkIOXMLModule.h" // For export macro #include "vtkIOXMLModule.h" // For export macro
#include "vtkXMLReader.h" #include "vtkXMLReader.h"
#include <memory> // for std::unique_ptr
class VTKIOXML_EXPORT vtkXMLDataReader : public vtkXMLReader class VTKIOXML_EXPORT vtkXMLDataReader : public vtkXMLReader
{ {
public: public:
...@@ -108,25 +110,27 @@ protected: ...@@ -108,25 +110,27 @@ protected:
// The observer to report progress from reading data from XMLParser. // The observer to report progress from reading data from XMLParser.
vtkCallbackCommand* DataProgressObserver; vtkCallbackCommand* DataProgressObserver;
private:
class MapStringToInt;
class MapStringToInt64;
// Specify the last time step read, useful to know if we need to rearead data // Specify the last time step read, useful to know if we need to rearead data
// //PointData // //PointData
int *PointDataTimeStep; std::unique_ptr<MapStringToInt> PointDataTimeStep;
vtkTypeInt64 *PointDataOffset; std::unique_ptr<MapStringToInt64> PointDataOffset;
int PointDataNeedToReadTimeStep(vtkXMLDataElement *eNested); int PointDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
//CellData //CellData
int *CellDataTimeStep; std::unique_ptr<MapStringToInt> CellDataTimeStep;
vtkTypeInt64 *CellDataOffset; std::unique_ptr<MapStringToInt64> CellDataOffset;
int CellDataNeedToReadTimeStep(vtkXMLDataElement *eNested); int CellDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
private:
vtkXMLDataReader(const vtkXMLDataReader&) = delete; vtkXMLDataReader(const vtkXMLDataReader&) = delete;
void operator=(const vtkXMLDataReader&) = delete; void operator=(const vtkXMLDataReader&) = delete;
void ConvertGhostLevelsToGhostType( void ConvertGhostLevelsToGhostType(
FieldType type, vtkAbstractArray* data, vtkIdType startIndex, FieldType type, vtkAbstractArray* data, vtkIdType startIndex,
vtkIdType numValues) override; vtkIdType numValues) override;
}; };
#endif #endif
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