65 x_indices_by_lat.AddIndexIfNotFound(pt.X());
66 y_indices_by_lon.AddIndexIfNotFound(pt.Y());
67 z_indices_by_depth.AddIndexIfNotFound(pt.Z());
70 int num_x = x_indices_by_lat.GetNumUniqueIndices();
71 int num_y = y_indices_by_lon.GetNumUniqueIndices();
72 int num_z = z_indices_by_depth.GetNumUniqueIndices();
74 index_table.resize(num_z);
75 for(
int i = 0; i < num_z; ++i)
77 index_table[i].resize(num_y);
78 for(
int j = 0; j < num_y; ++j)
80 index_table[i][j].resize(num_x);
86 const auto &pt = _cloud[i];
88 x_indices_by_lat.GetIndex(pt.X()).value();
90 y_indices_by_lon.GetIndex(pt.Y()).value();
92 z_indices_by_depth.GetIndex(pt.Z()).value();
93 index_table[z_index][y_index][x_index] = i;
154 assert(_indices.
size() == _cloud.size());
160 for(
auto pt : _cloud)
162 x_indices_by_lat.AddIndexIfNotFound(pt.X());
163 y_indices_by_lon.AddIndexIfNotFound(pt.Y());
164 z_indices_by_depth.AddIndexIfNotFound(pt.Z());
167 int num_x = x_indices_by_lat.GetNumUniqueIndices();
168 int num_y = y_indices_by_lon.GetNumUniqueIndices();
169 int num_z = z_indices_by_depth.GetNumUniqueIndices();
171 index_table.resize(num_z);
172 for(
int i = 0; i < num_z; ++i)
174 index_table[i].resize(num_y);
175 for(
int j = 0; j < num_y; ++j)
177 index_table[i][j].resize(num_x);
183 const auto &pt = _cloud[i];
185 x_indices_by_lat.GetIndex(pt.X()).value();
187 y_indices_by_lon.GetIndex(pt.Y()).value();
189 z_indices_by_depth.GetIndex(pt.Z()).value();
190 index_table[z_index][y_index][x_index] = _indices[i];
228 const std::vector<InterpolationPoint3D<T>> _interpolators,
231 const V &_default = V(0))
const
233 if (_interpolators.size() == 0)
237 else if (_interpolators.size() == 1)
239 if (!_interpolators[0].index.has_value())
243 return _values[_interpolators[0].index.value()];
245 else if (_interpolators.size() == 2)
247 return LinearInterpolate(_interpolators[0], _interpolators[1],
248 _values, _pt, _default);
250 else if (_interpolators.size() == 4)
252 return BiLinearInterpolate(
253 _interpolators, 0, _values, _pt, _default);
255 else if (_interpolators.size() == 8)
257 return TrilinearInterpolate(_interpolators, _values, _pt, _default);
272 x_indices_by_lat.MinKey(),
273 y_indices_by_lon.MinKey(),
274 z_indices_by_depth.MinKey()
277 x_indices_by_lat.MaxKey(),
278 y_indices_by_lon.MaxKey(),
279 z_indices_by_depth.MaxKey()