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

Function getPdalBounds

plugins/e57/io/Utils.cpp:224–239  ·  view source on GitHub ↗

This will give positive bounds to default data type for id.

Source from the content-addressed store, hash-verified

222
223// This will give positive bounds to default data type for id.
224std::pair<uint64_t, uint64_t> getPdalBounds(pdal::Dimension::Id id)
225{
226 // pdal::Dimension::size() returns number of bytes for the
227 // pdal::Dimesion::Type.
228 // eg: 1 for uint8, 2 for uint16, 4 for uint32, 8 for double, etc.
229 // Max range for data type = (2 ^ (8 * no. of bytes)) - 1
230 auto type = pdal::Dimension::defaultType(id);
231 auto typeName = pdal::Dimension::interpretationName(type);
232 if (typeName.find("uint") == 0)
233 {
234 uint64_t maxVal = ~0;
235 maxVal = maxVal >> (sizeof(uint64_t) - pdal::Dimension::size(type)) * CHAR_BIT;
236 return {0, maxVal};
237 }
238 throw pdal_error("Cannot retrieve bounds for : " + typeName);
239}
240
241point_count_t numPoints(const e57::VectorNode data3D)
242{

Callers 3

setupWriterMethod · 0.85
decodeHeaderMethod · 0.85
TESTFunction · 0.85

Calls 3

interpretationNameFunction · 0.85
sizeFunction · 0.50
findMethod · 0.45

Tested by 1

TESTFunction · 0.68