Skip to content
Permalink
Browse files

Rename QgsPointCloudRenderer to QgsPointCloudLayerRenderer

This follow the pattern of QgsVectorLayerRenderer, QgsRasterLayerRenderer,
etc and disambiguates the layer renderer from the 2d renderer
itself.
  • Loading branch information
nyalldawson committed Oct 26, 2020
1 parent b78583e commit 4e94abc31fad5a68ec7e5b2ec24afbaa12e12bed
@@ -14,7 +14,7 @@



class QgsPointCloudRenderer: QgsMapLayerRenderer
class QgsPointCloudLayerRenderer: QgsMapLayerRenderer
{
%Docstring

@@ -32,8 +32,8 @@ Represents a 2D renderer of point cloud data
%End
public:

explicit QgsPointCloudRenderer( QgsPointCloudLayer *layer, QgsRenderContext &context );
~QgsPointCloudRenderer();
explicit QgsPointCloudLayerRenderer( QgsPointCloudLayer *layer, QgsRenderContext &context );
~QgsPointCloudLayerRenderer();

virtual bool render();

@@ -63,7 +63,7 @@ QgsRectangle QgsPointCloudLayer::extent() const

QgsMapLayerRenderer *QgsPointCloudLayer::createMapRenderer( QgsRenderContext &rendererContext )
{
return new QgsPointCloudRenderer( this, rendererContext );
return new QgsPointCloudLayerRenderer( this, rendererContext );
}

QgsPointCloudDataProvider *QgsPointCloudLayer::dataProvider()
@@ -18,7 +18,7 @@
#ifndef QGSPOINTCLOUDLAYER_H
#define QGSPOINTCLOUDLAYER_H

class QgsPointCloudRenderer;
class QgsPointCloudLayerRenderer;

#include "qgspointclouddataprovider.h"
#include "qgsmaplayer.h"
@@ -121,7 +121,7 @@ class CORE_EXPORT QgsPointCloudLayer : public QgsMapLayer
std::unique_ptr<QgsPointCloudDataProvider> mDataProvider;

//! Renderer assigned to the layer to draw map
std::unique_ptr<QgsPointCloudRenderer> mRenderer;
std::unique_ptr<QgsPointCloudLayerRenderer> mRenderer;
};


@@ -86,7 +86,7 @@ void QgsPointCloudRendererConfig::setColorRamp( const QgsColorRamp *value )

///@endcond

QgsPointCloudRenderer::QgsPointCloudRenderer( QgsPointCloudLayer *layer, QgsRenderContext &context )
QgsPointCloudLayerRenderer::QgsPointCloudLayerRenderer( QgsPointCloudLayer *layer, QgsRenderContext &context )
: QgsMapLayerRenderer( layer->id(), &context )
, mLayer( layer )
{
@@ -109,7 +109,7 @@ static QList<IndexedPointCloudNode> _traverseTree( QgsPointCloudIndex *pc, const
return pc->traverseTree( extent, n, maxDepth );
}

bool QgsPointCloudRenderer::render()
bool QgsPointCloudLayerRenderer::render()
{
// TODO cache!?
QgsPointCloudIndex *pc = mLayer->dataProvider()->index();
@@ -153,19 +153,7 @@ bool QgsPointCloudRenderer::render()
QgsPointCloudRenderer::~QgsPointCloudRenderer() = default;


void QgsPointCloudRenderer::writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const
{
Q_UNUSED( elem )
Q_UNUSED( context )
}

void QgsPointCloudRenderer::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
{
Q_UNUSED( elem )
Q_UNUSED( context )
}

void QgsPointCloudRenderer::drawData( QPainter *painter, const QVector<qint32> &data, const QgsPointCloudRendererConfig &config )
void QgsPointCloudLayerRenderer::drawData( QPainter *painter, const QVector<qint32> &data, const QgsPointCloudRendererConfig &config )
{
const QgsMapToPixel mapToPixel = renderContext()->mapToPixel();
const QgsVector3D scale = mLayer->dataProvider()->index()->scale();
@@ -75,12 +75,12 @@ class CORE_EXPORT QgsPointCloudRendererConfig
*
* \since QGIS 3.18
*/
class CORE_EXPORT QgsPointCloudRenderer: public QgsMapLayerRenderer
class CORE_EXPORT QgsPointCloudLayerRenderer: public QgsMapLayerRenderer
{
public:

explicit QgsPointCloudRenderer( QgsPointCloudLayer *layer, QgsRenderContext &context );
~QgsPointCloudRenderer();
explicit QgsPointCloudLayerRenderer( QgsPointCloudLayer *layer, QgsRenderContext &context );
~QgsPointCloudLayerRenderer();

bool render() override;

0 comments on commit 4e94abc

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