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

Method ready

io/PcdWriter.cpp:192–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void PcdWriter::ready(PointTableRef table)
193{
194 PcdField field;
195 field.m_label = table.layout()->dimName(Id::X);
196 field.m_id = Id::X;
197 field.m_size = 4;
198 field.m_type = PcdFieldType::F;
199 field.m_count = 1;
200 m_xDim = DimSpec{field, m_precision};
201 field.m_label = table.layout()->dimName(Id::Y);
202 field.m_id = Id::Y;
203 m_yDim = {field, m_precision};
204 field.m_label = table.layout()->dimName(Id::Z);
205 field.m_id = Id::Z;
206 m_zDim = {field, m_precision};
207
208 // Find the dimensions listed and put them on the id list.
209 StringList dimNames = Utils::split2(m_dimOrder, ',');
210 for (std::string dim : dimNames)
211 {
212 const DimSpec& spec = extractDim(dim, table);
213 if (spec.m_field.m_id == Id::X)
214 m_xDim = spec;
215 else if (spec.m_field.m_id == Id::Y)
216 m_yDim = spec;
217 else if (spec.m_field.m_id == Id::Z)
218 m_zDim = spec;
219 m_dims.push_back(spec);
220 }
221
222 if (m_dimOrder.empty() || m_writeAllDims)
223 {
224 IdList all = table.layout()->dims();
225 for (auto id : all)
226 {
227 PcdField field;
228 field.m_label = table.layout()->dimName(id);
229 field.m_id = id;
230 if (id == Id::X || id == Id::Y || id == Id::Z)
231 field.m_size = 4;
232 else
233 field.m_size = 8;
234 field.m_type = PcdFieldType::F;
235 field.m_count = 1;
236 DimSpec ds{field, m_precision};
237 if (!findDim(id, ds))
238 m_dims.push_back(ds);
239 }
240 }
241}
242
243void PcdWriter::write(const PointViewPtr view)
244{

Callers

nothing calls this directly

Calls 3

extractDimFunction · 0.85
dimNameMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected