MCPcopy Create free account
hub / github.com/PDAL/PDAL / processOne

Method processOne

io/FauxReader.cpp:202–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200#pragma warning (push)
201#pragma warning (disable: 4244)
202bool FauxReader::processOne(PointRef& point)
203{
204 double x(0);
205 double y(0);
206 double z(0);
207
208 if (m_index >= m_count)
209 return false;
210
211 switch (m_mode)
212 {
213 case Mode::Constant:
214 x = m_bounds.minx;
215 y = m_bounds.miny;
216 z = m_bounds.minz;
217 break;
218 case Mode::Ramp:
219 x = m_bounds.minx + m_delX * m_index;
220 y = m_bounds.miny + m_delY * m_index;
221 z = m_bounds.minz + m_delZ * m_index;
222 break;
223 case Mode::Normal:
224 x = (*m_normalX)(m_generator);
225 y = (*m_normalY)(m_generator);
226 z = (*m_normalZ)(m_generator);
227 break;
228 case Mode::Uniform:
229 x = (*m_uniformX)(m_generator);
230 y = (*m_uniformY)(m_generator);
231 z = (*m_uniformZ)(m_generator);
232 break;
233 case Mode::Invalid:
234 x = (*m_uniformX)(m_generator);
235 y = (*m_uniformY)(m_generator);
236 z = (*m_uniformZ)(m_generator);
237 break;
238 case Mode::Grid:
239 {
240 if (m_delX)
241 x = m_index % (point_count_t)m_delX;
242
243 if (m_delY)
244 {
245 if (m_delX)
246 y = (m_index / (point_count_t)m_delX) % (point_count_t)m_delY;
247 else
248 y = m_index % (point_count_t)m_delY;
249 }
250
251 if (m_delZ)
252 {
253 if (m_delX && m_delY)
254 z = m_index / (point_count_t)(m_delX * m_delY);
255 else if (m_delX)
256 z = m_index / (point_count_t)m_delX;
257 else if (m_delY)
258 z = m_index / (point_count_t)m_delY;
259 }

Callers

nothing calls this directly

Calls 1

setFieldMethod · 0.45

Tested by

no test coverage detected