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

Method processOne

plugins/tiledb/test/XYZTmUtils.cpp:150–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148#pragma warning(disable : 4244)
149
150bool XYZTimeFauxReader::processOne(PointRef& point)
151{
152 double x(0);
153 double y(0);
154 double z(0);
155 double tm(0);
156
157 if (m_index >= m_count)
158 return false;
159
160 switch (m_xyz_mode)
161 {
162 case Mode::Uniform:
163 x = (*m_uniformX)(m_generator);
164 y = (*m_uniformY)(m_generator);
165 z = (*m_uniformZ)(m_generator);
166 break;
167 case Mode::Ramp:
168 x = m_bounds.minX() + m_delX * m_index;
169 y = m_bounds.minY() + m_delY * m_index;
170 z = m_bounds.minZ() + m_delZ * m_index;
171 break;
172 default:
173 throwError("Invalid mode: only 'uniform' and 'ramp' implemented");
174 }
175
176 if (m_use_time)
177 {
178 switch (m_tm_mode)
179 {
180 case Mode::Uniform:
181 tm = (*m_uniformTm)(m_generator);
182 break;
183 case Mode::Ramp:
184 tm = m_bounds.minGpsTime() + m_delTm * m_index;
185 break;
186 default:
187 throwError("Invalid mode: only 'uniform' and 'ramp' implemented");
188 }
189 }
190
191 point.setField(Dimension::Id::X, x);
192 point.setField(Dimension::Id::Y, y);
193 point.setField(Dimension::Id::Z, z);
194 if (m_use_time)
195 point.setField(Dimension::id(m_dim4_name), tm);
196 point.setField(Dimension::Id::Density, m_density);
197 m_index++;
198 return true;
199}
200
201#pragma warning(pop)
202

Callers

nothing calls this directly

Calls 6

idFunction · 0.85
minGpsTimeMethod · 0.80
minXMethod · 0.45
minYMethod · 0.45
minZMethod · 0.45
setFieldMethod · 0.45

Tested by

no test coverage detected