QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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 Q_OBJECT
39
40 public:
45
46 bool hasElevation() const override;
47 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
48 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
50 QString htmlSummary() const override;
51 bool isVisibleInZRange( const QgsDoubleRange &range, QgsMapLayer *layer = nullptr ) const override;
52 QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
53 QList< double > significantZValues( QgsMapLayer *layer ) const override;
54 bool showByDefaultInElevationProfilePlots() const override;
55
68 double maximumScreenError() const { return mMaximumScreenError; }
69
82 void setMaximumScreenError( double error );
83
92 Qgis::RenderUnit maximumScreenErrorUnit() const { return mMaximumScreenErrorUnit; }
93
102 void setMaximumScreenErrorUnit( Qgis::RenderUnit unit );
103
110 Qgis::PointCloudSymbol pointSymbol() const;
111
118 void setPointSymbol( Qgis::PointCloudSymbol symbol );
119
126 QColor pointColor() const { return mPointColor; }
127
134 void setPointColor( const QColor &color );
135
143 bool applyOpacityByDistanceEffect() const { return mApplyOpacityByDistanceEffect; }
144
152 void setApplyOpacityByDistanceEffect( bool apply );
153
163 void setPointSize( double size );
164
175 double pointSize() const { return mPointSize; }
176
185 void setPointSizeUnit( const Qgis::RenderUnit units );
186
194 Qgis::RenderUnit pointSizeUnit() const { return mPointSizeUnit; }
195
201 bool respectLayerColors() const { return mRespectLayerColors; }
202
208 void setRespectLayerColors( bool enabled );
209
217
224 Qgis::PointCloudProfileType type() const { return mType; }
225
234 QgsLineSymbol *profileLineSymbol() const;
235
246 void setProfileLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
247
256 QgsFillSymbol *profileFillSymbol() const;
257
268 void setProfileFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
269
278 Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
279
288 void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
289
302 double elevationLimit() const;
303
316 void setElevationLimit( double limit );
317
318 private:
319 void setDefaultProfileLineSymbol( const QColor &color );
320 void setDefaultProfileFillSymbol( const QColor &color );
321
322 double mMaximumScreenError = 0.3;
323 Qgis::RenderUnit mMaximumScreenErrorUnit = Qgis::RenderUnit::Millimeters;
324
325 double mPointSize = 0.6;
328 std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
329 std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
331 double mElevationLimit = std::numeric_limits<double>::quiet_NaN();
332 QColor mPointColor;
333 bool mRespectLayerColors = true;
334 bool mApplyOpacityByDistanceEffect = false;
336};
337
338#endif // QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
PointCloudSymbol
Rendering symbols for point cloud points.
Definition qgis.h:4387
@ Square
Renders points as squares.
Definition qgis.h:4388
PointCloudProfileType
Types of elevation profiles to generate for point cloud sources.
Definition qgis.h:4347
@ IndividualPoints
Sample individual points from the point cloud.
Definition qgis.h:4348
RenderUnit
Rendering size units.
Definition qgis.h:5340
@ Millimeters
Millimeters.
Definition qgis.h:5341
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition qgis.h:4322
@ Line
The elevation surface will be rendered using a line symbol.
Definition qgis.h:4323
QgsRange which stores a range of double values.
Definition qgsrange.h:217
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