| 240 | } |
| 241 | |
| 242 | void E57Writer::done(PointTableRef table) |
| 243 | { |
| 244 | if (m_chunkWriter) |
| 245 | { |
| 246 | m_chunkWriter->finalise(); |
| 247 | } |
| 248 | |
| 249 | // Set bounding boxes on case by case basis |
| 250 | if (Utils::contains(m_dimensionsToWrite, "colorRed")) |
| 251 | { |
| 252 | // found color info |
| 253 | using namespace Dimension; |
| 254 | |
| 255 | e57::StructureNode colorbox = e57::StructureNode(*m_imageFile); |
| 256 | std::vector<Id> colors { Id::Red, Id::Green, Id::Blue }; |
| 257 | |
| 258 | for (auto id : colors) |
| 259 | { |
| 260 | std::string name = Dimension::name(id); |
| 261 | colorbox.set("color" + name + "Minimum", |
| 262 | e57::IntegerNode(*m_imageFile, 0)); |
| 263 | colorbox.set("color" + name + "Maximum", |
| 264 | e57::IntegerNode(*m_imageFile, m_chunkWriter->getColorLimit())); |
| 265 | } |
| 266 | m_scanNode->set("colorLimits", colorbox); |
| 267 | } |
| 268 | |
| 269 | if (Utils::contains(m_dimensionsToWrite, "intensity")) |
| 270 | { |
| 271 | // found intensity info |
| 272 | e57::StructureNode intensityBox = e57::StructureNode(*m_imageFile); |
| 273 | intensityBox.set("intensityMinimum", |
| 274 | e57::IntegerNode(*m_imageFile, 0)); |
| 275 | intensityBox.set( |
| 276 | "intensityMaximum", |
| 277 | e57::IntegerNode(*m_imageFile, m_chunkWriter->getIntensityLimit())); |
| 278 | m_scanNode->set("intensityLimits", intensityBox); |
| 279 | } |
| 280 | |
| 281 | if (Utils::contains(m_dimensionsToWrite, "classification")) |
| 282 | { |
| 283 | // found classification info |
| 284 | e57::StructureNode classificationBox = e57::StructureNode(*m_imageFile); |
| 285 | classificationBox.set("classificationMinimum", |
| 286 | e57::IntegerNode(*m_imageFile, 0)); |
| 287 | classificationBox.set( |
| 288 | "classificationMaximum", |
| 289 | e57::IntegerNode(*m_imageFile, 255)); |
| 290 | m_scanNode->set("classificationLimits", classificationBox); |
| 291 | } |
| 292 | |
| 293 | for (auto extradim = m_extraDims->begin(); extradim != m_extraDims->end(); |
| 294 | ++extradim) |
| 295 | { |
| 296 | e57::StructureNode extraDimBox = e57::StructureNode(*m_imageFile); |
| 297 | extraDimBox.set( |
| 298 | extradim->m_name + "Minimum", |
| 299 | e57::FloatNode(*m_imageFile, extradim->m_min)); |
nothing calls this directly
no test coverage detected