QGIS API Documentation  3.21.0-Master (909859188c)
qgsmaplayerelevationproperties.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayerelevationproperties.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 QGSMAPLAYERELEVATIONPROPERTIES_H
20 #define QGSMAPLAYERELEVATIONPROPERTIES_H
21 
22 #include "qgis_core.h"
23 #include "qgis_sip.h"
24 #include "qgsreadwritecontext.h"
25 #include "qgsrange.h"
26 
27 #include <QObject>
28 #include <QDomElement>
29 
40 class CORE_EXPORT QgsMapLayerElevationProperties : public QObject
41 {
42 #ifdef SIP_RUN
44 #endif
45 
46  Q_OBJECT
47 
48 #ifdef SIP_RUN
50  if ( qobject_cast<QgsPointCloudLayerElevationProperties *>( sipCpp ) )
51  {
52  sipType = sipType_QgsPointCloudLayerElevationProperties;
53  }
54  else
55  {
56  sipType = 0;
57  }
58  SIP_END
59 #endif
60 
61  public:
62 
66  enum Flag
67  {
68  FlagDontInvalidateCachedRendersWhenRangeChanges = 1
69  };
70  Q_DECLARE_FLAGS( Flags, Flag )
71 
72 
76 
80  virtual bool hasElevation() const;
81 
87  virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) = 0;
88 
94  virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;
95 
99  virtual bool isVisibleInZRange( const QgsDoubleRange &range ) const;
100 
104  virtual QgsMapLayerElevationProperties::Flags flags() const { return QgsMapLayerElevationProperties::Flags(); }
105 
112  virtual QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const;
113 
114  signals:
115 
119  void changed();
120 };
121 
122 #endif // QGSMAPLAYERELEVATIONPROPERTIES_H
QgsRange which stores a range of double values.
Definition: qgsrange.h:203
Base class for storage of map layer elevation properties.
virtual QgsMapLayerElevationProperties::Flags flags() const
Returns flags associated to the elevation properties.
void changed()
Emitted when the elevation properties have changed.
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 bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the elevation properties from a DOM element previously written by writeXml().
Flag
Flags attached to the elevation property.
Base class for all map layer types.
Definition: qgsmaplayer.h:72
The class is used as a container of context for various read/write operations on other objects.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_END
Definition: qgis_sip.h:194