15#ifndef vtkCellGridIOQuery_h
16#define vtkCellGridIOQuery_h
20#include "vtkIOCellGridModule.h"
22#include <vtk_nlohmannjson.h>
23#include VTK_NLOHMANN_JSON(json.hpp)
25VTK_ABI_NAMESPACE_BEGIN
48 std::vector<vtkCellAttribute*>& attributeList);
57 const std::unordered_map<vtkAbstractArray*, vtkStringToken>& arrayLocations);
63 nlohmann::json*
GetData() {
return this->Data; }
71 return this->ArrayLocations;
75 return this->ArrayLocations;
79 const std::vector<vtkCellAttribute*>&
GetAttributeList()
const {
return *this->AttributeList; }
114 nlohmann::json* Data{
nullptr };
115 nlohmann::json* AttributeData{
nullptr };
118 bool Serializing{
true };
Serialize/deserialize vtkCellMetadata records.
nlohmann::json * GetData()
Return the JSON object that holds attribute data.
static vtkCellGridIOQuery * New()
bool InsertCellTypeAttributeInfo(vtkCellGrid *grid, const vtkCellAttribute::CellTypeInfo &cellTypeInfo, nlohmann::json &jsonInfo, vtkStringToken cellTypeName)
Insert vtkCellAttribute::CellTypeInfo into the given jsonInfo object for the given cellTypeName.
std::unordered_map< vtkAbstractArray *, vtkStringToken > ArrayLocations
const std::vector< vtkCellAttribute * > & GetAttributeList() const
Return a vector of cell-attributes that matches AttributeData.
nlohmann::json * GetAttributeData()
Return the JSON object that holds attribute data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void PrepareToDeserialize(const nlohmann::json &sourceData, const nlohmann::json &attributeData, std::vector< vtkCellAttribute * > &attributeList)
Prepare to deserialize cell metadata from the given sourceData JSON object.
nlohmann::json & AddMetadataEntry(vtkStringToken cellTypeName)
Add a metadata entry for cellTypeName to the output.
void PrepareToSerialize(nlohmann::json &destination, nlohmann::json &attributeData, const std::unordered_map< vtkAbstractArray *, vtkStringToken > &arrayLocations)
Prepare to serialize cell metadata to the given parent JSON object.
const std::unordered_map< vtkAbstractArray *, vtkStringToken > & GetArrayLocations() const
Return the map of array pointers to the names of groups which contain them.
std::unordered_map< vtkAbstractArray *, vtkStringToken > & GetArrayLocations()
Return the JSON object that holds attribute data.
~vtkCellGridIOQuery() override=default
std::vector< vtkCellAttribute * > * AttributeList
bool ExtractCellTypeAttributeInfo(vtkCellGrid *grid, vtkCellAttribute::CellTypeInfo &cellTypeInfo, const nlohmann::json &jsonInfo, vtkStringToken cellTypeName)
Extract JSON array information into vtkCellAttribute::CellTypeInfo.
bool IsSerializing() const
Return true if the query is serializing cells (as opposed to deserializing).
vtkCellGridIOQuery()=default
Perform an operation on cells in a vtkCellMetadata instance.
Visualization data composed of cells of arbitrary type.
Store on/off settings for data arrays, etc.
represent and manipulate fields of data
topologically and geometrically regular array of data
a simple class to control print indentation
a vtkAbstractArray subclass for strings
Represent a string by its integer hash.