18#ifndef QGSPOINTCLOUDCLASSIFIEDRENDERERWIDGET_H
19#define QGSPOINTCLOUDCLASSIFIEDRENDERERWIDGET_H
21#include "ui_qgspointcloudclassifiedrendererwidgetbase.h"
33class QgsPointCloud3DLayer3DRenderer;
39class GUI_EXPORT QgsPointCloudClassifiedRendererModel :
public QAbstractItemModel
43 QgsPointCloudClassifiedRendererModel( QObject *parent =
nullptr );
44 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
45 Qt::DropActions supportedDropActions()
const override;
46 QVariant data(
const QModelIndex &index,
int role )
const override;
47 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
48 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
49 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
50 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
51 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
52 QModelIndex parent(
const QModelIndex &index )
const override;
53 QStringList mimeTypes()
const override;
54 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
55 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
59 void addCategory(
const QgsPointCloudCategory &cat );
60 QgsPointCloudCategory category(
const QModelIndex &index );
61 void deleteRows( QList<int> rows );
66 void setCategoryColor(
int row,
const QColor &color );
67 void setCategoryPointSize(
int row,
double size );
69 void updateCategoriesPercentages(
const QMap<int, float> &percentages ) { mPercentages = percentages; };
72 void categoriesChanged();
79 QMap<int, float> mPercentages;
87class QgsPointCloudClassifiedRendererViewStyle :
public QgsProxyStyle
92 explicit QgsPointCloudClassifiedRendererViewStyle( QWidget *parent );
94 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
98class GUI_EXPORT QgsPointCloudClassifiedRendererWidget :
public QgsPointCloudRendererWidget,
private Ui::QgsPointCloudClassifiedRendererWidgetBase
103 QgsPointCloudClassifiedRendererWidget( QgsPointCloudLayer *layer, QgsStyle *style );
104 static QgsPointCloudRendererWidget *create( QgsPointCloudLayer *layer, QgsStyle *style, QgsPointCloudRenderer * );
106 QgsPointCloudRenderer *renderer()
override;
108 QString attribute()
const;
114 void setFromRenderer(
const QgsPointCloudRenderer *r );
123 void addCategories();
124 void emitWidgetChanged();
125 void categoriesDoubleClicked(
const QModelIndex &idx );
127 void deleteCategories();
128 void deleteAllCategories();
129 void attributeChanged();
130 void changeCategoryColor();
131 void changeCategoryOpacity();
132 void changeCategoryPointSize();
139 QList<int> selectedCategories();
141 int currentCategoryRow();
143 void updateCategoriesPercentages();
145 QgsPointCloudClassifiedRendererModel *mModel =
nullptr;
146 bool mBlockChangedSignal =
false;
147 QMenu *contextMenu =
nullptr;
Renders point clouds by a classification attribute.
Represents a map layer supporting display of point clouds.
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style,...
A database of saved style entities, including symbols, color ramps, text formats and others.
QList< QgsPointCloudCategory > QgsPointCloudCategoryList