| 165 | } |
| 166 | |
| 167 | void E57Writer::addDimensions(PointLayoutPtr layout) |
| 168 | { |
| 169 | m_extraDims.reset(new e57plugin::ExtraDims()); |
| 170 | m_extraDims->parse(m_extraDimsSpec); |
| 171 | auto i = m_extraDims->begin(); |
| 172 | auto supportedFields = e57plugin::supportedE57Types(); |
| 173 | |
| 174 | // Filter extra dimensions. |
| 175 | while (i != m_extraDims->end()) |
| 176 | { |
| 177 | i->m_id = layout->findDim(i->m_name); |
| 178 | if (i->m_id == Dimension::Id::Unknown) |
| 179 | { |
| 180 | // Incomming layout donot provide any data for this dimension. |
| 181 | // It should be ignored from writing in E57. |
| 182 | log()->get(LogLevel::Warning) |
| 183 | << "Extra dimension specified in pipeline don't match in source point cloud." |
| 184 | " Ignoring pipeline-specified dimension : " << i->m_name << std::endl; |
| 185 | i = m_extraDims->deleteDim(i); |
| 186 | continue; |
| 187 | } |
| 188 | |
| 189 | if (Utils::contains(supportedFields, i->m_name)) |
| 190 | { |
| 191 | // This dimension is already in E57 dimensions and should not be treated as extra dimension. |
| 192 | i = m_extraDims->deleteDim(i); |
| 193 | continue; |
| 194 | } |
| 195 | |
| 196 | ++i; |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void E57Writer::ready(PointTableRef table) |
| 201 | { |