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

Method write

plugins/e57/io/E57Writer.cpp:75–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void E57Writer::ChunkWriter::write(pdal::PointRef& pt, std::unique_ptr<e57plugin::ExtraDims>& extraDims)
76{
77// If buffer full, write to disk and reinitialise buffer
78
79 if (m_currentIndex == m_defaultChunkSize)
80 {
81 m_dataWriter->write(m_defaultChunkSize);
82 m_currentIndex = 0;
83 }
84
85 // Add point to buffer and increase index
86 using DimId = pdal::Dimension::Id;
87 for (auto& keyValue: m_doubleBuffers)
88 {
89 auto pdaldim = pdal::e57plugin::e57ToPdal(keyValue.first);
90 if (pdaldim != DimId::Unknown)
91 {
92 auto val = pt.getFieldAs<double>(pdaldim);
93 if ((pdaldim == DimId::Red || pdaldim == DimId::Green ||
94 pdaldim == DimId::Blue) &&
95 val > m_colorLimit)
96 {
97 m_colorLimit = m_colorLimit << 8; // Increase color bytes.
98 }
99
100 if (pdaldim == DimId::Intensity && val > m_intensityLimit)
101 {
102 m_intensityLimit = m_intensityLimit << 8;
103 }
104 keyValue.second[m_currentIndex] = val;
105 }
106 else
107 {
108 auto dim = extraDims->findDim(keyValue.first);
109 if (dim!=extraDims->end())
110 {
111 auto val = pt.getFieldAs<double>(dim->m_id);
112 keyValue.second[m_currentIndex] = val;
113 dim->grow(val);
114 }
115 }
116 }
117 m_currentIndex++;
118}
119
120void E57Writer::ChunkWriter::finalise()
121{

Callers 2

finaliseMethod · 0.45
processOneMethod · 0.45

Calls 7

e57ToPdalFunction · 0.85
processOneFunction · 0.85
pointMethod · 0.80
findDimMethod · 0.45
endMethod · 0.45
growMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected