4#ifndef vtkXArrayAccessor_h
5#define vtkXArrayAccessor_h
10#include "vtkIONetCDFModule.h"
13VTK_ABI_NAMESPACE_BEGIN
25 int open(
const char* path,
int omode,
int* ncidp)
override;
28 int inq_attlen(
int ncid,
int varid,
const char* name,
size_t* lenp)
override;
30 int inq_dimlen(
int ncid,
int dimid,
size_t* lenp)
override;
37 int inq_varid(
int ncid,
const char* name,
int* varidp)
override;
42 int get_att_text(
int ncid,
int varid,
const char* name,
char* value)
override;
43 int get_att_double(
int ncid,
int varid,
const char* name,
double* value)
override;
44 int get_att_float(
int ncid,
int varid,
const char* name,
float* value)
override;
46 bool GetCoordinates(
int ncFD,
int varId, std::vector<std::string>& coordName)
override;
50 int get_vars(
int ncid,
int varid,
const size_t* startp,
const size_t* countp,
51 const ptrdiff_t* stridep,
int vtkType,
vtkIdType numberOfComponents,
vtkIdType numberOfTuples,
54 int get_vars(
int ncid,
int varid,
const size_t* startp,
const size_t* countp,
55 const ptrdiff_t* stridep,
void* ip)
override;
57 int get_vars_double(
int ncid,
int varid,
const size_t* startp,
const size_t* countp,
58 const ptrdiff_t* stridep,
double* ip)
override;
65 void SetDim(
const std::vector<std::string>& v);
73 void SetVar(
const std::vector<std::string>& v,
const std::vector<int>& is_coord);
87 void SetVarDims(
size_t varIndex,
const std::vector<size_t>& dims);
88 void SetVarCoords(
size_t varIndex,
const std::vector<size_t>& coords);
94 void PrintVarValue(
const char* name,
int varid,
const size_t* startp,
const size_t* countp);
95 bool IsContiguous(
int varid,
const size_t* startp,
const size_t* countp);
97 int varid,
const size_t* startp,
const size_t* countp,
char*& arrayStart,
vtkIdType& arraySize);
98 void Copy(
int varid,
const size_t* startp,
const size_t* countp,
char* dst);
101 const size_t* count_p,
const std::vector<size_t>& dimIncrement,
char*& src);
113 std::vector<std::string> Var;
114 std::vector<int> IsCoord;
115 std::vector<char*> VarValue;
116 std::map<std::string, size_t> VarIndex;
117 std::vector<std::map<std::string, vtkVariant>> Att;
118 std::vector<int> VarType;
126 std::vector<std::string> Dim;
127 std::map<std::string, size_t> DimIndex;
128 std::vector<size_t> DimLen;
133 std::vector<std::vector<size_t>> VarDims;
134 std::vector<std::vector<size_t>> VarCoords;
abstract superclass for arrays of numeric data
topologically and geometrically regular array of data
a simple class to control print indentation
handles properties associated with a texture map
A type representing the union of many types.
void Copy(int varid, const size_t *startp, const size_t *countp, char *dst)
int inq_ndims(int ncid, int *ndimsp) override
int inq_varname(int ncid, int varid, char *name) override
bool NeedsFileName() override
int inq_attlen(int ncid, int varid, const char *name, size_t *lenp) override
void PrintVarValue(const char *name, int varid)
void SetVarDims(size_t varIndex, const std::vector< size_t > &dims)
Set dimensions for a variable.
int get_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, void *ip) override
const char * strerror(int ncerr1) override
void SetVarValue(size_t varIndex, void *value)
Set variables, variable attributes and types for the variable arrays.
void SetDim(const std::vector< std::string > &v)
Set dimensions and their length.
bool DecrementAndUpdate(size_t varid, std::vector< size_t > &count, const size_t *startp, const size_t *count_p, const std::vector< size_t > &dimIncrement, char *&src)
int inq_dimlen(int ncid, int dimid, size_t *lenp) override
void SetVarCoords(size_t varIndex, const std::vector< size_t > &coords)
int inq_dimname(int ncid, int dimid, char *name) override
~vtkXArrayAccessor() override=default
void GetContiguousStartSize(int varid, const size_t *startp, const size_t *countp, char *&arrayStart, vtkIdType &arraySize)
bool IsContiguous(int varid, const size_t *startp, const size_t *countp)
void SetVar(const std::vector< std::string > &v, const std::vector< int > &is_coord)
Set variables, variable attributes and types for the variable arrays.
int close(int ncid) override
int get_att_text(int ncid, int varid, const char *name, char *value) override
int inq_vardimid(int ncid, int varid, int *dimidsp) override
int get_att_double(int ncid, int varid, const char *name, double *value) override
void SetVarType(size_t varIndex, int nctype)
Set variables, variable attributes and types for the variable arrays.
static vtkXArrayAccessor * New()
int get_att_float(int ncid, int varid, const char *name, float *value) override
int get_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, int vtkType, vtkIdType numberOfComponents, vtkIdType numberOfTuples, vtkDataArray *dataArray) override
int get_var_double(int ncid, int varid, double *ip) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int get_vars_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, double *ip) override
void SetAtt(size_t varIndex, std::string attributeName, const vtkVariant &var)
Set variables, variable attributes and types for the variable arrays.
vtkXArrayAccessor()=default
bool GetCoordinates(int ncFD, int varId, std::vector< std::string > &coordName) override
bool IsCOARDSCoordinate(std::string)
Check if this coordinate has one dim with the same name as the coordinate.
int inq_varndims(int ncid, int varid, int *ndimsp) override
int inq_nvars(int ncid, int *nvarsp) override
void SetDimLen(const std::vector< size_t > &v)
Set dimensions and their length.
std::vector< size_t > GetDimIncrement(int varid)
int inq_varid(int ncid, const char *name, int *varidp) override
int open(const char *path, int omode, int *ncidp) override
int inq_vartype(int ncid, int varid, int *typep) override
void PrintVarValue(const char *name, int varid, const size_t *startp, const size_t *countp)