QGIS API Documentation 3.43.0-Master (c67cf405802)
qgspointcloudeditingindex.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudeditingindex.h
3 ---------------------
4 begin : December 2024
5 copyright : (C) 2024 by Stefanos Natsis
6 email : uclaros 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 QGSPOINTCLOUDEDITINGINDEX_H
17#define QGSPOINTCLOUDEDITINGINDEX_H
18
19#include "qgspointcloudindex.h"
20#include "qgis_core.h"
21
22#define SIP_NO_FILE
23
25
36{
37 public:
40
41 void load( const QString &fileName ) override;
42 bool isValid() const override;
44 QgsCoordinateReferenceSystem crs() const override;
45 qint64 pointCount() const override;
46 QVariantMap originalMetadata() const override;
47
48 bool hasNode( const QgsPointCloudNodeId &n ) const override;
49 QgsPointCloudNode getNode( const QgsPointCloudNodeId &id ) const override;
50
51 bool setSubsetString( const QString &subset ) override;
52 QString subsetString() const override;
53
54 std::unique_ptr< QgsPointCloudBlock > nodeData( const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request ) override;
56
57 bool updateNodeData( const QHash<QgsPointCloudNodeId, QByteArray> &data ) override;
58
60 QgsPointCloudIndex backingIndex() const;
61
63 const QByteArray rawEditedNodeData( QgsPointCloudNodeId n ) const;
64
66 void resetNodeEdits( QgsPointCloudNodeId n );
67
74 bool commitChanges( QString *errorMessage = nullptr );
75
77 bool isModified() const;
78
80 bool isNodeModified( QgsPointCloudNodeId n ) const;
81
83 QList<QgsPointCloudNodeId> updatedNodes() const;
84
85
86 private:
87 QgsPointCloudIndex mIndex;
88 bool mIsValid = false;
89 QHash<QgsPointCloudNodeId, QByteArray> mEditedNodeData;
90 mutable QMutex mEditedNodeDataMutex;
91
93};
94
95#endif // QGSPOINTCLOUDEDITINGINDEX_H
PointCloudAccessType
The access type of the data, local is for local files and remote for remote files (over HTTP).
Definition qgis.h:5850
Represents an indexed point clouds data in octree.
virtual QVariantMap originalMetadata() const =0
Returns the original metadata map.
virtual qint64 pointCount() const =0
Returns the number of points in the point cloud.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate reference system of the point cloud index.
virtual bool hasNode(const QgsPointCloudNodeId &n) const
Returns whether the octree contain given node.
virtual void load(const QString &fileName)=0
Loads the index from the file.
virtual QgsPointCloudBlockRequest * asyncNodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns a handle responsible for loading a node data block.
virtual Qgis::PointCloudAccessType accessType() const =0
Returns the access type of the data If the access type is Remote, data will be fetched from an HTTP s...
virtual bool updateNodeData(const QHash< QgsPointCloudNodeId, QByteArray > &data)
Tries to update the data for the specified nodes.
virtual std::unique_ptr< QgsPointCloudBlock > nodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns node data block.
virtual bool isValid() const =0
Returns whether index is loaded and valid.
virtual QgsPointCloudNode getNode(const QgsPointCloudNodeId &id) const
Returns object for a given node.
virtual bool setSubsetString(const QString &subset)
Sets the string used to define a subset of the point cloud.
virtual QString subsetString() const
Returns the string used to define a subset of the point cloud.
Represents a coordinate reference system (CRS).
Base class for handling loading QgsPointCloudBlock asynchronously.
A QgsPointCloudIndex that is used as an editing buffer when editing point cloud data.
Smart pointer for QgsAbstractPointCloudIndex.
Contains utility functions for editing point cloud layers.
Represents a map layer supporting display of point clouds.
Represents an indexed point cloud node's position in octree.
Keeps metadata for an indexed point cloud node.
Point cloud data request.