QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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 "lazperf/header.hpp"
20#include "lazperf/vlr.hpp"
21#include "qgis_core.h"
22#include "qgspointcloudindex.h"
23
24#define SIP_NO_FILE
25
37class CORE_EXPORT QgsCopcUpdate
38{
39 public:
42 {
44 int32_t pointCount;
46 QByteArray chunkData;
47 };
48
50 bool read( const QString &inputFilename );
51
53 bool write( const QString &outputFilename, const QHash<QgsPointCloudNodeId, UpdatedChunk> &updatedChunks );
54
56 QString errorMessage() const { return mErrorMessage; }
57
65 static bool writeUpdatedFile( const QString &inputFilename, const QString &outputFilename, const QHash<QgsPointCloudNodeId, UpdatedChunk> &updatedChunks, QString *errorMessage = nullptr );
66
67 private:
68 bool readHeader();
69 void readChunkTable();
70 void readHierarchy();
71
72 private:
73 QString mInputFilename;
74 std::ifstream mFile;
75 lazperf::header14 mHeader;
76 lazperf::copc_info_vlr mCopcVlr;
77 std::vector<lazperf::chunk> mChunks;
78 uint32_t mChunkCount = 0;
79 uint64_t mHierarchyOffset = 0;
80 std::vector<char> mHierarchyBlob;
81 std::vector<lazperf::evlr_header> mEvlrHeaders;
82 std::vector<std::vector<char>> mEvlrData;
83 QHash<uint64_t, QgsPointCloudNodeId> mOffsetToVoxel;
84
85 QString mErrorMessage;
86};
87
88#endif // QGSCOPCUPDATE_H
Handles update operations to a COPC file.
QString errorMessage() const
Returns error message.
bool read(const QString &inputFilename)
Reads input COPC file and initializes all the members.
bool write(const QString &outputFilename, const QHash< QgsPointCloudNodeId, UpdatedChunk > &updatedChunks)
Writes a COPC file with updated chunks.
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.