VTK  9.4.20241221
vtkFieldDataSerializer.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
19#ifndef vtkFieldDataSerializer_h
20#define vtkFieldDataSerializer_h
21
22#include "vtkObject.h"
23#include "vtkParallelCoreModule.h" // For export macro
24
25// Forward declarations
26VTK_ABI_NAMESPACE_BEGIN
27class vtkIdList;
28class vtkFieldData;
29class vtkDataArray;
30class vtkStringArray;
31class vtkIntArray;
33
34class VTKPARALLELCORE_EXPORT vtkFieldDataSerializer : public vtkObject
35{
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
45 static void SerializeMetaData(vtkFieldData* fieldData, vtkMultiProcessStream& bytestream);
46
60 vtkIntArray* datatypes, vtkIntArray* dimensions);
61
65 static void Serialize(vtkFieldData* fieldData, vtkMultiProcessStream& bytestream);
66
70 static void SerializeTuples(
71 vtkIdList* tupleIds, vtkFieldData* fieldData, vtkMultiProcessStream& bytestream);
72
79 static void SerializeSubExtent(
80 int subext[6], int gridExtent[6], vtkFieldData* fieldData, vtkMultiProcessStream& bytestream);
81
88 int subext[6], int gridExtent[6], vtkFieldData* fieldData, vtkMultiProcessStream& bytestream);
89
93 static void Deserialize(vtkMultiProcessStream& bytestream, vtkFieldData* fieldData);
94
95protected:
98
103 static vtkDataArray* ExtractSelectedTuples(vtkIdList* tupleIds, vtkDataArray* inputDataArray);
104
110 int subext[6], int gridExtent[6], vtkDataArray* inputDataArray);
111
115 static void SerializeDataArray(vtkDataArray* dataArray, vtkMultiProcessStream& bytestream);
116
120 static void DeserializeDataArray(vtkMultiProcessStream& bytestream, vtkDataArray*& dataArray);
121
122private:
124 void operator=(const vtkFieldDataSerializer&) = delete;
125};
126
127VTK_ABI_NAMESPACE_END
128#endif /* vtkFieldDataSerializer_h */
abstract superclass for arrays of numeric data
A concrete instance of vtkObject which provides functionality for serializing and de-serializing fiel...
static void SerializeDataArray(vtkDataArray *dataArray, vtkMultiProcessStream &bytestream)
Serializes the data array into a bytestream.
static void DeSerializeToSubExtent(int subext[6], int gridExtent[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Deserializes the field data from a bytestream to a the given sub-extent.
static void SerializeMetaData(vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Serializes the metadata of the given field data instance, i.e., the number of arrays,...
~vtkFieldDataSerializer() override
static void DeserializeMetaData(vtkMultiProcessStream &bytestream, vtkStringArray *names, vtkIntArray *datatypes, vtkIntArray *dimensions)
Given the serialized field metadata in a bytestream, this method extracts the name,...
static void SerializeSubExtent(int subext[6], int gridExtent[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Serializes the given sub-extent of field data of a structured grid in a byte-stream.
static void Deserialize(vtkMultiProcessStream &bytestream, vtkFieldData *fieldData)
Deserializes the field data from a bytestream.
static vtkFieldDataSerializer * New()
static vtkDataArray * ExtractSelectedTuples(vtkIdList *tupleIds, vtkDataArray *inputDataArray)
Given an input data array and list of tuples, it extracts the selected tuples in to a new array and r...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static void Serialize(vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Serializes the given field data (all the field data) into a bytestream.
static vtkDataArray * ExtractSubExtentData(int subext[6], int gridExtent[6], vtkDataArray *inputDataArray)
Given an input data array corresponding to a field on a structured grid, extract the data within the ...
static void DeserializeDataArray(vtkMultiProcessStream &bytestream, vtkDataArray *&dataArray)
Deserializes the data array from a bytestream.
static void SerializeTuples(vtkIdList *tupleIds, vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Serializes the selected tuples from the field data in a byte-stream.
represent and manipulate fields of data
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
dynamic, self-adjusting array of int
stream used to pass data across processes using vtkMultiProcessController.
abstract base class for most VTK objects
Definition vtkObject.h:162
a vtkAbstractArray subclass for strings