QGIS API Documentation 3.43.0-Master (b60ef06885e)
qgspointcloudlayerrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudlayerrenderer.h
3 --------------------
4 begin : October 2020
5 copyright : (C) 2020 by Peter Petrik
6 email : zilolv at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPOINTCLOUDLAYERRENDERER_H
19#define QGSPOINTCLOUDLAYERRENDERER_H
20
21#include "qgis_core.h"
22#include "qgscolorramp.h"
23#include "qgsmaplayerrenderer.h"
24#include "qgsreadwritecontext.h"
25#include "qgspointcloudindex.h"
26#include "qgsgeometry.h"
27
28#include "qgserror.h"
29#include "qgspointcloudindex.h"
30#include "qgsidentifycontext.h"
34#include "qgsrasterinterface.h"
35
36#include <QDomElement>
37#include <QString>
38#include <QPainter>
39#include <QElapsedTimer>
40#include <optional>
41
46class QgsPointCloudSubIndex;
47
48#define SIP_NO_FILE
49
61{
62 public:
63
67
68 bool render() override;
69 Qgis::MapLayerRendererFlags flags() const override;
70 bool forceRasterRender() const override;
71 void setLayerRenderingTimeHint( int time ) override;
72
73 QgsFeedback *feedback() const override { return mFeedback.get(); }
74
75 private:
76 QVector<QgsPointCloudNodeId> traverseTree( const QgsPointCloudIndex &pc, const QgsRenderContext &context, QgsPointCloudNodeId n, double maxErrorPixels, double nodeErrorPixels );
77 int renderNodesSync( const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
78 int renderNodesAsync( const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
79 int renderNodesSorted( const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled, Qgis::PointCloudDrawOrder order );
80 void renderTriangulatedSurface( QgsPointCloudRenderContext &context );
81 bool renderIndex( QgsPointCloudIndex &pc );
82
83 QgsPointCloudIndex mIndex;
84 QString mLayerName;
85
86 std::unique_ptr< QgsPointCloudRenderer > mRenderer;
87 std::unique_ptr< QgsPointCloudExtentRenderer > mSubIndexExtentRenderer;
88
89 QgsVector3D mScale;
90 QgsVector3D mOffset;
91 double mZOffset = 0;
92 double mZScale = 1.0;
93
94 QgsPointCloudAttributeCollection mLayerAttributes;
96 QgsGeometry mCloudExtent;
97 QList< QgsMapClippingRegion > mClippingRegions;
98
99 const QVector< QgsPointCloudSubIndex > mSubIndexes;
100 std::optional<QgsPointCloudIndex> mOverviewIndex;
101 double mAverageSubIndexWidth = 0;
102 double mAverageSubIndexHeight = 0;
103
104 int mRenderTimeHint = 0;
105 bool mBlockRenderUpdates = false;
106 QElapsedTimer mElapsedTimer;
107
108 std::unique_ptr<QgsFeedback> mFeedback = nullptr;
109
110 bool mEnableProfile = false;
111 quint64 mPreparationTime = 0;
112};
113
114#endif // QGSPOINTCLOUDLAYERRENDERER_H
QFlags< MapLayerRendererFlag > MapLayerRendererFlags
Flags which control how map layer renderers behave.
Definition qgis.h:2730
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition qgis.h:4109
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
A geometry is the spatial representation of a feature.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
virtual bool render()=0
Do the rendering (based on data stored in the class).
virtual bool forceRasterRender() const
Returns true if the renderer must be rendered to a raster paint device (e.g.
virtual Qgis::MapLayerRendererFlags flags() const
Returns flags which control how the map layer rendering behaves.
virtual void setLayerRenderingTimeHint(int time)
Sets approximate render time (in ms) for the layer to render.
A collection of point cloud attributes.
Smart pointer for QgsAbstractPointCloudIndex.
Implementation of threaded rendering for point cloud layers.
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Represents a map layer supporting display of point clouds.
Represents an indexed point cloud node's position in octree.
Encapsulates the render context for a 2D point cloud rendering operation.
Abstract base class for 2d point cloud renderers.
Point cloud data request.
Contains information about the context of a rendering operation.
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition qgsvector3d.h:30