Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pointclouds] Add a classified 2d renderer for point clouds
Allows styling point cloud layers by a classification attribute
- Loading branch information
1 parent
b3255c4
commit 6664794
Showing
19 changed files
with
1,801 additions
and
0 deletions.
There are no files selected for viewing
198 changes: 198 additions & 0 deletions
198
python/core/auto_generated/pointcloud/qgspointcloudclassifiedrenderer.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/pointcloud/qgspointcloudclassifiedrenderer.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
class QgsPointCloudCategory | ||
{ | ||
%Docstring | ||
Represents an individual category (class) from a QgsPointCloudClassifiedRenderer. | ||
|
||
.. versionadded:: 3.18 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgspointcloudclassifiedrenderer.h" | ||
%End | ||
public: | ||
|
||
QgsPointCloudCategory(); | ||
%Docstring | ||
Constructor for QgsPointCloudCategory. | ||
%End | ||
|
||
QgsPointCloudCategory( int value, const QColor &color, const QString &label, bool render = true ); | ||
%Docstring | ||
Constructor for a new QgsPointCloudCategory, with the specified ``value`` and ``color``. | ||
|
||
The ``label`` argument specifies the label used for this category in legends and the layer tree. | ||
|
||
The ``render`` argument indicates whether the category should initially be rendered and appear checked in the layer tree. | ||
%End | ||
|
||
int value() const; | ||
%Docstring | ||
Returns the value corresponding to this category. | ||
|
||
.. seealso:: :py:func:`setValue` | ||
%End | ||
|
||
QColor color() const; | ||
%Docstring | ||
Returns the color which will be used to render this category. | ||
|
||
.. seealso:: :py:func:`setColor` | ||
%End | ||
|
||
QString label() const; | ||
%Docstring | ||
Returns the label for this category, which is used to represent the category within | ||
legends and the layer tree. | ||
|
||
.. seealso:: :py:func:`setLabel` | ||
%End | ||
|
||
void setValue( int value ); | ||
%Docstring | ||
Sets the ``value`` corresponding to this category. | ||
|
||
.. seealso:: :py:func:`value` | ||
%End | ||
|
||
void setColor( const QColor &color ); | ||
%Docstring | ||
Sets the ``color`` which will be used to render this category. | ||
|
||
.. seealso:: :py:func:`color` | ||
%End | ||
|
||
void setLabel( const QString &label ); | ||
%Docstring | ||
Sets the ``label`` for this category, which is used to represent the category within | ||
legends and the layer tree. | ||
|
||
.. seealso:: :py:func:`label` | ||
%End | ||
|
||
bool renderState() const; | ||
%Docstring | ||
Returns ``True`` if the category is currently enabled and should be rendered. | ||
|
||
.. seealso:: :py:func:`setRenderState` | ||
%End | ||
|
||
void setRenderState( bool render ); | ||
%Docstring | ||
Sets whether the category is currently enabled and should be rendered. | ||
|
||
.. seealso:: :py:func:`renderState` | ||
%End | ||
|
||
protected: | ||
}; | ||
|
||
typedef QList<QgsPointCloudCategory> QgsPointCloudCategoryList; | ||
|
||
|
||
class QgsPointCloudClassifiedRenderer : QgsPointCloudRenderer | ||
{ | ||
%Docstring | ||
Renders point clouds by a classification attribute. | ||
|
||
.. versionadded:: 3.18 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgspointcloudclassifiedrenderer.h" | ||
%End | ||
public: | ||
|
||
QgsPointCloudClassifiedRenderer(); | ||
%Docstring | ||
Constructor for QgsPointCloudClassifiedRenderer. | ||
%End | ||
|
||
virtual QString type() const; | ||
|
||
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; | ||
|
||
virtual QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/; | ||
|
||
virtual QStringList legendRuleKeys() const; | ||
|
||
virtual bool legendItemChecked( const QString &key ); | ||
|
||
virtual void checkLegendItem( const QString &key, bool state = true ); | ||
|
||
|
||
static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) /Factory/; | ||
%Docstring | ||
Creates an RGB renderer from an XML ``element``. | ||
%End | ||
|
||
static QgsPointCloudCategoryList defaultCategories(); | ||
%Docstring | ||
Returns the default list of categories. | ||
%End | ||
|
||
QString attribute() const; | ||
%Docstring | ||
Returns the attribute to use for the renderer. | ||
|
||
.. seealso:: :py:func:`setAttribute` | ||
%End | ||
|
||
void setAttribute( const QString &attribute ); | ||
%Docstring | ||
Sets the ``attribute`` to use for the renderer. | ||
|
||
.. seealso:: :py:func:`attribute` | ||
%End | ||
|
||
QgsPointCloudCategoryList categories() const; | ||
%Docstring | ||
Returns the classification categories used for rendering. | ||
|
||
.. seealso:: :py:func:`setCategories` | ||
%End | ||
|
||
void setCategories( const QgsPointCloudCategoryList &categories ); | ||
%Docstring | ||
Sets the classification ``categories`` used for rendering. | ||
|
||
.. seealso:: :py:func:`categories` | ||
%End | ||
|
||
void addCategory( const QgsPointCloudCategory &category ); | ||
%Docstring | ||
Adds a ``category`` to the renderer. | ||
|
||
.. seealso:: :py:func:`categories` | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/pointcloud/qgspointcloudclassifiedrenderer.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.