VAPoR  0.1
StretchedGrid.h
Go to the documentation of this file.
1 #ifndef _StretchedGrid_
2 #define _StretchedGrid_
3 
4 #include <vector>
5 #include <vapor/common.h>
6 #include "RegularGrid.h"
7 #ifdef _WINDOWS
8 #pragma warning(disable : 4251 4100)
9 #endif
10 //
19 //
20 
21 namespace VAPoR {
23 public:
24 
67  const size_t bs[3],
68  const size_t min[3],
69  const size_t max[3],
70  const double extents[6],
71  const bool periodic[3],
72  float ** blks,
73  const std::vector <double> &xcoords,
74  const std::vector <double> &ycoords,
75  const std::vector <double> &zcoords
76 );
77 
91  const size_t bs[3],
92  const size_t min[3],
93  const size_t max[3],
94  const double extents[6],
95  const bool periodic[3],
96  float ** blks,
97  const std::vector <double> &xcoords,
98  const std::vector <double> &ycoords,
99  const std::vector <double> &zcoords,
100  float missing_value
101  );
102 
103 
106  float GetValue(double x, double y, double z) const;
107 
110  virtual void GetUserExtents(double extents[6]) const {
111  for (int i=0; i<6; i++) extents[i] = _extents[i];
112  }
113 
114 
117  virtual void GetBoundingBox(
118  const size_t min[3],
119  const size_t max[3],
120  double extents[6]
121  ) const;
122 
125  virtual void GetEnclosingRegion(
126  const double minu[3], const double maxu[3], size_t min[3], size_t max[3]
127  ) const;
128 
129 
132  int GetUserCoordinates(
133  size_t i, size_t j, size_t k,
134  double *x, double *y, double *z
135  ) const;
136 
139  void GetIJKIndex(
140  double x, double y, double z,
141  size_t *i, size_t *j, size_t *k
142  ) const;
143 
146  void GetIJKIndexFloor(
147  double x, double y, double z,
148  size_t *i, size_t *j, size_t *k
149  ) const;
150 
151  int Reshape(
152  const size_t min[3],
153  const size_t max[3],
154  const bool periodic[3]
155  );
156 
159  virtual void GetMinCellExtents(double *x, double *y, double *z) const;
160 
173  std::vector <double> &xcoords,
174  std::vector <double> &ycoords,
175  std::vector <double> &zcoords
176  ) const {
177  xcoords = _xcoords; ycoords = _ycoords; zcoords = _zcoords;
178  };
179 
180 
181 
182 private:
183  size_t _min[3];
184  size_t _max[3];
185  double _delta[3];
186  double _extents[6];
187  std::vector <double> _xcoords;
188  std::vector <double> _ycoords;
189  std::vector <double> _zcoords;
190 
191  float _GetValueNearestNeighbor(double x, double y, double z) const;
192  float _GetValueLinear(double x, double y, double z) const;
193  float _GetValueQuadratic(double x, double y, double z) const;
194 
195 
196 };
197 };
198 #endif
#define VDF_API
Definition: common.h:61
void GetUserCoordinateMaps(std::vector< double > &xcoords, std::vector< double > &ycoords, std::vector< double > &zcoords) const
virtual void GetUserExtents(double extents[6]) const