QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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_core.h"
23 #include "qgis_sip.h"
25 
34 {
35 
36  Q_OBJECT
37 
38  public:
39 
44 
45  bool hasElevation() const override;
46  QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
47  bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
49  QString htmlSummary() const override;
50  bool isVisibleInZRange( const QgsDoubleRange &range ) const override;
51  QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
52  bool showByDefaultInElevationProfilePlots() const override;
53 
66  double maximumScreenError() const { return mMaximumScreenError; }
67 
80  void setMaximumScreenError( double error );
81 
90  QgsUnitTypes::RenderUnit maximumScreenErrorUnit() const { return mMaximumScreenErrorUnit; }
91 
100  void setMaximumScreenErrorUnit( QgsUnitTypes::RenderUnit unit );
101 
108  Qgis::PointCloudSymbol pointSymbol() const;
109 
116  void setPointSymbol( Qgis::PointCloudSymbol symbol );
117 
124  QColor pointColor() const { return mPointColor; }
125 
132  void setPointColor( const QColor &color );
133 
141  bool applyOpacityByDistanceEffect() const { return mApplyOpacityByDistanceEffect; }
142 
150  void setApplyOpacityByDistanceEffect( bool apply );
151 
161  void setPointSize( double size );
162 
173  double pointSize() const { return mPointSize; }
174 
183  void setPointSizeUnit( const QgsUnitTypes::RenderUnit units );
184 
192  QgsUnitTypes::RenderUnit pointSizeUnit() const { return mPointSizeUnit; }
193 
199  bool respectLayerColors() const { return mRespectLayerColors; }
200 
206  void setRespectLayerColors( bool enabled );
207 
208  private:
209 
210  double mMaximumScreenError = 0.3;
212 
213  double mPointSize = 0.6;
216  QColor mPointColor;
217  bool mRespectLayerColors = true;
218  bool mApplyOpacityByDistanceEffect = false;
219 };
220 
221 #endif // QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
QgsMapLayerElevationProperties::clone
virtual QgsMapLayerElevationProperties * clone() const =0
Creates a clone of the properties.
QgsMapLayerElevationProperties::readXml
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the elevation properties from a DOM element previously written by writeXml().
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsMapLayerElevationProperties
Base class for storage of map layer elevation properties.
Definition: qgsmaplayerelevationproperties.h:41
QgsPointCloudLayerElevationProperties::pointSizeUnit
QgsUnitTypes::RenderUnit pointSizeUnit() const
Returns the units used for the point size used for drawing points in elevation profile charts.
Definition: qgspointcloudlayerelevationproperties.h:192
QgsPointCloudLayerElevationProperties
Point cloud layer specific subclass of QgsMapLayerElevationProperties.
Definition: qgspointcloudlayerelevationproperties.h:33
QgsPointCloudLayerElevationProperties::pointSize
double pointSize() const
Returns the point size used for drawing points in elevation profile charts.
Definition: qgspointcloudlayerelevationproperties.h:173
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:169
QgsMapLayerElevationProperties::writeXml
virtual QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
Writes the properties to a DOM element, to be used later with readXml().
QgsMapLayerElevationProperties::isVisibleInZRange
virtual bool isVisibleInZRange(const QgsDoubleRange &range) const
Returns true if the layer should be visible and rendered for the specified z range.
Definition: qgsmaplayerelevationproperties.cpp:71
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsMapLayerElevationProperties::calculateZRange
virtual QgsDoubleRange calculateZRange(QgsMapLayer *layer) const
Attempts to calculate the overall elevation or z range for the specified layer, using the settings de...
Definition: qgsmaplayerelevationproperties.cpp:76
QgsMapLayerElevationProperties::hasElevation
virtual bool hasElevation() const
Returns true if the layer has an elevation or z component.
Definition: qgsmaplayerelevationproperties.cpp:29
QgsPointCloudLayerElevationProperties::respectLayerColors
bool respectLayerColors() const
Returns true if layer coloring should be respected when rendering elevation profile plots.
Definition: qgspointcloudlayerelevationproperties.h:199
QgsMapLayerElevationProperties::htmlSummary
virtual QString htmlSummary() const
Returns a HTML formatted summary of the properties.
Definition: qgsmaplayerelevationproperties.cpp:39
QgsPointCloudLayerElevationProperties::applyOpacityByDistanceEffect
bool applyOpacityByDistanceEffect() const
Returns true if a reduced opacity by distance from profile curve effect should be applied when drawin...
Definition: qgspointcloudlayerelevationproperties.h:141
QgsPointCloudLayerElevationProperties::pointColor
QColor pointColor() const
Returns the color used drawing points in elevation profile charts.
Definition: qgspointcloudlayerelevationproperties.h:124
qgis_sip.h
Qgis::PointCloudSymbol::Square
@ Square
Renders points as squares.
Qgis::PointCloudSymbol
PointCloudSymbol
Rendering symbols for point cloud points.
Definition: qgis.h:1888
QgsDoubleRange
QgsRange which stores a range of double values.
Definition: qgsrange.h:202
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
QgsMapLayerElevationProperties::showByDefaultInElevationProfilePlots
virtual bool showByDefaultInElevationProfilePlots() const
Returns true if the layer should be visible by default in newly created elevation profile plots.
Definition: qgsmaplayerelevationproperties.cpp:81
QgsPointCloudLayerElevationProperties::maximumScreenError
double maximumScreenError() const
Returns the maximum screen error allowed when generating elevation profiles for the point cloud.
Definition: qgspointcloudlayerelevationproperties.h:66
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
qgsmaplayerelevationproperties.h
QgsPointCloudLayerElevationProperties::maximumScreenErrorUnit
QgsUnitTypes::RenderUnit maximumScreenErrorUnit() const
Returns the unit for the maximum screen error allowed when generating elevation profiles for the poin...
Definition: qgspointcloudlayerelevationproperties.h:90