QGIS API Documentation 3.99.0-Master (a8f284845db)
Loading...
Searching...
No Matches
qgspointcloudlayerundocommand.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudlayerundocommand.h
3 ---------------------
4 begin : January 2025
5 copyright : (C) 2025 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 QGSPOINTCLOUDLAYERUNDOCOMMAND_H
17#define QGSPOINTCLOUDLAYERUNDOCOMMAND_H
18
19
20#include "qgis_core.h"
22#include "qgspointcloudindex.h"
23
24#include <QUndoCommand>
25
26#define SIP_NO_FILE
27
29
37class CORE_EXPORT QgsPointCloudLayerUndoCommand : public QUndoCommand
38{
39 protected:
43};
44
53{
54 public:
55
63 QgsPointCloudLayerUndoCommandChangeAttribute( QgsPointCloudLayer *layer, const QHash<int, QHash<QgsPointCloudNodeId, QVector<int>>> &mappedPoints, const QgsPointCloudAttribute &attribute, double value );
64
65 void undo() override;
66 void redo() override;
67
68 private:
69 struct PerNodeData
70 {
71 QHash<int, double> oldPointValues;
72 bool firstEdit = false;
73 int attributeOffset = 0;
74 };
75
76 struct NodeProcessData
77 {
78 int position;
81 QVector<int> points;
82 };
83
84 void undoRedoPrivate( bool isUndo );
85
86 QMap<int, QHash<QgsPointCloudNodeId, PerNodeData>> mPerNodeData;
87 QgsPointCloudAttribute mAttribute;
88 double mNewValue = 0;
89};
90#endif // QGSPOINTCLOUDLAYERUNDOCOMMAND_H
Attribute for point cloud data pair of name and size in bytes.
Smart pointer for QgsAbstractPointCloudIndex.
QgsPointCloudLayerUndoCommandChangeAttribute(QgsPointCloudLayer *layer, const QHash< int, QHash< QgsPointCloudNodeId, QVector< int > > > &mappedPoints, const QgsPointCloudAttribute &attribute, double value)
Constructor for QgsPointCloudLayerUndoCommandChangeAttribute.
QgsPointCloudLayerUndoCommand(QgsPointCloudLayer *layer)
Ctor.
Represents a map layer supporting display of point clouds.
Represents an indexed point cloud node's position in octree.