QGIS API Documentation 3.99.0-Master (a8f284845db)
Loading...
Searching...
No Matches
qgspointcloudlayerelevationproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudlayerelevationproperties.h
3 ---------------
4 begin : November 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall dot dawson 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
19#ifndef QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
20#define QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
21
22#include "qgis.h"
23#include "qgis_core.h"
24#include "qgis_sip.h"
25#include "qgsfillsymbol.h"
26#include "qgslinesymbol.h"
28
37{
38
39 Q_OBJECT
40
41 public:
42
47
48 bool hasElevation() const override;
49 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
50 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
52 QString htmlSummary() const override;
53 bool isVisibleInZRange( const QgsDoubleRange &range, QgsMapLayer *layer = nullptr ) const override;
54 QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
55 QList< double > significantZValues( QgsMapLayer *layer ) const override;
56 bool showByDefaultInElevationProfilePlots() const override;
57
70 double maximumScreenError() const { return mMaximumScreenError; }
71
84 void setMaximumScreenError( double error );
85
94 Qgis::RenderUnit maximumScreenErrorUnit() const { return mMaximumScreenErrorUnit; }
95
104 void setMaximumScreenErrorUnit( Qgis::RenderUnit unit );
105
112 Qgis::PointCloudSymbol pointSymbol() const;
113
120 void setPointSymbol( Qgis::PointCloudSymbol symbol );
121
128 QColor pointColor() const { return mPointColor; }
129
136 void setPointColor( const QColor &color );
137
145 bool applyOpacityByDistanceEffect() const { return mApplyOpacityByDistanceEffect; }
146
154 void setApplyOpacityByDistanceEffect( bool apply );
155
165 void setPointSize( double size );
166
177 double pointSize() const { return mPointSize; }
178
187 void setPointSizeUnit( const Qgis::RenderUnit units );
188
196 Qgis::RenderUnit pointSizeUnit() const { return mPointSizeUnit; }
197
203 bool respectLayerColors() const { return mRespectLayerColors; }
204
210 void setRespectLayerColors( bool enabled );
211
219
226 Qgis::PointCloudProfileType type() const { return mType; }
227
236 QgsLineSymbol *profileLineSymbol() const;
237
248 void setProfileLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
249
258 QgsFillSymbol *profileFillSymbol() const;
259
270 void setProfileFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
271
280 Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
281
290 void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
291
304 double elevationLimit() const;
305
318 void setElevationLimit( double limit );
319
320 private:
321 void setDefaultProfileLineSymbol( const QColor &color );
322 void setDefaultProfileFillSymbol( const QColor &color );
323
324 double mMaximumScreenError = 0.3;
325 Qgis::RenderUnit mMaximumScreenErrorUnit = Qgis::RenderUnit::Millimeters;
326
327 double mPointSize = 0.6;
330 std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
331 std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
333 double mElevationLimit = std::numeric_limits<double>::quiet_NaN();
334 QColor mPointColor;
335 bool mRespectLayerColors = true;
336 bool mApplyOpacityByDistanceEffect = false;
338};
339
340#endif // QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
PointCloudSymbol
Rendering symbols for point cloud points.
Definition qgis.h:4355
@ Square
Renders points as squares.
Definition qgis.h:4356
PointCloudProfileType
Types of elevation profiles to generate for point cloud sources.
Definition qgis.h:4315
@ IndividualPoints
Sample individual points from the point cloud.
Definition qgis.h:4316
RenderUnit
Rendering size units.
Definition qgis.h:5305
@ Millimeters
Millimeters.
Definition qgis.h:5306
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition qgis.h:4290
@ Line
The elevation surface will be rendered using a line symbol.
Definition qgis.h:4291
QgsRange which stores a range of double values.
Definition qgsrange.h:236
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
virtual QList< double > significantZValues(QgsMapLayer *layer) const
Returns a list of significant elevation/z-values for the specified layer, using the settings defined ...
virtual bool isVisibleInZRange(const QgsDoubleRange &range, QgsMapLayer *layer=nullptr) const
Returns true if the layer should be visible and rendered for the specified z range.
virtual QgsMapLayerElevationProperties * clone() const =0
Creates a clone of the properties.
QgsMapLayerElevationProperties(QObject *parent)
Constructor for QgsMapLayerElevationProperties, with the specified parent object.
virtual QString htmlSummary() const
Returns a HTML formatted summary of the properties.
virtual bool showByDefaultInElevationProfilePlots() const
Returns true if the layer should be visible by default in newly created elevation profile plots.
virtual QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
Writes the properties to a DOM element, to be used later with readXml().
virtual QgsDoubleRange calculateZRange(QgsMapLayer *layer) const
Attempts to calculate the overall elevation or z range for the specified layer, using the settings de...
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the elevation properties from a DOM element previously written by writeXml().
virtual bool hasElevation() const
Returns true if the layer has an elevation or z component.
Base class for all map layer types.
Definition qgsmaplayer.h:83
bool respectLayerColors() const
Returns true if layer coloring should be respected when rendering elevation profile plots.
QColor pointColor() const
Returns the color used drawing points in elevation profile charts.
double pointSize() const
Returns the point size used for drawing points in elevation profile charts.
Qgis::RenderUnit maximumScreenErrorUnit() const
Returns the unit for the maximum screen error allowed when generating elevation profiles for the poin...
void setType(Qgis::PointCloudProfileType type)
Sets the profile type used when generating elevation profile plots.
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the point cloud profile in elevation profile plots.
Qgis::PointCloudProfileType type() const
Returns the profile type used when generating elevation profile plots.
Qgis::RenderUnit pointSizeUnit() const
Returns the units used for the point size used for drawing points in elevation profile charts.
bool applyOpacityByDistanceEffect() const
Returns true if a reduced opacity by distance from profile curve effect should be applied when drawin...
double maximumScreenError() const
Returns the maximum screen error allowed when generating elevation profiles for the point cloud.
QgsPointCloudLayerElevationProperties(QObject *parent)
Constructor for QgsPointCloudLayerElevationProperties, with the specified parent object.
A container for the context for various read/write operations on objects.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_FACTORY
Definition qgis_sip.h:83