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

Method copyPoint

plugins/rxp/io/RxpPointcloud.cpp:159–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157
158
159void RxpPointcloud::copyPoint(const Point& from, PointRef& to) const {
160 using namespace Dimension;
161
162
163 to.setField(Id::X, from.target.vertex[0]);
164 to.setField(Id::Y, from.target.vertex[1]);
165 to.setField(Id::Z, from.target.vertex[2]);
166 to.setField(Id::EchoRange, from.target.echo_range);
167 to.setField(Id::Amplitude, from.target.amplitude);
168 to.setField(Id::Reflectance, from.target.reflectance);
169 to.setField(Id::Deviation, from.target.deviation);
170 to.setField(Id::BackgroundRadiation, from.target.background_radiation);
171 to.setField(Id::IsPpsLocked, from.target.is_pps_locked);
172 to.setField(getTimeDimensionId(m_syncToPps), from.target.time);
173
174 if (m_reflectanceAsIntensity) {
175 uint16_t intensity;
176 if (from.target.reflectance > m_maxReflectance) {
177 intensity = (std::numeric_limits<uint16_t>::max)();
178 } else if (from.target.reflectance < m_minReflectance) {
179 intensity = 0;
180 } else {
181 intensity = uint16_t(std::roundf(double((std::numeric_limits<uint16_t>::max)()) *
182 (from.target.reflectance - m_minReflectance) / (m_maxReflectance - m_minReflectance)));
183 }
184 to.setField(Id::Intensity, intensity);
185 }
186
187 // Shot metadata (always valid)
188 to.setField(Id::ShotTimestamp, from.shotTimestamp);
189 to.setField(Id::UnambiguousRange, from.unambiguousRange);
190 to.setField(Id::ReturnNumber, from.returnNumber);
191 to.setField(Id::NumberOfReturns, from.numberOfReturns);
192 to.setField(Id::EdgeOfFlightLine, from.edgeOfFlightLine ? 1 : 0);
193
194 to.setField(Id::BeamDirectionX, from.beamDirectionX);
195 to.setField(Id::BeamDirectionY, from.beamDirectionY);
196 to.setField(Id::BeamDirectionZ, from.beamDirectionZ);
197 to.setField(Id::BeamOriginX, from.beamOriginX);
198 to.setField(Id::BeamOriginY, from.beamOriginY);
199 to.setField(Id::BeamOriginZ, from.beamOriginZ);
200 to.setField(Id::Roll, from.roll);
201 to.setField(Id::Pitch, from.pitch);
202
203}
204
205
206bool RxpPointcloud::endOfInput() const

Callers

nothing calls this directly

Calls 2

getTimeDimensionIdFunction · 0.85
setFieldMethod · 0.45

Tested by

no test coverage detected