API shell for QgsPointCloudRenderer 2d point cloud renderer

This commit is contained in:
Nyall Dawson 2020-11-12 14:30:06 +10:00
parent 8bb7edbbc6
commit abbd634b44
3 changed files with 171 additions and 0 deletions

View File

@ -9,6 +9,79 @@
class QgsPointCloudRenderContext
{
%Docstring
Encapsulates the render context for a 2D point cloud rendering operation.
.. versionadded:: 3.18
%End
%TypeHeaderCode
#include "qgspointcloudrenderer.h"
%End
public:
QgsPointCloudRenderContext( QgsRenderContext &context );
%Docstring
Constructor for QgsPointCloudRenderContext.
%End
QgsRenderContext &renderContext();
%Docstring
Returns a reference to the context's render context.
%End
private:
QgsPointCloudRenderContext( const QgsPointCloudRenderContext &rh );
};
class QgsPointCloudRenderer
{
%Docstring
Abstract base class for 2d point cloud renderers.
.. versionadded:: 3.18
%End
%TypeHeaderCode
#include "qgspointcloudrenderer.h"
%End
public:
static QgsPointCloudRenderer *defaultRenderer() /Factory/;
%Docstring
Returns a new default point cloud renderer.
Caller takes ownership of the returned renderer.
%End
virtual ~QgsPointCloudRenderer();
virtual QgsPointCloudRenderer *clone() const = 0 /Factory/;
%Docstring
Create a deep copy of this renderer. Should be implemented by all subclasses
and generate a proper subclass.
%End
virtual void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) = 0;
%Docstring
Renders a ``block`` of point cloud data using the specified render ``context``.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *

View File

@ -16,3 +16,14 @@
***************************************************************************/
#include "qgspointcloudrenderer.h"
QgsPointCloudRenderContext::QgsPointCloudRenderContext( QgsRenderContext &context )
: mRenderContext( context )
{
}
QgsPointCloudRenderer *QgsPointCloudRenderer::defaultRenderer()
{
}

View File

@ -18,5 +18,92 @@
#ifndef QGSPOINTCLOUDRENDERER_H
#define QGSPOINTCLOUDRENDERER_H
#include "qgsrendercontext.h"
#include "qgis_core.h"
#include "qgis_sip.h"
class QgsPointCloudBlock;
/**
* \ingroup core
* \class QgsPointCloudRenderContext
*
* Encapsulates the render context for a 2D point cloud rendering operation.
*
* \since QGIS 3.18
*/
class CORE_EXPORT QgsPointCloudRenderContext
{
public:
/**
* Constructor for QgsPointCloudRenderContext.
*/
QgsPointCloudRenderContext( QgsRenderContext &context );
//! QgsPointCloudRenderContext cannot be copied.
QgsPointCloudRenderContext( const QgsPointCloudRenderContext &rh ) = delete;
//! QgsPointCloudRenderContext cannot be copied.
QgsPointCloudRenderContext &operator=( const QgsPointCloudRenderContext & ) = delete;
/**
* Returns a reference to the context's render context.
*/
QgsRenderContext &renderContext() { return mRenderContext; }
/**
* Returns a reference to the context's render context.
* \note Not available in Python bindings.
*/
const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
private:
#ifdef SIP_RUN
QgsPointCloudRenderContext( const QgsPointCloudRenderContext &rh );
#endif
QgsRenderContext &mRenderContext;
};
/**
* \ingroup core
* \class QgsPointCloudRenderer
*
* Abstract base class for 2d point cloud renderers.
*
* \since QGIS 3.18
*/
class CORE_EXPORT QgsPointCloudRenderer
{
public:
/**
* Returns a new default point cloud renderer.
*
* Caller takes ownership of the returned renderer.
*/
static QgsPointCloudRenderer *defaultRenderer() SIP_FACTORY;
virtual ~QgsPointCloudRenderer() = default;
/**
* Create a deep copy of this renderer. Should be implemented by all subclasses
* and generate a proper subclass.
*/
virtual QgsPointCloudRenderer *clone() const = 0 SIP_FACTORY;
/**
* Renders a \a block of point cloud data using the specified render \a context.
*/
virtual void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) = 0;
};
#endif // QGSPOINTCLOUDRENDERER_H