6 #ifndef _WavletBlockIOBase_h_
7 #define _WavletBlockIOBase_h_
10 #include <vapor/MyBase.h>
11 #include <vapor/WaveletBlock3D.h>
12 #include <vapor/WaveletBlock2D.h>
13 #include <vapor/VDFIOBase.h>
57 const string &metafile
74 virtual int VariableExists(
104 virtual int OpenVariableWrite(
112 const float *region,
const size_t bmin[3],
const size_t bmax[3],
114 ) { SetErrMsg(
"Not implemented");
return(-1); }
117 const float *region,
const size_t min[3],
const size_t max[3]
118 ) { SetErrMsg(
"Not implemented");
return(-1); }
122 ) { SetErrMsg(
"Not implemented");
return(-1); }
125 { SetErrMsg(
"Not implemented");
return(-1); }
153 virtual int OpenVariableRead(
161 const size_t bmin[3],
const size_t bmax[3],
float *region,
bool unblock=
true
162 ) { SetErrMsg(
"Not implemented");
return(-1); }
165 const size_t min[3],
const size_t max[3],
float *region
166 ) { SetErrMsg(
"Not implemented");
return(-1); }
170 ) { SetErrMsg(
"Not implemented");
return(-1); }
173 SetErrMsg(
"Not implemented");
return(-1);
180 virtual int CloseVariable();
198 int GetBlockMins(
const float **mins,
int reflevel);
202 int GetBlockMaxs(
const float **maxs,
int reflevel);
218 const size_t bcoord[2],
239 const size_t bcoord[3],
248 size_t min[3],
size_t max[3],
int reflevel
251 virtual void GetDim(
size_t dim[3],
int reflevel = 0)
const;
253 virtual void GetDimBlk(
size_t bdim[3],
int reflevel = 0)
const;
256 static const int MAX_LEVELS = 16;
272 float *_mins3d[MAX_LEVELS];
273 float *_maxs3d[MAX_LEVELS];
275 float *_mins2d[MAX_LEVELS];
276 float *_maxs2d[MAX_LEVELS];
287 int seekBlocks(
unsigned int offset,
int reflevel = 0);
295 int seekLambdaBlocks(
const size_t bcoord[3]);
306 int seekGammaBlocks(
const size_t bcoord[3],
int reflevel);
315 int readBlocks(
size_t n,
float *blks,
int reflevel);
323 int readLambdaBlocks(
size_t n,
float *blks);
334 int readGammaBlocks(
size_t n,
float *blks,
int reflevel);
343 int writeBlocks(
const float *blks,
size_t n,
int reflevel);
350 int writeLambdaBlocks(
const float *blks,
size_t n);
359 int writeGammaBlocks(
const float *blks,
size_t n,
int reflevel);
364 virtual void _GetDataRange(
float range[2])
const = 0;
365 virtual void _GetValidRegion(
size_t minreg[3],
size_t maxreg[3])
const;
369 string _ncpaths[MAX_LEVELS];
370 int _ncids[MAX_LEVELS];
371 int _ncvars[MAX_LEVELS];
372 int _ncminvars[MAX_LEVELS];
373 int _ncmaxvars[MAX_LEVELS];
374 int _ncoffsets[MAX_LEVELS];
376 size_t _validRegMin[3];
377 size_t _validRegMax[3];
390 static const string _blockSizeXName;
391 static const string _blockSizeYName;
392 static const string _blockSizeZName;
393 static const string _nBlocksDimName;
394 static const string _blockDimXName;
395 static const string _blockDimYName;
396 static const string _blockDimZName;
397 static const string _fileVersionName;
398 static const string _refLevelName;
399 static const string _nativeMinValidRegionName;
400 static const string _nativeMaxValidRegionName;
401 static const string _refLevMinValidRegionName;
402 static const string _refLevMaxValidRegionName;
403 static const string _nativeResName;
404 static const string _refLevelResName;
405 static const string _filterCoeffName;
406 static const string _liftingCoeffName;
407 static const string _scalarRangeName;
408 static const string _minsName;
409 static const string _maxsName;
410 static const string _lambdaName;
411 static const string _gammaName;
413 int _WaveletBlockIOBase();
415 int open_var_write(
const string &basename);
416 int open_var_read(
size_t ts,
const char *varname,
const string &basename);
422 virtual int ncDefineDimsVars2D(
425 const int bs_dim_ids[3],
430 virtual int ncVerifyDimsVars2D(
435 virtual int ncDefineDimsVars3D(
438 const int bs_dim_ids[3],
443 virtual int ncVerifyDimsVars3D(
452 #endif // _WavletBlock3d_h_
virtual int ReadRegion(float *region)
A block-based, 3D wavelet transformer.
virtual int WriteRegion(const float *region, const size_t min[3], const size_t max[3])
virtual int ReadRegion(const size_t min[3], const size_t max[3], float *region)
virtual int WriteSlice(const float *slice)
virtual int ReadSlice(float *slice)
virtual const float * GetDataRange() const
virtual int BlockWriteRegion(const float *region, const size_t bmin[3], const size_t bmax[3], bool block=true)
A tile-based, 2D wavelet transformer.
Performs data IO to VDF files.
virtual int WriteRegion(const float *region)
Abstract base class for performing data IO to a VDC.
virtual int BlockReadRegion(const size_t bmin[3], const size_t bmax[3], float *region, bool unblock=true)