QGIS API Documentation  3.24.2-Tisler (13c1a02865)
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;
48  bool isVisibleInZRange( const QgsDoubleRange &range ) const override;
49  QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
50 
61  double zOffset() const { return mZOffset; }
62 
73  void setZOffset( double offset ) { mZOffset = offset; }
74 
86  double zScale() const { return mZScale; }
87 
99  void setZScale( double scale ) { mZScale = scale; }
100 
101  private:
102 
103  double mZScale = 1.0;
104  double mZOffset = 0.0;
105 };
106 
107 #endif // QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
QgsRange which stores a range of double values.
Definition: qgsrange.h:203
Base class for storage of map layer elevation properties.
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.
virtual bool isVisibleInZRange(const QgsDoubleRange &range) const
Returns true if the layer should be visible and rendered for the specified z range.
Base class for all map layer types.
Definition: qgsmaplayer.h:73
Point cloud layer specific subclass of QgsMapLayerElevationProperties.
void setZOffset(double offset)
Sets the z offset, which is a fixed offset amount which will be added to z values from the layer.
double zOffset() const
Returns the z offset, which is a fixed offset amount which should be added to z values from the layer...
double zScale() const
Returns the z scale, which is a scaling factor which should be applied to z values from the layer.
void setZScale(double scale)
Sets the z scale, which is a scaling factor which will be applied to z values from the layer.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53