VAPoR  0.1
Metadata.h
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 
5 
6 #ifndef _Metadata_h_
7 #define _Metadata_h_
8 
9 #include <vector>
10 #include "vapor/common.h"
11 
12 #ifdef WIN32
13 #pragma warning(disable : 4251)
14 #endif
15 
16 namespace VAPoR {
17 
18 //
35 public:
36 
43  enum VarType_T {
44  VARUNKNOWN = -1,
45  VAR3D, VAR2D_XY, VAR2D_XZ, VAR2D_YZ
46  };
47 
48  Metadata() {_deprecated_get_dim = false;}
49  virtual ~Metadata() {};
50 
60  //
61  virtual void GetGridDim(size_t dim[3]) const = 0;
62 
77  //
78  virtual void GetBlockSize(size_t bs[3], int reflevel) const = 0;
79 
80 
89  //
90  virtual int GetNumTransforms() const {return(0); };
91 
102  //
103  virtual std::vector <size_t> GetCRatios() const {
104  std::vector <size_t> cr; cr.push_back(1); return(cr);
105  }
106 
110  //
111  virtual std::string GetCoordSystemType() const { return("cartesian"); };
112 
118  //
119  virtual std::string GetGridType() const { return("regular"); };
120 
129  //
130  virtual std::vector<double> GetTSXCoords(size_t ts) const {
131  std::vector <double> empty; return(empty);
132  };
133  virtual std::vector<double> GetTSYCoords(size_t ts) const {
134  std::vector <double> empty; return(empty);
135  };
136  virtual std::vector<double> GetTSZCoords(size_t ts) const {
137  std::vector <double> empty; return(empty);
138  };
139 
140 
141 
160  //
161  virtual std::vector<double> GetExtents(size_t ts = 0) const = 0;
162 
163 
168  //
169  virtual long GetNumTimeSteps() const = 0;
170 
171 
179  //
180  virtual std::vector <std::string> GetVariableNames() const;
181 
188  //
189  virtual std::string GetMapProjection() const {std::string empty; return (empty); };
190 
196  //
197  virtual std::vector <std::string> GetVariables3D() const = 0;
198 
204  //
205  virtual std::vector <std::string> GetVariables2DXY() const = 0;
206 
212  //
213  virtual std::vector <std::string> GetVariables2DXZ() const = 0;
214 
220  //
221  virtual std::vector <std::string> GetVariables2DYZ() const = 0;
222 
235  //
236  virtual std::vector <std::string> GetCoordinateVariables() const {;
237  std::vector <std::string> v;
238  v.push_back("NONE"); v.push_back("NONE"); v.push_back("ELEVATION");
239  return(v);
240  }
241 
242 
248  //
249  virtual std::vector<long> GetPeriodicBoundary() const = 0;
250 
256  virtual std::vector<long> GetGridPermutation() const = 0;
257 
272  //
273  virtual double GetTSUserTime(size_t ts) const = 0;
274 
275 
288  //
289  virtual void GetTSUserTimeStamp(size_t ts, std::string &s) const = 0;
290 
291 
308  //
309  virtual void GetDim(size_t dim[3], int reflevel = 0) const;
310 
321  //
322  virtual void GetDimBlk(size_t bdim[3], int reflevel = 0) const;
323 
335  //
336  virtual bool GetMissingValue(std::string varname, float &value) const {
337  return(false);
338  };
339 
340 
341 
353  virtual void MapVoxToBlk(const size_t vcoord[3], size_t bcoord[3], int reflevel = -1) const;
354 
355  virtual void MapVoxToUser(
356  size_t timestep,
357  const size_t vcoord0[3], double vcoord1[3], int ref_level = 0
358  ) const;
359 
360  void MapUserToVox(
361  size_t timestep, const double vcoord0[3], size_t vcoord1[3],
362  int reflevel
363  ) const;
364 
365 
373  //
374  virtual VarType_T GetVarType(const std::string &varname) const;
375 
389  //
390  virtual int IsValidRegion(
391  const size_t min[3], const size_t max[3], int reflevel = 0
392  ) const;
393 
409  //
410  virtual int IsValidRegionBlk(
411  const size_t min[3], const size_t max[3], int reflevel = 0
412  ) const;
413 
423  //
424  virtual bool IsCoordinateVariable(std::string varname) const;
425 
426 
427 protected:
429 };
430 };
431 
432 #endif // _Metadata_h_
An abstract class for managing metadata for a collection of gridded data. The data collection may sup...
Definition: Metadata.h:34
virtual std::vector< std::string > GetCoordinateVariables() const
Definition: Metadata.h:236
virtual std::vector< double > GetTSYCoords(size_t ts) const
Definition: Metadata.h:133
bool _deprecated_get_dim
Definition: Metadata.h:428
#define VDF_API
Definition: common.h:61
virtual bool GetMissingValue(std::string varname, float &value) const
Definition: Metadata.h:336
virtual std::string GetMapProjection() const
Definition: Metadata.h:189
virtual std::string GetGridType() const
Definition: Metadata.h:119
virtual std::vector< double > GetTSZCoords(size_t ts) const
Definition: Metadata.h:136
virtual std::vector< size_t > GetCRatios() const
Definition: Metadata.h:103
virtual int GetNumTransforms() const
Definition: Metadata.h:90
virtual ~Metadata()
Definition: Metadata.h:49
virtual std::vector< double > GetTSXCoords(size_t ts) const
Definition: Metadata.h:130
virtual std::string GetCoordSystemType() const
Definition: Metadata.h:111