QGIS API Documentation 4.3.0-Master (0cfde48c85b)
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#include "qgsrange.h"
29
30#include <QDomElement>
31#include <QElapsedTimer>
32#include <QPainter>
33#include <QString>
34
35#define SIP_NO_FILE
36
41class QgsPointCloudSubIndex;
43
44
56{
57 public:
61
62 bool render() override;
63 Qgis::MapLayerRendererFlags flags() const override;
64 bool forceRasterRender() const override;
65 void setLayerRenderingTimeHint( int time ) override;
66
67 QgsFeedback *feedback() const override { return mFeedback.get(); }
68
69 private:
70 QVector<QgsPointCloudNodeId> traverseTree( const QgsPointCloudIndex &pc, const QgsRenderContext &context, QgsPointCloudNodeId n, double maxErrorPixels, double nodeErrorPixels );
71 int renderNodesSync( const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
72 int renderNodesAsync( const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled );
73 int renderNodesSorted(
74 const QVector<QgsPointCloudNodeId> &nodes, QgsPointCloudIndex &pc, QgsPointCloudRenderContext &context, QgsPointCloudRequest &request, bool &canceled, Qgis::PointCloudDrawOrder order
75 );
76 void renderTriangulatedSurface( QgsPointCloudRenderContext &context );
77 bool renderIndex( QgsPointCloudIndex &pc );
78
79 QgsPointCloudIndex mIndex;
80 QString mLayerName;
81
82 std::unique_ptr< QgsPointCloudRenderer > mRenderer;
83 std::unique_ptr< QgsPointCloudExtentRenderer > mSubIndexExtentRenderer;
84
85 QgsVector3D mScale;
86 QgsVector3D mOffset;
87 double mZOffset = 0;
88 double mZScale = 1.0;
89
90 QgsDoubleRange mMapCrsZFilter;
91
92 QgsPointCloudAttributeCollection mLayerAttributes;
94 QgsGeometry mCloudExtent;
95 QList< QgsMapClippingRegion > mClippingRegions;
96
97 bool mIsVpc = false;
98 const QVector< QgsPointCloudSubIndex > mSubIndexes;
99 QVector<QgsPointCloudIndex> mOverviewIndexes;
100 double mAverageSubIndexWidth = 0;
101 double mAverageSubIndexHeight = 0;
102
103 int mRenderTimeHint = 0;
104 bool mBlockRenderUpdates = false;
105 QElapsedTimer mElapsedTimer;
106
107 std::unique_ptr<QgsFeedback> mFeedback = nullptr;
108
109 bool mEnableProfile = false;
110 quint64 mPreparationTime = 0;
111};
112
113#endif // QGSPOINTCLOUDLAYERRENDERER_H
QFlags< MapLayerRendererFlag > MapLayerRendererFlags
Flags which control how map layer renderers behave.
Definition qgis.h:3013
PointCloudDrawOrder
Pointcloud rendering order for 2d views.
Definition qgis.h:4727
QgsRange which stores a range of double values.
Definition qgsrange.h:217
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