1 /***************************************************************************
2     qgspointcloudlayerstylewidget.cpp
3     ---------------------
4     begin                : November 2020
5     copyright            : (C) 2020 by Nyall Dawson
6     email                : nyall dot dawson 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 #include "qgspointcloudlayerstylewidget.h"
17 #include "qgspointcloudrendererpropertieswidget.h"
18 #include "qgsstyle.h"
19 #include "qgsapplication.h"
20 #include "qgsmaplayer.h"
21 #include "qgspointcloudlayer.h"
22 
QgsPointCloudRendererWidgetFactory(QObject * parent)23 QgsPointCloudRendererWidgetFactory::QgsPointCloudRendererWidgetFactory( QObject *parent )
24   : QObject( parent )
25 {
26   setIcon( QgsApplication::getThemeIcon( QStringLiteral( "propertyicons/symbology.svg" ) ) );
27   setTitle( tr( "Symbology" ) );
28 }
29 
createWidget(QgsMapLayer * layer,QgsMapCanvas *,bool,QWidget * parent) const30 QgsMapLayerConfigWidget *QgsPointCloudRendererWidgetFactory::createWidget( QgsMapLayer *layer, QgsMapCanvas *, bool, QWidget *parent ) const
31 {
32   return new QgsPointCloudRendererPropertiesWidget( qobject_cast< QgsPointCloudLayer * >( layer ), QgsStyle::defaultStyle(), parent );
33 }
34 
supportLayerPropertiesDialog() const35 bool QgsPointCloudRendererWidgetFactory::supportLayerPropertiesDialog() const
36 {
37   return true;
38 }
39 
supportsStyleDock() const40 bool QgsPointCloudRendererWidgetFactory::supportsStyleDock() const
41 {
42   return true;
43 }
44 
supportsLayer(QgsMapLayer * layer) const45 bool QgsPointCloudRendererWidgetFactory::supportsLayer( QgsMapLayer *layer ) const
46 {
47   return layer->type() == QgsMapLayerType::PointCloudLayer;
48 }
49 
layerPropertiesPagePositionHint() const50 QString QgsPointCloudRendererWidgetFactory::layerPropertiesPagePositionHint() const
51 {
52   return QStringLiteral( "mOptsPage_Metadata" );
53 }
54