QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsmeshlayerelevationproperties.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmeshlayerelevationproperties.h
3  ---------------
4  begin : February 2022
5  copyright : (C) 2022 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 QGSMESHLAYERELEVATIONPROPERTIES_H
20 #define QGSMESHLAYERELEVATIONPROPERTIES_H
21 
22 #include "qgis_core.h"
23 #include "qgis_sip.h"
25 #include "qgis.h"
26 
27 class QgsLineSymbol;
28 class QgsFillSymbol;
29 
38 {
39 
40  Q_OBJECT
41 
42  public:
43 
49 
50  bool hasElevation() const override;
51  QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
52  bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
53  QString htmlSummary() const override;
55  bool isVisibleInZRange( const QgsDoubleRange &range ) const override;
56  QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
57  bool showByDefaultInElevationProfilePlots() const override;
58 
64  QgsLineSymbol *profileLineSymbol() const;
65 
73  void setProfileLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
74 
80  QgsFillSymbol *profileFillSymbol() const;
81 
89  void setProfileFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
90 
96  Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
97 
103  void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
104 
105  private:
106 
107  void setDefaultProfileLineSymbol( const QColor &color );
108  void setDefaultProfileFillSymbol( const QColor &color );
109 
110  std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
111  std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
113 };
114 
115 #endif // QGSMESHLAYERELEVATIONPROPERTIES_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().
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
QgsMeshLayerElevationProperties
Mesh layer specific subclass of QgsMapLayerElevationProperties.
Definition: qgsmeshlayerelevationproperties.h:37
Qgis::ProfileSurfaceSymbology
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:1849
qgis.h
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
Qgis::ProfileSurfaceSymbology::Line
@ Line
The elevation surface will be rendered using a line symbol.
QgsMapLayerElevationProperties::hasElevation
virtual bool hasElevation() const
Returns true if the layer has an elevation or z component.
Definition: qgsmaplayerelevationproperties.cpp:29
QgsMapLayerElevationProperties::htmlSummary
virtual QString htmlSummary() const
Returns a HTML formatted summary of the properties.
Definition: qgsmaplayerelevationproperties.cpp:39
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:29
QgsMeshLayerElevationProperties::profileSymbology
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the mesh profile in elevation profile plots.
Definition: qgsmeshlayerelevationproperties.h:96
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
QgsFillSymbol
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgsfillsymbol.h:29
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
qgsmaplayerelevationproperties.h