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

Method addDimensions

io/PcdReader.cpp:103–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void PcdReader::addDimensions(PointLayoutPtr layout)
104{
105 m_dims.clear();
106 for (PcdField& i : m_header.m_fields)
107 {
108 Dimension::BaseType base = Dimension::BaseType::None;
109 if (i.m_type == PcdFieldType::U)
110 base = Dimension::BaseType::Unsigned;
111 else if (i.m_type == PcdFieldType::I)
112 base = Dimension::BaseType::Signed;
113 else if (i.m_type == PcdFieldType::F)
114 base = Dimension::BaseType::Floating;
115 Dimension::Type t =
116 static_cast<Dimension::Type>(unsigned(base) | i.m_size);
117 Utils::trim(i.m_label);
118 i.m_label = Utils::toupper(i.m_label);
119 if (i.m_label == "X" || i.m_label == "Y" || i.m_label == "Z")
120 t = Dimension::Type::Double;
121 i.m_id = layout->registerOrAssignDim(i.m_label, t);
122 if (Utils::contains(m_dims, i.m_id) && i.m_id != pdal::Dimension::Id::Unknown)
123 throwError("Duplicate dimension '" + i.m_label +
124 "' detected in input file '" + m_filename + "'.");
125 m_dims.push_back(i.m_id);
126 }
127}
128
129bool PcdReader::fillFields()
130{

Callers

nothing calls this directly

Calls 5

trimFunction · 0.85
toupperFunction · 0.85
registerOrAssignDimMethod · 0.80
containsFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected