| 73 | } |
| 74 | |
| 75 | std::vector<char> Header::data() const |
| 76 | { |
| 77 | size_t size = Size12; |
| 78 | if (versionMinor >= 4) |
| 79 | size = Size14; |
| 80 | else if (versionMinor == 3) |
| 81 | size = Size13; |
| 82 | |
| 83 | std::vector<char> buf(size); |
| 84 | LeInserter s(buf.data(), buf.size()); |
| 85 | |
| 86 | s.put(magic, 4); |
| 87 | s << fileSourceId << globalEncoding; |
| 88 | |
| 89 | char guidBuf[Uuid::size()]; |
| 90 | projectGuid.pack(guidBuf); |
| 91 | s.put(guidBuf, Uuid::size()); |
| 92 | |
| 93 | s << versionMajor << versionMinor; |
| 94 | s.put(systemId, 32); |
| 95 | s.put(softwareId, 32); |
| 96 | s << creationDoy << creationYear; |
| 97 | s << headerSize << pointOffset << vlrCount; |
| 98 | s << pointFormatBits << pointSize << legacyPointCount; |
| 99 | |
| 100 | for (const uint32_t& pbr : legacyPointsByReturn) |
| 101 | s << pbr; |
| 102 | |
| 103 | s << scale.x << scale.y << scale.z; |
| 104 | s << offset.x << offset.y << offset.z; |
| 105 | s << bounds.maxx << bounds.minx << bounds.maxy << bounds.miny << bounds.maxz << bounds.minz; |
| 106 | if (versionMinor >= 3) |
| 107 | { |
| 108 | s << waveOffset; |
| 109 | if (versionMinor >= 4) |
| 110 | { |
| 111 | s << evlrOffset << evlrCount << ePointCount; |
| 112 | for (const uint64_t& pbr : ePointsByReturn) |
| 113 | s << pbr; |
| 114 | } |
| 115 | } |
| 116 | return buf; |
| 117 | } |
| 118 | |
| 119 | StringList Header::validate(uint64_t fileSize) const |
| 120 | { |
no test coverage detected