Skip to content

Commit

Permalink
Initial shell for QgsPointCloudRendererWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 16, 2020
1 parent bf8ccad commit 090afdd
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 0 deletions.
@@ -0,0 +1,69 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/pointcloud/qgspointcloudrendererwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsPointCloudRendererWidget : QgsPanelWidget
{
%Docstring
Base class for point cloud 2D renderer settings widgets.

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgspointcloudrendererwidget.h"
%End
public:

QgsPointCloudRendererWidget( QgsPointCloudLayer *layer, QgsStyle *style );
%Docstring
Constructor for QgsPointCloudRendererWidget, associated with the
specified ``layer`` and ``style`` database.
%End

virtual QgsPointCloudRenderer *renderer() /Factory/ = 0;
%Docstring
Returns a new instance of a renderer as defined by the settings in the widget.

Caller takes ownership of the returned object.
%End

virtual void setContext( const QgsSymbolWidgetContext &context );
%Docstring
Sets the ``context`` in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.

.. seealso:: :py:func:`context`
%End

QgsSymbolWidgetContext context() const;
%Docstring
Returns the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.

.. seealso:: :py:func:`setContext`
%End

const QgsPointCloudLayer *layer() const;
%Docstring
Returns the point cloud layer associated with the widget.
%End

signals:

protected:


};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/pointcloud/qgspointcloudrendererwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -334,6 +334,7 @@
%Include auto_generated/numericformats/qgsnumericformatselectorwidget.sip
%Include auto_generated/numericformats/qgsnumericformatwidget.sip
%Include auto_generated/numericformats/qgsnumericformatguiregistry.sip
%Include auto_generated/pointcloud/qgspointcloudrendererwidget.sip
%Include auto_generated/processing/qgsprocessingaggregatewidgets.sip
%Include auto_generated/processing/qgsprocessingalgorithmconfigurationwidget.sip
%Include auto_generated/processing/qgsprocessingalgorithmdialogbase.sip
Expand Down
4 changes: 4 additions & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -287,6 +287,8 @@ set(QGIS_GUI_SRCS
ogr/qgsnewogrconnection.cpp
ogr/qgsvectorlayersaveasdialog.cpp

pointcloud/qgspointcloudrendererwidget.cpp

processing/qgsprocessingaggregatewidgets.cpp
processing/qgsprocessingaggregatewidgetwrapper.cpp
processing/qgsprocessingalgorithmconfigurationwidget.cpp
Expand Down Expand Up @@ -1056,6 +1058,8 @@ set(QGIS_GUI_HDRS
ogr/qgsogrhelperfunctions.h
ogr/qgsvectorlayersaveasdialog.h

pointcloud/qgspointcloudrendererwidget.h

processing/qgsprocessingaggregatewidgets.h
processing/qgsprocessingaggregatewidgetwrapper.h
processing/qgsprocessingalgorithmconfigurationwidget.h
Expand Down
32 changes: 32 additions & 0 deletions src/gui/pointcloud/qgspointcloudrendererwidget.cpp
@@ -0,0 +1,32 @@
/***************************************************************************
qgspointcloudrendererwidget.cpp
---------------------
begin : November 2020
copyright : (C) 2020 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgspointcloudrendererwidget.h"

QgsPointCloudRendererWidget::QgsPointCloudRendererWidget( QgsPointCloudLayer *layer, QgsStyle *style )
: mLayer( layer )
, mStyle( style )
{
}

void QgsPointCloudRendererWidget::setContext( const QgsSymbolWidgetContext &context )
{
mContext = context;
}

QgsSymbolWidgetContext QgsPointCloudRendererWidget::context() const
{
return mContext;
}

82 changes: 82 additions & 0 deletions src/gui/pointcloud/qgspointcloudrendererwidget.h
@@ -0,0 +1,82 @@
/***************************************************************************
qgspointcloudrendererwidget.h
---------------------
begin : November 2020
copyright : (C) 2020 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSPOINTCLOUDRENDERERWIDGET_H
#define QGSPOINTCLOUDRENDERERWIDGET_H

#include <QWidget>
#include <QMenu>
#include <QStackedWidget>
#include "qgis_sip.h"
#include "qgspanelwidget.h"
#include "qgssymbolwidgetcontext.h"

class QgsPointCloudLayer;
class QgsStyle;
class QgsPointCloudRenderer;
class QgsMapCanvas;

/**
* \ingroup gui
* Base class for point cloud 2D renderer settings widgets.
*
* \since QGIS 3.18
*/
class GUI_EXPORT QgsPointCloudRendererWidget : public QgsPanelWidget
{
Q_OBJECT
public:

/**
* Constructor for QgsPointCloudRendererWidget, associated with the
* specified \a layer and \a style database.
*/
QgsPointCloudRendererWidget( QgsPointCloudLayer *layer, QgsStyle *style );

/**
* Returns a new instance of a renderer as defined by the settings in the widget.
*
* Caller takes ownership of the returned object.
*/
virtual QgsPointCloudRenderer *renderer() SIP_FACTORY = 0;

/**
* Sets the \a context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
* \see context()
*/
virtual void setContext( const QgsSymbolWidgetContext &context );

/**
* Returns the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
* \see setContext()
*/
QgsSymbolWidgetContext context() const;

/**
* Returns the point cloud layer associated with the widget.
*/
const QgsPointCloudLayer *layer() const { return mLayer; }

signals:

protected:
QgsPointCloudLayer *mLayer = nullptr;
QgsStyle *mStyle = nullptr;

//! Context in which widget is shown
QgsSymbolWidgetContext mContext;

};

#endif // QGSPOINTCLOUDRENDERERWIDGET_H

0 comments on commit 090afdd

Please sign in to comment.