QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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"
31 #include "qgspointcloudrenderer.h"
32 #include "qgsmapclippingregion.h"
33 #include "qgsrasterinterface.h"
34 
35 #include <QDomElement>
36 #include <QString>
37 #include <QPainter>
38 #include <QElapsedTimer>
39 
40 class QgsRenderContext;
41 class QgsPointCloudLayer;
44 
45 #define SIP_NO_FILE
46 
48 
60 {
61  public:
62 
66 
67  bool render() override;
68  bool forceRasterRender() const override;
69  void setLayerRenderingTimeHint( int time ) override;
70 
71  QgsFeedback *feedback() const override { return mFeedback.get(); }
72 
73  private:
74  QVector<IndexedPointCloudNode> traverseTree( const QgsPointCloudIndex *pc, const QgsRenderContext &context, IndexedPointCloudNode n, double maxErrorPixels, double nodeErrorPixels );
75  int renderNodesSync( const QVector<IndexedPointCloudNode> &nodes, QgsPointCloudIndex *pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
76  int renderNodesAsync( const QVector<IndexedPointCloudNode> &nodes, QgsPointCloudIndex *pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
77  int renderNodesSorted( const QVector<IndexedPointCloudNode> &nodes, QgsPointCloudIndex *pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled, Qgis::PointCloudDrawOrder order );
78 
79  QgsPointCloudLayer *mLayer = nullptr;
80 
81  std::unique_ptr< QgsPointCloudRenderer > mRenderer;
82 
83  QgsVector3D mScale;
84  QgsVector3D mOffset;
85  double mZOffset = 0;
86  double mZScale = 1.0;
87 
88  QgsPointCloudAttributeCollection mLayerAttributes;
90  QgsGeometry mCloudExtent;
91  QList< QgsMapClippingRegion > mClippingRegions;
92 
93  int mRenderTimeHint = 0;
94  bool mBlockRenderUpdates = false;
95  QElapsedTimer mElapsedTimer;
96 
97  std::unique_ptr<QgsFeedback> mFeedback = nullptr;
98 };
99 
100 #endif // QGSPOINTCLOUDLAYERRENDERER_H
QgsPointCloudLayerRenderer::feedback
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Definition: qgspointcloudlayerrenderer.h:71
QgsPointCloudLayer
Represents a map layer supporting display of point clouds.
Definition: qgspointcloudlayer.h:45
QgsVector3D
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
Definition: qgsvector3d.h:31
qgsreadwritecontext.h
qgsidentifycontext.h
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:59
QgsMapLayerRenderer
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Definition: qgsmaplayerrenderer.h:54
QgsPointCloudRequest
Point cloud data request.
Definition: qgspointcloudrequest.h:39
IndexedPointCloudNode
Represents a indexed point cloud node in octree.
Definition: qgspointcloudindex.h:57
qgsrasterinterface.h
qgserror.h
QgsPointCloudRenderContext
Encapsulates the render context for a 2D point cloud rendering operation.
Definition: qgspointcloudrenderer.h:41
qgscolorramp.h
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:44
QgsPointCloudAttributeCollection
Collection of point cloud attributes.
Definition: qgspointcloudattribute.h:141
qgsmaplayerrenderer.h
Qgis::PointCloudDrawOrder
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition: qgis.h:1900
qgspointcloudindex.h
qgsgeometry.h
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsPointCloudRenderer
Abstract base class for 2d point cloud renderers.
Definition: qgspointcloudrenderer.h:296
QgsMapLayerRenderer::setLayerRenderingTimeHint
virtual void setLayerRenderingTimeHint(int time)
Sets approximate render time (in ms) for the layer to render.
Definition: qgsmaplayerrenderer.h:139
QgsMapLayerRenderer::render
virtual bool render()=0
Do the rendering (based on data stored in the class).
QgsMapLayerRenderer::forceRasterRender
virtual bool forceRasterRender() const
Returns true if the renderer must be rendered to a raster paint device (e.g.
Definition: qgsmaplayerrenderer.h:92
QgsPointCloudIndex
Represents a indexed point clouds data in octree.
Definition: qgspointcloudindex.h:163
qgspointcloudrenderer.h
QgsPointCloudLayerRenderer
Implementation of threaded rendering for point cloud layers.
Definition: qgspointcloudlayerrenderer.h:59
qgsmapclippingregion.h