Skip to content
Permalink
Browse files

2D RGB Renderer for point clouds

  • Loading branch information
nyalldawson committed Nov 12, 2020
1 parent a6d61c0 commit 3ca572c0e316b301cec9d74ccbe7d60c26a73875
@@ -81,6 +81,15 @@ Abstract base class for 2d point cloud renderers.

%TypeHeaderCode
#include "qgspointcloudrenderer.h"
%End
%ConvertToSubClassCode

const QString type = sipCpp->type();

if ( type == QLatin1String( "rgb" ) )
sipType = sipType_QgsPointCloudRgbRenderer;
else
sipType = 0;
%End
public:

@@ -0,0 +1,132 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudrgbrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsPointCloudRgbRenderer : QgsPointCloudRenderer
{
%Docstring
An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes.

.. versionadded:: 3.18
%End

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

QgsPointCloudRgbRenderer();
%Docstring
Constructor for QgsPointCloudRgbRenderer.
%End

virtual QgsPointCloudRenderer *clone() const;

virtual void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context );

virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const;

virtual void startRender( QgsPointCloudRenderContext &context );

virtual void stopRender( QgsPointCloudRenderContext &context );

virtual QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const;


static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Creates an RGB renderer from an XML ``element``.
%End

int penWidth() const;
%Docstring
Returns pen width
%End

void setPenWidth( int value );
%Docstring
Sets pen width
%End

QString redAttribute() const;
%Docstring
Returns the attribute to use for the red channel.

.. seealso:: :py:func:`greenAttribute`

.. seealso:: :py:func:`blueAttribute`

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

void setRedAttribute( const QString &attribute );
%Docstring
Sets the ``attribute`` to use for the red channel.

.. seealso:: :py:func:`setGreenAttribute`

.. seealso:: :py:func:`setBlueAttribute`

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

QString greenAttribute() const;
%Docstring
Returns the attribute to use for the green channel.

.. seealso:: :py:func:`redAttribute`

.. seealso:: :py:func:`blueAttribute`

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

void setGreenAttribute( const QString &attribute );
%Docstring
Sets the ``attribute`` to use for the green channel.

.. seealso:: :py:func:`setRedAttribute`

.. seealso:: :py:func:`setBlueAttribute`

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

QString blueAttribute() const;
%Docstring
Returns the attribute to use for the blue channel.

.. seealso:: :py:func:`greenAttribute`

.. seealso:: :py:func:`redAttribute`

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

void setBlueAttribute( const QString &attribute );
%Docstring
Sets the ``attribute`` to use for the blue channel.

.. seealso:: :py:func:`setRedAttribute`

.. seealso:: :py:func:`setGreenAttribute`

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

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudrgbrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -450,6 +450,7 @@
%Include auto_generated/pointcloud/qgspointclouddataprovider.sip
%Include auto_generated/pointcloud/qgspointcloudrenderer.sip
%Include auto_generated/pointcloud/qgspointcloudrendererregistry.sip
%Include auto_generated/pointcloud/qgspointcloudrgbrenderer.sip
%Include auto_generated/metadata/qgsabstractmetadatabase.sip
%Include auto_generated/metadata/qgslayermetadata.sip
%Include auto_generated/metadata/qgslayermetadataformatter.sip
@@ -640,6 +640,7 @@ set(QGIS_CORE_SRCS
pointcloud/qgspointclouddataprovider.cpp
pointcloud/qgspointcloudrenderer.cpp
pointcloud/qgspointcloudrendererregistry.cpp
pointcloud/qgspointcloudrgbrenderer.cpp

labeling/qgslabelfeature.cpp
labeling/qgslabelingengine.cpp
@@ -1327,6 +1328,7 @@ set(QGIS_CORE_HDRS
pointcloud/qgspointclouddataprovider.h
pointcloud/qgspointcloudrenderer.h
pointcloud/qgspointcloudrendererregistry.h
pointcloud/qgspointcloudrgbrenderer.h

metadata/qgsabstractmetadatabase.h
metadata/qgslayermetadata.h
@@ -109,6 +109,19 @@ class CORE_EXPORT QgsPointCloudRenderContext
*/
class CORE_EXPORT QgsPointCloudRenderer
{

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE

const QString type = sipCpp->type();

if ( type == QLatin1String( "rgb" ) )
sipType = sipType_QgsPointCloudRgbRenderer;
else
sipType = 0;
SIP_END
#endif

public:

/**
@@ -16,12 +16,16 @@
#include "qgspointcloudrenderer.h"

// default renderers
#include "qgspointcloudrgbrenderer.h"

#include "qgspointcloudlayer.h"

QgsPointCloudRendererRegistry::QgsPointCloudRendererRegistry()
{
// add default renderers
addRenderer( new QgsPointCloudRendererMetadata( QStringLiteral( "rgb" ),
QObject::tr( "RGB" ),
QgsPointCloudRgbRenderer::create ) );
addRenderer( new QgsPointCloudRendererMetadata( QStringLiteral( "dummy" ),
QObject::tr( "Dummy" ),
QgsDummyPointCloudRenderer::create ) );

0 comments on commit 3ca572c

Please sign in to comment.
You can’t perform that action at this time.