QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
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 <optional>
22
23#include "qgis_core.h"
24#include "qgsgeometry.h"
26#include "qgsmaplayerrenderer.h"
27#include "qgspointcloudindex.h"
28
29#include <QDomElement>
30#include <QElapsedTimer>
31#include <QPainter>
32#include <QString>
33
34#define SIP_NO_FILE
35
40class QgsPointCloudSubIndex;
42
43
55{
56 public:
60
61 bool render() override;
62 Qgis::MapLayerRendererFlags flags() const override;
63 bool forceRasterRender() const override;
64 void setLayerRenderingTimeHint( int time ) override;
65
66 QgsFeedback *feedback() const override { return mFeedback.get(); }
67
68 private:
69 QVector<QgsPointCloudNodeId> traverseTree( const QgsPointCloudIndex &pc, const QgsRenderContext &context, QgsPointCloudNodeId n, double maxErrorPixels, double nodeErrorPixels );
70 int renderNodesSync( const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
71 int renderNodesAsync( const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
72 int renderNodesSorted(
73 const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled, Qgis::PointCloudDrawOrder order
74 );
75 void renderTriangulatedSurface( QgsPointCloudRenderContext &context );
76 bool renderIndex( QgsPointCloudIndex &pc );
77
78 QgsPointCloudIndex mIndex;
79 QString mLayerName;
80
81 std::unique_ptr< QgsPointCloudRenderer > mRenderer;
82 std::unique_ptr< QgsPointCloudExtentRenderer > mSubIndexExtentRenderer;
83
84 QgsVector3D mScale;
85 QgsVector3D mOffset;
86 double mZOffset = 0;
87 double mZScale = 1.0;
88
89 QgsPointCloudAttributeCollection mLayerAttributes;
91 QgsGeometry mCloudExtent;
92 QList< QgsMapClippingRegion > mClippingRegions;
93
94 bool mIsVpc = false;
95 const QVector< QgsPointCloudSubIndex > mSubIndexes;
96 std::optional<QgsPointCloudIndex> mOverviewIndex;
97 double mAverageSubIndexWidth = 0;
98 double mAverageSubIndexHeight = 0;
99
100 int mRenderTimeHint = 0;
101 bool mBlockRenderUpdates = false;
102 QElapsedTimer mElapsedTimer;
103
104 std::unique_ptr<QgsFeedback> mFeedback = nullptr;
105
106 bool mEnableProfile = false;
107 quint64 mPreparationTime = 0;
108};
109
110#endif // QGSPOINTCLOUDLAYERRENDERER_H
QFlags< MapLayerRendererFlag > MapLayerRendererFlags
Flags which control how map layer renderers behave.
Definition qgis.h:2893
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition qgis.h:4399
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.
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.
QgsMapLayerRenderer(const QString &layerID, QgsRenderContext *context=nullptr)
Constructor for QgsMapLayerRenderer, with the associated layerID and render context.
virtual void setLayerRenderingTimeHint(int time)
Sets approximate render time (in ms) for the layer to render.
A collection of point cloud attributes.
A renderer for 2d visualisation of point clouds which shows the dataset's extents using a fill symbol...
Smart pointer for QgsAbstractPointCloudIndex.
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr).
~QgsPointCloudLayerRenderer() override
QgsPointCloudLayerRenderer(QgsPointCloudLayer *layer, QgsRenderContext &context)
Ctor.
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:33