QGIS API Documentation 3.41.0-Master (f75d66fa9f9)
Loading...
Searching...
No Matches
qgscopcupdate.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscopcupdate.h
3 ---------------------
4 begin : January 2025
5 copyright : (C) 2025 by Martin Dobias
6 email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSCOPCUPDATE_H
17#define QGSCOPCUPDATE_H
18
19#include "qgis_core.h"
20#include "qgspointcloudindex.h"
21
22#include <lazperf/header.hpp>
23#include <lazperf/vlr.hpp>
24
25#define SIP_NO_FILE
26
27
38class CORE_EXPORT QgsCopcUpdate
39{
40 public:
41
44 {
46 int32_t pointCount;
48 QByteArray chunkData;
49 };
50
52 bool read( const QString &inputFilename );
53
55 bool write( const QString &outputFilename, const QHash<QgsPointCloudNodeId, UpdatedChunk> &updatedChunks );
56
58 QString errorMessage() const { return mErrorMessage; }
59
67 static bool writeUpdatedFile( const QString &inputFilename,
68 const QString &outputFilename,
69 const QHash<QgsPointCloudNodeId, UpdatedChunk> &updatedChunks,
70 QString *errorMessage = nullptr );
71
72 private:
73 bool readHeader();
74 void readChunkTable();
75 void readHierarchy();
76
77 private:
78 QString mInputFilename;
79 std::ifstream mFile;
80 lazperf::header14 mHeader;
81 lazperf::copc_info_vlr mCopcVlr;
82 std::vector<lazperf::chunk> mChunks;
83 uint32_t mChunkCount = 0;
84 uint64_t mHierarchyOffset = 0;
85 std::vector<char> mHierarchyBlob;
86 std::vector<lazperf::evlr_header> mEvlrHeaders;
87 std::vector<std::vector<char>> mEvlrData;
88 QHash<uint64_t, QgsPointCloudNodeId> mOffsetToVoxel;
89
90 QString mErrorMessage;
91};
92
93#endif // QGSCOPCUPDATE_H
This class takes an existing COPC file and a list of chunks that should be modified,...
QString errorMessage() const
Returns error message.
Keeps information how points of a single chunk has been modified.
QByteArray chunkData
Data of the chunk (compressed already with LAZ compressor)
int32_t pointCount
Number of points in the updated chunk.