QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgsabstractprofilesurfacegenerator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsabstractprofilesurfacegenerator.h
3 ---------------
4 begin : April 2022
5 copyright : (C) 2022 by Nyall Dawson
6 email : nyall dot dawson at gmail 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#ifndef QGSABSTRACTPROFILESURFACEGENERATOR_H
18#define QGSABSTRACTPROFILESURFACEGENERATOR_H
19
20#include <memory>
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
25#include "qgsfillsymbol.h"
26#include "qgslinesymbol.h"
27
29
30#define SIP_NO_FILE
31
40{
41 public:
42
44
45 QString mId;
47 QMap< double, double > mDistanceToHeightMap;
48 double minZ = std::numeric_limits< double >::max();
49 double maxZ = std::numeric_limits< double >::lowest();
50
52 std::unique_ptr< QgsLineSymbol > mLineSymbol;
53 std::unique_ptr< QgsFillSymbol > mFillSymbol;
54 double mElevationLimit = std::numeric_limits< double >::quiet_NaN();
55
56 std::unique_ptr< QgsCurve > mProfileCurve;
57
58 QMap< double, double > distanceToHeightMap() const override;
59 QgsPointSequence sampledPoints() const override;
60 QgsDoubleRange zRange() const override;
61 QVector< QgsGeometry > asGeometries() const override;
62 QVector< QgsAbstractProfileResults::Feature > asFeatures( Qgis::ProfileExportType type, QgsFeedback *feedback = nullptr ) const override;
63 QgsProfileSnapResult snapPoint( const QgsProfilePoint &point, const QgsProfileSnapContext &context ) override;
64 QVector<QgsProfileIdentifyResults> identify( const QgsProfilePoint &point, const QgsProfileIdentifyContext &context ) override;
65 void renderResults( QgsProfileRenderContext &context ) override;
66 void copyPropertiesFromGenerator( const QgsAbstractProfileGenerator *generator ) override;
67};
68
77{
78 public:
79
84
86
91
96
100 QgsFillSymbol *fillSymbol() const;
101
112 double elevationLimit() const;
113
124 void setElevationLimit( double limit );
125
126 protected:
127
129 std::unique_ptr< QgsLineSymbol > mLineSymbol;
130 std::unique_ptr< QgsFillSymbol > mFillSymbol;
131 double mElevationLimit = std::numeric_limits< double >::quiet_NaN();
132
133 std::unique_ptr< QgsCurve > mProfileCurve;
134
136
137};
138
139
140#endif // QGSABSTRACTPROFILESURFACEGENERATOR_H
ProfileExportType
Types of export for elevation profiles.
Definition qgis.h:4233
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition qgis.h:4193
@ Line
The elevation surface will be rendered using a line symbol.
Definition qgis.h:4194
Abstract base class for objects which generate elevation profiles.
Abstract base class for storage of elevation profiles.
virtual QgsDoubleRange zRange() const =0
Returns the range of the retrieved elevation values.
virtual void renderResults(QgsProfileRenderContext &context)=0
Renders the results to the specified context.
virtual QMap< double, double > distanceToHeightMap() const =0
Returns the map of distance (chainage) to height.
virtual QString type() const =0
Returns the unique string identifier for the results type.
virtual QVector< QgsAbstractProfileResults::Feature > asFeatures(Qgis::ProfileExportType type, QgsFeedback *feedback=nullptr) const
Returns a list of features representing the calculated elevation results.
virtual QgsPointSequence sampledPoints() const =0
Returns a list of sampled points, with their calculated elevation as the point z value.
virtual QgsProfileSnapResult snapPoint(const QgsProfilePoint &point, const QgsProfileSnapContext &context)
Snaps a point to the generated elevation profile.
virtual QVector< QgsProfileIdentifyResults > identify(const QgsProfilePoint &point, const QgsProfileIdentifyContext &context)
Identify results visible at the specified profile point.
virtual QVector< QgsGeometry > asGeometries() const =0
Returns a list of geometries representing the calculated elevation results.
virtual void copyPropertiesFromGenerator(const QgsAbstractProfileGenerator *generator)
Copies properties from specified generator to the results object.
QgsLineSymbol * lineSymbol() const
Returns the line symbol to be used for rendering the results.
Qgis::ProfileSurfaceSymbology symbology() const
Returns the symbology type for rendering the results.
void setElevationLimit(double limit)
Sets the elevation limit, which is used when symbology() is Qgis::ProfileSurfaceSymbology::FillBelow ...
QgsAbstractProfileSurfaceGenerator(const QgsProfileRequest &request)
Constructor for QgsAbstractProfileSurfaceGenerator.
double elevationLimit() const
Returns the elevation limit, which is used when symbology() is Qgis::ProfileSurfaceSymbology::FillBel...
QgsFillSymbol * fillSymbol() const
Returns the fill symbol to be used for rendering the results.
Abstract base class for storage of elevation profiles which represent a continuous surface (e....
QgsRange which stores a range of double values.
Definition qgsrange.h:233
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
Encapsulates the context of identifying profile results.
Encapsulates a point on a distance-elevation profile.
Abstract base class for storage of elevation profiles.
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
Encapsulates the context of snapping a profile point.
Encapsulates results of snapping a profile point.
QVector< QgsPoint > QgsPointSequence