VAPoR  0.1
WaveletBlock3DRegionReader.h
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 
5 
6 #ifndef _WavletBlock3DRegionReader_h_
7 #define _WavletBlock3DRegionReader_h_
8 
9 #include <vapor/MyBase.h>
10 #include "WaveletBlockIOBase.h"
11 
12 namespace VAPoR {
13 
14 //
23 //
25 
26 public:
27 
35  //
37  const MetadataVDC &metadata
38  );
39 
47  //
49  const string &metafile
50  );
51 
52  virtual ~WaveletBlock3DRegionReader();
53 
54 
79  virtual int OpenVariableRead(
80  size_t timestep,
81  const char *varname,
82  int reflevel = 0,
83  int lod = 0
84  );
85 
86  virtual int OpenVariableWrite(
87  size_t /*timestep*/,
88  const char * /*varname*/,
89  int /* reflevel */ = 0,
90  int = 0
91  ) {SetErrMsg("Operation not supported"); return(-1);};
92 
93 
99  virtual int CloseVariable();
100 
122  //
123  virtual int ReadRegion(
124  const size_t min[3], const size_t max[3],
125  float *region
126  );
127 
128  virtual int ReadRegion(
129  float *region
130  );
131 
132 
151  //
152  virtual int BlockReadRegion(
153  const size_t bmin[3], const size_t bmax[3],
154  float *region, bool unblock = true
155  );
156 
157 #ifdef DEAD
158 
159  // Read a subregion of gamma (detail) coefficients from disk. The
160  // spatial coordinates of the region (min, max) are given
161  // in **block** units, where 'min' specifies the minimum bounds
162  // and 'max' specifies the maximum bound. The coefficients are stored
163  // in the three arrays pointed to by xregion, yregion, and zregion. Each
164  // much have enough space to accomodate the X, Y, and Z gamma coefficients
165  // respectively. The dimenions of the zregion in block units are nbx*nby*nbz,
166  // where nbx == max[0]-min[0]+1, and so on. The dimensions of the
167  // yregion and xregion
168  // are nbx*nby*(nbz*2), and nbx*(nby*2)*(nbz*2), respectively (there are
169  // twice as many Y coefficients as Z, and four times as many X coefficients).
170  //
171  // The coefficients returned are those needed to forward transform
172  // a volume from level 'level-1', to 'level'. Thus, 'level' must be at least
173  // one.
174  //
175  // The coefficients will be unblocked if the 'unblock' flag is set. Otherwise,
176  // they are left in their native blocked-storage order
177  //
178  int ReadRegionGamma(
179  size_t min[3], size_t max[3], float *xregion,
180  float *yregion, float *zregion, int unblock = 1
181  );
182 
183 #endif
184 
185 protected:
186  void _GetDataRange(float /*range*/[2]) const {};
187 
188 
189 private:
190  float *lambda_blks_c[MAX_LEVELS];
191  float *gamma_blks_c[MAX_LEVELS];
192  float *_lambda_tiles[MAX_LEVELS];
193  float *_gamma_tiles[MAX_LEVELS];
194 
195  size_t _block_size;
196 
197  int row_inv_xform3d(
198  const float *lambda_row,
199  unsigned int ljx0, unsigned int ljy0, unsigned int ljz0,
200  unsigned int ljnx, unsigned int j, float *region,
201  const size_t min[3], const size_t max[3], unsigned int level, int unblock
202  );
203  int row_inv_xform2d(
204  const float *lambda_row,
205  unsigned int ljx0, unsigned int ljy0,
206  unsigned int ljnx, unsigned int j, float *region,
207  const size_t min[2], const size_t max[2], unsigned int level, int untile
208  );
209 
210  int my_realloc3d();
211  int my_realloc2d();
212  void my_free();
213 
214  int _ReadRegion3D(
215  const size_t min[3], const size_t max[3],
216  float *region, int unblock = 1
217  );
218  int _ReadRegion2D(
219  const size_t min[2], const size_t max[2],
220  float *region, int unblock = 1
221  );
222 
223  void _WaveletBlock3DRegionReader();
224 
225 };
226 
227 };
228 
229 #endif // _WavletBlock3DRegionReader_h_
A sub-region reader for VDF files.
#define VDF_API
Definition: common.h:61
virtual int OpenVariableWrite(size_t, const char *, int=0, int=0)
A class for managing data set metadata.
Definition: MetadataVDC.h:92
Performs data IO to VDF files.